Repair the unit-test suite and wire it into CI#15
Open
nh13 wants to merge 2 commits into
Open
Conversation
This was referenced Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The crate's
#[cfg(test)]modules had stopped compiling — they still used the oldModelDataAPI and by-valueModelInputconversion, socargo testfailed with ~50 errors and none of the unit tests ran. Since CI only runs thetests/integration Makefile (cargo build, notcargo test), this went unnoticed. This migrates every test toRMITrainingData/&ModelInput, rewrites the twomod.rstests that used removed helpers againstset_scale/iter, and adds acargo test -p rmi_libstep to.drone.ymlso they keep running. (Barecargo testat the repo root only exercises thermibinary, sincermi_libis a path dependency.)Reviving the tests surfaced one real bug:
FixDupsIter(behindRMITrainingData::iter()) re-emitted the final training row, so every model saw one phantom duplicate. The CDF trainers (ncdf/lncdf/loglinear_slr) compute statistics withn = len()while iteratinglen()+1times, which skewed their parameters; stopping the iterator instead of replaying corrects them. Heads-up: this slightly changes generated-RMI training output, so it's worth a look under the integration suite (I couldn't run the 200M-key SOSD benchmarks locally) —test_iternow pins the iterator's behavior.One expectation was stale rather than buggy: the equidepth-histogram test expected
333for a key past all training data, a leftover from the old PLR-basedlinear_norm_histogram. The currentequidepth_histogramhasnum_bins = 333, so the max bin index is332; I corrected the expected value.Made in collaboration with Claude.