Repository navigation
fix(novelty): refit the dry-run atom count and escalation share on the November runs - #1437
Conversation
…e November runs (intel#1370) `skill novelty analyze --dry-run` projected 55 atoms for the 41-span, 1,278-token artifact whose standard and study runs kept 27 and 33, and 60 for the 55-span, 1,612-token one that kept 40, and counted 20% to 29% more extractor calls than the runs made where the atom count is exact (n09, n16 at 60 atoms). `TOKENS_PER_ATOM` (23) and `ESCALATION_SHARE` (0.5) were fitted on the October runs only. `TOKENS_PER_ATOM` is now 33 and `ESCALATION_SHARE` 0.37, refit on the 12 held October runs and the 17 runs of 2026-11-28. No single tokens-per-atom value holds all 10 uncapped rows to 35% (the median, 28.5, leaves n13 60% high), so 33 is the value with the smallest root-mean-square error (23%). The share is the median over the 13 standard, study and untiered runs with an exact atom count. The estimate's shape, the token profile and the span rule are unchanged. The docs state the refit and its held-out figures. A new test projects each of the 17 runs from its spans and tokens and holds atoms, extractor calls and dollars to a stated error. Test-narrowed: held-02 (371 tokens, 23 spans) is 39% low on atoms and 41% low on calls at any single tokens-per-atom value that fits the November runs, so the held-out atom and call checks (renamed `..._within_45_percent`) allow 45% instead of 35%. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 5 selected item(s). CI at `387d8aa`: 1 failing, 20 passing, 4 skipped
Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1437 +/- ##
==========================================
- Coverage 96.28% 96.26% -0.02%
==========================================
Files 513 513
Lines 68470 68470
Branches 11884 11884
==========================================
- Hits 65924 65914 -10
- Misses 1566 1570 +4
- Partials 980 986 +6
🚀 New features to boost your workflow:
|
napetrov
left a comment
There was a problem hiding this comment.
Change class: LOCAL (head 387d8aa)
- Contract: none
- Responsibility: none
- Dependency: none
- Review depth: skim: local change, check diff + tests
- Coverage gaps: none
I reviewed the estimator constants, fitting population, and published error bounds. All 77 focused tests passed. The docs distinguish fitted observations from independent validation and describe the short-artifact underestimates. CI passed.
Summary
skill novelty analyze --dry-runcounts more atoms and more extractor calls than the paid runs of 2026-11-28 made (#1370). Onmain,resolve_settings(tier, {}).estimate(spans, n_tokens=tokens, budgets=(0.75, 0.5))gives:expected_usdagainst billedWhere the atom count is exact the half of oracle pairs counted as escalated is also too high: 20% (n09) and 29% (n16) more extractor calls than the runs made. The constants
TOKENS_PER_ATOM(23) andESCALATION_SHARE(0.5) were fitted on the October runs only.Of the two fixes the issue offers, this PR takes the first, refitting both constants on the October and November rows together, because it keeps the one rule
max(spans // 2, tokens // TOKENS_PER_ATOM)thatRunSettings.estimateand its test pin.TOKENS_PER_ATOMis now 33 andESCALATION_SHARE0.37. The median of the 10 uncapped rows (28.5 tokens per atom) leaves n13 60% high, and no single value holds all 10 to 35%, so 33 is the value with the smallest root-mean-square relative error (23%). It also reaches the 120-atom cap of the study run n17, which a larger value does not. The worst rows after the refit are n13 (atoms +41%) and the October held-02 (atoms -39%, calls -41%). The share is the median (0.372) over the 13 standard, study and untiered runs with an exact atom count (0.27 to 0.70). A per-tier or span-and-token atom rule is not taken: the evidence for it is the same 10 rows.After the refit, against the billed figure: n13 +57%, n14 +23%, n06 -1% on dollars; n13 atoms 38 (was 55) and extractor calls 169 (was 307); at the cap, n09 268 and n16 268 extractor calls against 281 and 262.
Closes #1370
Changes
dokimi/dokimi/novelty/tiers.py:TOKENS_PER_ATOM23 → 33 andESCALATION_SHARE0.5 → 0.37, with their comments and theestimate_callsdocstring. The shape ofestimateandestimate_calls,CALL_TOKENSandEXTRACTOR_TOKENSare unchanged.dokimi/docs/skill-novelty.md: the paragraph that said the constants were fitted on 13 of the 25 October runs now says they were refit on the 12 held October runs and the 17 November runs (the 13 October rows they were first fitted on are not in the tree, so nothing is held out any more for these two constants), gives the fit, the rows and the share, and restates the held-out figures (calls within 41%, atoms within 39%, dollars within 36%) and the November errors before and after.dokimi/tests/test_novelty_token_profile.py: a test per row of the 17 November runs projects it withresolve_settings(tier, {}).estimate(spans, n_tokens=tokens, budgets=(0.75, 0.5)): atoms equal to the cap for a run at the cap and within 45% of the kept atoms below it, extractor calls within 80% at standard, study and untiered, andexpected_usdwithin 60% of the billed figure at the module's pinned prices. No row is dropped and the fit and held halves are unchanged.dokimi/tests/test_novelty_tiers.py:test_the_projection_constants_are_the_fitted_onespins 33 and 0.37;test_the_atom_count_takes_the_token_rule_when_the_artifact_has_more_tokens_than_spanspins 6 atoms for 7 spans and 198 tokens and 27 for 20 spans and 900 tokens; the held-out atom and call checks are renamed..._within_45_percentand takeCOUNT_TOLERANCE = 0.45in place of 35% (Test-narrowed: held-02 is 39% low on atoms and 41% low on calls at any single value that fits the November runs; no held-out row is dropped). The held-out dollar (55%) and triage dollar (35%) checks keep their tolerances.Risk
--dry-runfigures ofskill novelty analyzechange for standard, study and untiered runs, and for a triage artifact under about 825 tokens and 50 spans, which gets fewer than the 25-atom cap (the 567-token, 42-span held-out triage run: 21 atoms instead of 24, against 25 measured; its dollars stay within 35%). Short standard artifacts are now projected low: the 371-token, 23-span October run is 11 atoms against 18 measured, so itsexpected_usdis -36% andexpected_usdis still not a ceiling. n13 stays the worst November row (+57% dollars, +74% extractor calls). The runs themselves, their caps and the token profile do not change.Open #1411 (docs only, plus a docstring of
_projection) edits the paragraph ofdokimi/docs/skill-novelty.mdright after the one this PR rewrites, and git reports a conflict in that file when both merge; the two edits are about different sentences, so whichever merges second resolves it by keeping both. Open #1197 merges cleanly with this branch.Testing
On Linux, at
387d8aa9909da0707c32245ca10f35def309551b(onmaine260503bbd7dd4f0cddb520160736a8b065510e8):make ci-local: 38 passed, 0 failed, 16 skipped (docker external-catalog smoke, mutation-comment packaging, Claude Code install, jobs conditioned on a push, CLI-surface packaging, conda-forge, docs deploy, fuzz, the intel-ci matrix legs, semgrep). 31,497 tests passed, 27 skipped; changed-line coverage 100%; the mutation of changed lines killed 1 of 1.main's code:3 failed, 17 passed; n06 fails onassert 20 <= (0.45 * 40)(atoms), n14 onassert 22 <= (0.45 * 33)and n13 onassert 28 <= (0.45 * 27).ESCALATION_SHAREback to 0.5 fails n13 on the extractor calls (116 <= 0.8 * 97); droppingmin(cap, expected)fails n09, n10, n16, n17 and the triage rows on the cap; doubling the judge's calls fails n13 and n14 on dollars;TOKENS_PER_ATOM = 45fails n17 on the cap (88 == 120).Open questions
None.
Revert
A plain revert restores the old constants, the old docs paragraph and the old tests. Nothing is stored.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)