Skip to content

stats: no zero-width intervals; say why there is no CI - #4

Merged
aaronjmars merged 1 commit into
mainfrom
fix/zero-width-ci
Oct 9, 2026
Merged

aaronjmars merged 1 commit into
mainfrom
fix/zero-width-ci

Conversation

@aaronjmars

Copy link
Copy Markdown
Collaborator

Problem

When every paired diff in a comparison is the same, the t interval has zero width. A real run in one of our bench repos (2 tasks, both diffs +0.958) rendered as:

diff +0.958 [0.958, 0.958], n=2 tasks, W/T/L 2/0/0 (sign test p=0.5)

That reads as perfect certainty, and BL005 accepted it as a CI that excludes 0, so it backed a SWITCH verdict.

Fix

  • bench-kit stats: when the standard error is 0 (all per-task values or paired diffs equal, or clustered values that cancel out), it writes no confidence_interval and no standard_error, and sets uncertainty.no_interval_reason, e.g. "all 2 paired diffs equal". The same field now also explains the cases that already had no interval: "1 task", "1 shared task", "1 cluster". Wilson intervals are never zero width and are unchanged.
  • bench-kit render: prints [CI n/a: <reason>] instead of an interval. A zero-width interval still stored in an old manifest prints as [CI n/a: zero width].
  • bench-kit lint:
    • BL005 treats a missing or zero-width CI as no interval, so it can no longer back SWITCH or WINNER. The message says why, e.g. "has no CI (all 2 paired diffs equal)".
    • New warning BL011 flags any stored zero-width interval, in evaluation results or comparisons. This covers hand-written external metrics too.
  • Schema: no_interval_reason (string) is added to the uncertainty object. It is optional, so existing manifests stay valid as bench-manifest/1, and the EEE export still validates.
  • STANDARD.md: section 7 rule 13 and section 9 (BL005 wording, BL011).

After the fix, the same run renders as:

diff +0.958 [CI n/a: all 2 paired diffs equal], n=2 tasks, W/T/L 2/0/0 (sign test p=0.5)

Its SWITCH verdict now gets a BL005 error until the run has more tasks or the verdict changes.

Upgrade note

Manifests written by older versions keep their zero-width intervals until bench-kit stats runs again. Until then, lint reports BL004 (stale numbers), BL005 if a verdict relies on the interval, and BL011. Running bench-kit stats && bench-kit render clears BL004 and BL011. Runs with 1 task also get the new [CI n/a: 1 task] text on the next render.

Tests

uv run pytest: 78 passed (8 new). ruff check and ruff format --check are clean. One existing expectation changed: a 2-task metric with both values 0 used to render [0, 0] and now renders [CI n/a: all 2 task values equal].

No version bump or tag in this PR.

https://claude.ai/code/session_01WE3oeLBZZVrjQmaavkeDCR

When every per-task value or paired diff is equal, the t interval had zero
width (e.g. +0.958 [0.958, 0.958] on 2 tasks), which reads as perfect
certainty. bench-kit stats now leaves out confidence_interval and
standard_error in that case and writes uncertainty.no_interval_reason
(also for 1 task, 1 shared task, 1 cluster). Render prints
[CI n/a: <reason>], BL005 no longer counts a missing or zero-width CI as a
win, and new warning BL011 flags a stored zero-width interval. Schema and
STANDARD.md (section 7 rule 13, section 9) document the field and rule.

Claude-Session: https://claude.ai/code/session_01WE3oeLBZZVrjQmaavkeDCR
@aaronjmars
aaronjmars merged commit 4a6aee9 into main Oct 9, 2026
3 checks passed
@aaronjmars
aaronjmars deleted the fix/zero-width-ci branch October 10, 2026 03:02
aaronjmars added a commit that referenced this pull request Oct 12, 2026
Release the #4 fix: version 0.5.0, standard v2.4 note, README pins and NEXT.
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.

1 participant