Skip to content

fix(novelty): refit the dry-run atom count and escalation share on the November runs - #1437

Merged
antonwolfy merged 1 commit into
intel:mainfrom
antonwolfy:fix/novelty-atom-escalation-refit
Nov 30, 2026
Merged

antonwolfy merged 1 commit into
intel:mainfrom
antonwolfy:fix/novelty-atom-escalation-refit

Conversation

@antonwolfy

Copy link
Copy Markdown
Contributor

Summary

skill novelty analyze --dry-run counts more atoms and more extractor calls than the paid runs of 2026-11-28 made (#1370). On main, resolve_settings(tier, {}).estimate(spans, n_tokens=tokens, budgets=(0.75, 0.5)) gives:

run (tier) spans, tokens atoms kept atoms estimated extractor calls measured extractor calls estimated expected_usd against billed
n13 (standard) 41, 1,278 27 55 97 307 +168%
n14 (study) 41, 1,278 33 55 127 310 +104%
n06 (standard) 55, 1,612 40 60 225 335 +46%
n09 (standard, at the cap) 148, 5,954 60 60 281 338
n16 (standard, at the cap) 142, 4,003 60 60 262 338

Where 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) and ESCALATION_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) that RunSettings.estimate and its test pin. TOKENS_PER_ATOM is now 33 and ESCALATION_SHARE 0.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_ATOM 23 → 33 and ESCALATION_SHARE 0.5 → 0.37, with their comments and the estimate_calls docstring. The shape of estimate and estimate_calls, CALL_TOKENS and EXTRACTOR_TOKENS are 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 with resolve_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, and expected_usd within 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_ones pins 33 and 0.37; test_the_atom_count_takes_the_token_rule_when_the_artifact_has_more_tokens_than_spans pins 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_percent and take COUNT_TOLERANCE = 0.45 in 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.
  • Changelog fragment (Fixed).

Risk

--dry-run figures of skill novelty analyze change 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 its expected_usd is -36% and expected_usd is 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 of dokimi/docs/skill-novelty.md right 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 (on main e260503bbd7dd4f0cddb520160736a8b065510e8):

  • 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.
  • The new test on main's code: 3 failed, 17 passed; n06 fails on assert 20 <= (0.45 * 40) (atoms), n14 on assert 22 <= (0.45 * 33) and n13 on assert 28 <= (0.45 * 27).
  • Mutants of the new test, one break per copy: ESCALATION_SHARE back to 0.5 fails n13 on the extractor calls (116 <= 0.8 * 97); dropping min(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 = 45 fails n17 on the cap (88 == 120).
  • Not run: the matrix legs on Python 3.11, 3.12 and 3.14, the external catalog smoke (needs docker and network) and semgrep.

Open questions

None.

Revert

A plain revert restores the old constants, the old docs paragraph and the old tests. Nothing is stored.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md
  • Each new raise/exit and test names the doc, contract or issue it traces to
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…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>
@antonwolfy
antonwolfy requested a review from a team as a code owner November 30, 2026 12:58
@antonwolfy antonwolfy self-assigned this Nov 30, 2026
@exai-bot

exai-bot commented Nov 30, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 5 selected item(s).

CI at `387d8aa`: 1 failing, 20 passing, 4 skipped

The only failed check, Tests (py3.14), was interrupted by a runner shutdown at approximately 73%; it also printed an unidentified test failure before cancellation. The available logs do not establish whether that test failure was caused by this change, so rerun the check to obtain its traceback (original pytest seed: 3214749862). The other four non-passing checks were intentionally skipped by...

Check Status Assessment
Tests (py3.14) failing at step Run tests Cause unclear. The runner received a shutdown signal and canceled pytest, but pytest had already printed an F without a test name or traceback. The interruption is infrastructure-related; the underlying test failure cannot be attributed to this change or declared pre-existing from the available evidence.
Review details
  • Commit reviewed: 387d8aa against merge base e260503
  • Coverage: 5 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 111k tokens (51k from cache), 17s
  • Tool calls: 8 (6 file_read, 1 ci_status, 1 local_check_results)
  • Novelty atom escalation refit: tiers, token profiles, tests, and documentation: 5 files

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.26%. Comparing base (e260503) to head (387d8aa).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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     
Files with missing lines Coverage Δ
dokimi/dokimi/novelty/tiers.py 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@napetrov napetrov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@antonwolfy
antonwolfy merged commit 1f25c40 into intel:main Nov 30, 2026
33 of 34 checks passed
@antonwolfy
antonwolfy deleted the fix/novelty-atom-escalation-refit branch November 30, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skill novelty analyze --dry-run over-counts calls: the atom estimate and the escalation share

4 participants