Repository navigation
fix(repos): a non-finite gate metric no longer passes its gate - #313
Merged
Merged
Conversation
…st and checks A NaN or infinite gate metric passes its gate, so such a cell is a success. A NaN gate minimum is accepted, and an integer past the float range crashes the manifest check and the reference-check validation. These tests fail on the current code and go through the public callers: gate_ok, the cell's outcome, the manifest check and validate_grading. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
The gate passed a NaN metric (no comparison holds, so the minimum check never fired) and an infinite one (it clears any minimum), so the cell was a success. Gate, score, report, manifest, process counts and reference checks now read a number through one predicate in dokimi/measure.py: - gate: a metric must be finite; a NaN minimum fails every metric - score and process counts: finite and within SCORE_BOUND, as before - report: the same bound as before - manifest: gate minimum finite; score.max within SCORE_BOUND (report refuses a cell past it); positive limits are a float, so a huge int is a problem and not a crash - reference checks: a weight or threshold a float cannot hold is a problem and not a crash Finite values keep their numbers. A gate metric that is a finite int past the float range still compares exactly, since the gate sums nothing. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…ches the overflow Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 10 selected item(s). Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #313 +/- ##
=======================================
Coverage 94.04% 94.04%
=======================================
Files 294 295 +1
Lines 38011 38002 -9
Branches 6432 6429 -3
=======================================
- Hits 35747 35740 -7
+ Misses 1454 1453 -1
+ Partials 810 809 -1
🚀 New features to boost your workflow:
|
Contributor
|
report.py imports both dokimi.measure (this PR) and dokimi.utils.same_model (intel#273). The foundation layer lists llm_cli, llm_json and process_io from main and measure from this PR. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
Contributor
|
Merged current main into this branch (41875ef).
Suite, ruff, mypy, bandit and the strict benchmark run all pass on Linux. |
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.
Part of #4.
Summary
A NaN or an infinite gate metric passed its gate, so the cell was a success.
gate_oktested_is_number(bool excluded, NaN and inf not), andNaN < minis false, so the minimum check never fired;infcleared every minimum. Five other sites re-wrote the same test with different rules. They now share one predicate:Kept different, on purpose:
SCORE_BOUND(a bound on report sums) does not apply to it.report._fail_unmeasurable_scoreasksis_number, to tell a number that is unmeasurable from a value that is not a number at all.Evidence
Before:
gate_okandoutcomeon a gate-only task withmetrics.m = NaN:tests/test_measurement_predicate.py::test_a_cell_whose_gate_metric_is_not_finite_is_not_a_success[nan]and[inf]fail onintel/main; so dotest_a_gate_with_a_non_finite_minimum_fails_every_metric[nan], the manifest cases for a NaN or infinite gate minimum and an out-of-boundscore.max, and the reference cases for10**400(anOverflowErrorbefore the fix).After: the same tests pass; the rest of the file pins the unchanged finite behaviour (scores, process counts,
1e200weight, exact gate comparison of a finite int).Local:
make ci-local CI_LOCAL_ARGS=--offline: ruff, mypy, bandit, the fragment check and the comment-block check pass; project-widemypyis clean. Pytest, two seeds: 10966 passed, and one failure each time,tests/test_process.py::test_sighup_kills_the_live_groups_too, a 30 s wait on a child process under four parallel workers. It failed on both seeds of the full run and passes alone and withtest_process.pyrun on its own.process.pyis unchanged in this PR, so this is a timing failure under load on the shared box, not a regression from this change; it is still open for the maintainers to judge.deptryis not installed in the local venv, so it did not run here.Merge Danger
Door: two-way. Reverting restores the NaN pass. No stored format or schema changes.
Blast Radius: gate
NaNor infinite becomes a failure (success: false) instead of a success. Cells already recorded keep their result; a re-run cell is graded again.repo validaterefuses a gate minimum that isNaNor infinite, and ascore.maxpast1e150. Before, the latter maderepo reportexit 1 on the whole batch.timeout_s,budget_usd,max_turnsor a reference-checkweightorthresholdis reported as a problem rather than raisingOverflowError.score.maxpast1e150, which is refused above.Checklist
pytest -n 4has one failure,test_sighup_kills_the_live_groups_too, a timing test (see Evidence)ruff,mypy, and schema checks passAGENTS.md: two fresh-context passes (diff and description only) over40d325dcandafeaa1e1; no blocking finding; the nits were folded intoafeaa1e1.github/.licenserc.yaml)🤖 Generated with Claude Code