Repository navigation
docs(repo): state the 1e150 measure bound of repo report and repo compare, and pin it at sign_flip_summary - #880
Conversation
…pare, and pin it at sign_flip_summary (intel#866) The issue reports baseline_mean and treatment_mean None for three pairs of 1.7e308 and blames an overflowing plain sum. The sum never runs: _mean reads its values through finite_values, which keeps only numbers within SCORE_BOUND (1e150, so that sums and squared deltas stay finite), so the three values are left out and the mean of nothing is None. The same rows at 1e150 give 1e+150. The bound is deliberate and no page of docs/ stated it. repo-evaluation-contract.md now says which values count as a measurement and what happens to one past the bound: a score past it is a grader failure, a cost, turn, token or score_max past it makes the result.json refused, and any other measure past it is left out of the mean. test_repo_compare_overflow.py pins that consequence at sign_flip_summary. No code changes. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). CI at Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #880 +/- ##
==========================================
+ Coverage 95.76% 95.83% +0.07%
==========================================
Files 429 442 +13
Lines 56714 58788 +2074
Branches 9766 10146 +380
==========================================
+ Hits 54310 56340 +2030
- Misses 1494 1522 +28
- Partials 910 926 +16 🚀 New features to boost your workflow:
|
… row; pin out-of-bound means Settles the two threads of the review of intel#880. The contract promised a JSON mean of null for three tasks at 1.7e308, but repo compare drops such a metric to absent, lists the tasks as unpaired and emits no row; the example now says that, and a test runs task_values and _compare_measure to pin it. The sign_flip_summary test also passed with the bound removed, because three 1.7e308 values sum to inf and round to None; it now uses 2 * SCORE_BOUND (a sum that stays finite) and a mix of a valid and an out-of-bound arm. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
vchamarthi
left a comment
There was a problem hiding this comment.
🟡 Not approved yet · reviewed a1c134e
Next: @antonwolfy: settle 1 open question (below). 1 nit optional.
Blocking
- Open question for @antonwolfy: A
scorepast the bound counts as 0 in the mean ofrepo compare(a grader failure intask_values), while a metric or cost past it is left out. State in the bullet that a score past the bound counts as 0 in the compare mean, or leave it out like the other values.
Verified on a1c134e: ✅ changed tests: 39 passed, pass on main too · ❌ full suite with main merged in fails at tests/test_import_architecture.py::test_only_the_frontend_ends_the_process, ci.yml:test / Run tests · ✅ merges onto main · 2 mutations tried · 5 edge inputs tried
8 checks behind it, each with its evidence
| Area | What holds | How |
|---|---|---|
| Bound value | SCORE_BOUND is 1e150 and inclusive: 1e150 and -1e150 are measurements; the next float past it, a 10**400 int, NaN and True are not |
ran it, edge input (measure bound) |
| Cost refusal | A cost_usd past the bound makes _check_cell raise CellFileError; one at the bound is read |
ran it, edge input (measure bound) |
| Score past bound | A score past the bound is no measure, and the grade gets the grader-failure reason the contract quotes |
ran it, edge input (measure bound) |
| Compare row | The changed tests pass on the head (39 passed). test_compare_gives_no_row_for_a_metric_past_the_measure_bound_and_lists_its_tasks_unpaired pins no row and three unpaired tasks at 1.7e308, and a row with means of 1e150 at the bound |
tests on the head |
| Issue premise | sign_flip_summary gives None means for three pairs at 1.7e308 and for three at 2 * SCORE_BOUND; test_sign_flip_summary_leaves_values_past_the_measure_bound_out_of_the_means pins both |
tests on the head |
| Bound pinned in compare | Removing the bound from as_measure fails two changed tests |
broke the code, tests caught it, edge input (measure bound) |
| Bound pinned at source | Raising SCORE_BOUND to 1.79e308 fails two changed tests |
broke the code, tests caught it, edge input (measure bound) |
| Merge | The PR merges onto main with no conflict | merge onto main |
…and states the score-as-0 mean Settles the review nit that only `repo compare` takes `--metric`: the bullet now says `repo report` reads a score, cost, turn count, token count or `process` count, and `repo compare` also reads a `--metric` value. Settles the open question on a score past the bound: the bullet states that `repo compare` counts that grader failure as a score of 0 in its mean (`task_values` in `repos/compare_values.py`). Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@vchamarthi (#880 (review)): The open question holds: |
napetrov
left a comment
There was a problem hiding this comment.
Review: #880 (the 1e150 measure bound in the docs)
Change class: not computed (no receipt profile for this repo, or receipt.py failed)
Verdict: one blocking thread: the bullet this PR adds says a past-bound cell leaves n for every measure, but first_useful_rate keeps it (rate 0.5 with n 2 on head and base). COMMENT review, no approval. Head 2db449b, lane L2.
Raised before: exai-bot's two threads (JSON mean claim, regression test) are fixed on head; vchamarthi's --metric nit is fixed on head.
Follow-up: the rate's n counting a past-bound cell is pre-existing code; a fix would be its own PR.
Unverified: end-to-end repo compare and the bound mutant (not run).
Coverage: whole diff; doc claims against code; rate by probe on both trees; new tests on head with a shim for scipy and regex. Not run: full suite.
vchamarthi
left a comment
There was a problem hiding this comment.
🟢 Approved · re-reviewed 2db449b
Next: nothing required from @antonwolfy.
Verified on 2db449b: ✅ changed tests: 39 passed, pass on main too · ✅ full suite with main merged in: 22839 passed · ✅ merges onto main · 1 mutation tried · 1 edge input tried
8 checks behind it, each with its evidence
| Area | What holds | How |
|---|---|---|
| Score past bound | A score of 1e151 in one of two cells of a score task is read as a grader failure that counts as 0: 0.5 and 1e151 give a mean of 0.25 over two cells, as the bullet says |
ran it |
| Cost refusal | A cost_usd of 1e151 makes load_cells raise CellFileError, as the bullet says for repo report and repo compare |
ran it |
| Other measures | A first_prompt_tokens of 1e151 in one of two cells is left out of its mean and of n: 1e151 and 100 give a mean of 100.0 with n 1 |
ran it |
| Quoted refusal text | The grader-failure text quoted in the bullet is the message grading.py writes for +-1e+150, and the contract file reads as UTF-8 with no CR line endings |
ran it, edge input (text) |
| Bound pinned at sign_flip_summary | Removing the bound from as_measure (dokimi/repos/process_counts.py) fails test_sign_flip_summary_leaves_values_past_the_measure_bound_out_of_the_means and the compare-row test |
broke the code, tests caught it |
| Changed tests | The 39 tests in tests/test_repo_compare_overflow.py pass on the head, and the two new tests pin (None, None) means for values past 1e150 and no compare row for three tasks at 1.7e308 |
tests on the head |
| Full run | The full run of the repo's checks passes with main merged in, with no new failure | full suite, main merged in |
| Merge | The PR merges onto main with no conflict | merge onto main |
…ast-bound cell as a non-hit The bullet said every other value past 1e150 leaves the mean and `n`, but `first_useful_rate` keeps a cell whose `steps` is past the bound: it has a verdict, so it counts as a non-hit in the rate and in its `n` (steps 5 and steps 1e200 give 0.5 with `n` 2). The bullet now names `first_useful_s` and `first_useful_steps` as the ones left out and states the rate's behaviour, and a test pins it. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@napetrov (#880 (review)): The one blocking thread is 4607817906 (the rate's |
@vchamarthi (#880 (review)): Approval with no change asked. The bullet it verified is unchanged except for the |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Summary
The issue reports that
sign_flip_summarygivesbaseline_meanandtreatment_meanNone for finite scores whose plain sum overflows. Its premise does not hold onmain: no sum overflows._meanreads its values throughfinite_values, which keeps only numbers withinSCORE_BOUND(1e150,dokimi/measure.py: squared deltas and sums stay finite), so a value past the bound is no measurement and is dropped before any sum. The mean of the empty list is None.baseline_mean,treatment_meanonmainbaseline=treatment= 1.7e308None,None(all three values are past the bound, so none is a measurement)baseline=treatment= 1e1501e+150,1e+150What was missing is that no page under
docs/states the bound; a reader meets it only in refusal messages. This PR documents it and pins the compare-level consequence with a test. No code behaviour changes. The issue's proposed fix (average withstatistics.meanwhen the plain sum is not finite) is not taken: it would change a deliberate bound, and calling it on the filtered values would divide by zero on the empty list. The eval-side overflow is the subject of #832 and #867, which this PR does not touch.Closes #866 as a documentation fix (not a code fix).
Changes
docs/repo-evaluation-contract.md, §9: a bullet "The measure bound" before therepo comparebullet.repo reportreads a score, cost, turn count, token count orprocesscount, andrepo comparealso reads a--metricvalue, as a measurement only when it is finite and within 1e150. Ascoremetric past it makes the grade a grader failure and a storedgrade.scorepast it is read as one (repos/grading.py,repos/report.py), andrepo comparecounts that grader failure as a score of 0 in its mean (task_valuesinrepos/compare_values.py); acost_usd,num_turns, token count orscore_maxpast it makes theresult.jsonrefused (repos/report.py); any other value past it (a--metric, aprocesscount,first_prompt_tokens,first_useful_s,first_useful_steps) is left out of the mean and ofn;first_useful_ratekeeps a cell whosestepsis past the bound as a non-hit, in the rate and in itsn. Inrepo comparesuch a task is unpaired (no metric:x in baseline or treatment), so a metric past the bound in every task gives no row at all, not an overflow.tests/test_repo_compare_overflow.py:test_sign_flip_summary_leaves_values_past_the_measure_bound_out_of_the_meansruns the issue's own input (1.7e308: both meansNone),2 * SCORE_BOUND(a sum that stays finite: both meansNone), a mix of valid and out-of-bound rows (the mean of the valid ones) and the same rows atSCORE_BOUND(both means equal it).test_compare_gives_no_row_for_a_metric_past_the_measure_bound_and_lists_its_tasks_unpairedrunstask_valuesand_compare_measureon three tasks at 1.7e308: no row, three unpaired tasks; atSCORE_BOUNDa row with that mean.test_first_useful_rate_keeps_a_cell_with_steps_past_the_bound_as_a_non_hitruns two edit cells, steps 5 and steps 1e200 (reason null):first_useful_rate0.5, withn2 for the rate and 1 forfirst_useful_steps.docs/andtests/change.Risk
None: no code changes. The test passes on
mainas well, since it documents existing behaviour.Testing
On a Linux review host, at
3bb9d1b(onmain725417b):make ci-local: 30 passed, 4 failed, 14 skipped (steps that need a tool or job condition this run lacks: micromamba, semgrep, fuzz, the other Pythons' matrix legs, deploy). The 4 failures are not the change's: threewindows-smokesteps stop with[Errno 122] Disk quota exceededwhile installing packages, andtests/test_near_duplicate_blocking.py::test_scale_of_5000_skills_is_a_few_secondstook 10.32 s against its 10 s limit under load and passes alone (16 passed in 2.43 s).tests/test_repo_compare_overflow.py,test_docs_code_refs.py,test_growth_ratchet.py,test_audit_test_quality.py: 1275 passed.main's code:38 passed(test file copied ontomain); it passes there because the PR documents existing behaviour.SCORE_BOUNDfilter inas_measurewith an unbounded one and_meanwithstatistics.meanfails the(None, None)assertion ((1.7e+308, 1.7e+308) == (None, None)); making the bound exclusive (abs(num) < bound) fails the at-the-bound assertion ((None, None) == (1e+150, 1e+150)).as_measure's bound to 1.79e308 fails bothtest_sign_flip_summary_leaves_values_past_the_measure_bound_out_of_the_means(the2 * SCORE_BOUNDcase does not overflow, so it is what catches a missing bound) andtest_compare_gives_no_row_for_a_metric_past_the_measure_bound_and_lists_its_tasks_unpaired._measuredinrepos/useful.pydrop a cell whosestepsis not a measure failstest_first_useful_rate_keeps_a_cell_with_steps_past_the_bound_as_a_non_hit.infand_roundgivesNoneanyway, which is the issue's observation.Open questions
None.
Revert
A plain revert removes the doc bullet and the test. Nothing is stored.
Checklist
pytestpasses [the full run had one timing failure under host load,test_scale_of_5000_skills_is_a_few_seconds(10.32 s against 10 s); it passes alone]ruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)