From 23f1c68fe011cc9e9604c3ac3c5136dcb67ef174 Mon Sep 17 00:00:00 2001 From: Aaron Elijah Mars <61592645+aaronjmars@users.noreply.github.com> Date: Tue, 13 Oct 2026 16:07:35 -0400 Subject: [PATCH] bench-kit v0.5.1: readable tiny numbers and sign-test p Values below 1e-6 render in e-notation with 3 significant figures, and a sign-test p below 0.001 renders as p<0.001. A 520-task comparison printed p as a 150-digit decimal. --- NEXT.md | 5 ++++- README.md | 6 +++--- STANDARD.md | 6 ++++-- pyproject.toml | 2 +- src/bench_kit/__init__.py | 2 +- src/bench_kit/render.py | 13 ++++++++++++- tests/test_lint_render.py | 4 ++++ uv.lock | 2 +- 8 files changed, 30 insertions(+), 10 deletions(-) diff --git a/NEXT.md b/NEXT.md index 726912e..2ff6f0a 100644 --- a/NEXT.md +++ b/NEXT.md @@ -1,6 +1,6 @@ # Next -Updated 2026-10-12. +Updated 2026-10-13. 1. Paired Bayes interval for small-n pass rates (Bowyer et al. 2025), next to the paired t. 2. Converters into manifest + samples: Harbor job/trial `result.json`, and EVMbench-style per-audit `grade.json` results. @@ -11,6 +11,9 @@ Updated 2026-10-12. 7. export-eee: carry sample transcripts into EEE `messages` for multi_turn and agentic runs (today an empty list). 8. Task filters: a negated match (`not_in`) and a lint warning when a filter keeps no task, if a bench needs them. +Done in 0.5.1 (2026-10-13): tiny numbers print in e-notation below 1e-6 and a sign-test p below +0.001 prints as `p<0.001` (a 520-task comparison printed p as a 150-digit decimal). + Done in 0.5.0 (2026-10-12): no zero-width intervals (`uncertainty.no_interval_reason`, render `[CI n/a: ]`, lint BL011). diff --git a/README.md b/README.md index 2f5c74b..08b6f68 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A results standard for benchmark repos, with JSON Schemas, a renderer, small-sample stats, a linter and an Every Eval Ever exporter (STANDARD.md is the source of truth). ## Status -Updated 2026-10-12. State: active, v0.5.0. Next: see NEXT.md. +Updated 2026-10-13. State: active, v0.5.1. Next: see NEXT.md. ## Latest result bench-kit is tooling, not a bench, so it has no runs. The standard it enforces is in STANDARD.md. @@ -26,7 +26,7 @@ per task x subject x repeat. bench-kit then: ## Run it ```bash # from a bench repo checkout -uv tool install git+https://github.com/aaronjmars/bench-kit@v0.5.0 # or: pipx install git+https://... +uv tool install git+https://github.com/aaronjmars/bench-kit@v0.5.1 # or: pipx install git+https://... bench-kit stats && bench-kit render && bench-kit lint bench-kit export-eee --out eee-export --org "Your Org" ``` @@ -34,7 +34,7 @@ bench-kit export-eee --out eee-export --org "Your Org" In any repo's GitHub Actions CI: ```yaml - uses: actions/checkout@v4 -- uses: aaronjmars/bench-kit@v0.5.0 +- uses: aaronjmars/bench-kit@v0.5.1 with: args: --warn-only # drop once the repo is migrated ``` diff --git a/STANDARD.md b/STANDARD.md index dd1cc5e..fef72d3 100644 --- a/STANDARD.md +++ b/STANDARD.md @@ -1,4 +1,4 @@ -# Bench standard v2.4 (bench-kit 0.5.0) +# Bench standard v2.4 (bench-kit 0.5.1) One shape for every bench repo: how runs are recorded, checked and reported, whatever the bench measures (models, agent harnesses, prompts, CI runners, @@ -122,7 +122,9 @@ Extra sections may follow Layout. Numbers in generated files: values of 1 or more (and 0) use 3 decimals with trailing zeros dropped (money 2 decimals); values below 1 use 3 significant -figures, so a cost of $0.00042 per task prints as `$0.00042`, never `$0.00`. +figures, so a cost of $0.00042 per task prints as `$0.00042`, never `$0.00`. Values +below 1e-6 print in e-notation with 3 significant figures (`2.35e-137`), and a sign-test +p below 0.001 prints as `p<0.001` (bench-kit 0.5.1). ## 4. Manifest (`runs//manifest.json`, schema `bench-manifest/1`) diff --git a/pyproject.toml b/pyproject.toml index 9cdddfc..0353dde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "bench-kit" -version = "0.5.0" +version = "0.5.1" license = "MIT" description = "Shared standard, schema, renderer, stats and linter for bench repos" readme = "README.md" diff --git a/src/bench_kit/__init__.py b/src/bench_kit/__init__.py index 35dece7..6c5e6f3 100644 --- a/src/bench_kit/__init__.py +++ b/src/bench_kit/__init__.py @@ -1,3 +1,3 @@ """bench-kit: shared standard, schema, renderer, stats and linter for bench repos.""" -__version__ = "0.5.0" +__version__ = "0.5.1" diff --git a/src/bench_kit/render.py b/src/bench_kit/render.py index 4102259..6ecbcf8 100644 --- a/src/bench_kit/render.py +++ b/src/bench_kit/render.py @@ -34,15 +34,26 @@ def fixed(x: float, decimals: int, signed: bool = False, strip: bool = True, min return s +TINY = 1e-6 + + def num(x, signed: bool = False) -> str: if x is None: return "n/a" if isinstance(x, bool) or not isinstance(x, (int, float)): return str(x) + if x != 0 and math.isfinite(x) and abs(x) < TINY: + # below 1e-6 fixed notation runs to dozens of zeros; 3 significant figures in e-notation + return f"{x:+.{SIG - 1}e}" if signed else f"{x:.{SIG - 1}e}" s = fixed(x, 3, signed) return "0" if s in ("+0", "-0", "") else s +def p_text(p: float) -> str: + """Sign-test p as reported in papers: p<0.001 below that, else the plain value.""" + return "p<0.001" if p < 0.001 else f"p={num(p)}" + + def ci_text(unc: dict | None) -> str: """ " [lower, upper]", or " [CI n/a: why]" when there is no real interval. A stored zero-width interval (e.g. from an older bench-kit) is not printed: [0.958, 0.958] would read as perfect certainty.""" @@ -135,7 +146,7 @@ def comparison_line(c: dict) -> str: if c.get("wins") is not None: wtl = f", W/T/L {c['wins']}/{c['ties']}/{c['losses']}" if c.get("sign_test_p") is not None: - wtl += f" (sign test p={num(c['sign_test_p'])})" + wtl += f" (sign test {p_text(c['sign_test_p'])})" note = f". {c['note']}" if c.get("note") else "" up = c.get("unpaired") or {} shared = "" diff --git a/tests/test_lint_render.py b/tests/test_lint_render.py index d465c9b..a873c81 100644 --- a/tests/test_lint_render.py +++ b/tests/test_lint_render.py @@ -179,6 +179,10 @@ def test_num_and_money_keep_small_values(): assert render.num(3.14159) == "3.142" assert render.num(-0.0004, True) == "-0.0004" assert render.num(0) == "0" and render.num(0.9996) == "1" + assert render.num(2.35e-137) == "2.35e-137" + assert render.num(-4.2e-9, True) == "-4.20e-09" + assert render.num(0.0000012) == "0.0000012" + assert render.p_text(2.35e-137) == "p<0.001" and render.p_text(0.0312) == "p=0.0312" and render.p_text(1.0) == "p=1" assert render.money(0.00042) == "$0.00042" assert render.money(0.4) == "$0.40" assert render.money(0) == "$0.00" diff --git a/uv.lock b/uv.lock index ab12612..034db6a 100644 --- a/uv.lock +++ b/uv.lock @@ -17,7 +17,7 @@ wheels = [ [[package]] name = "bench-kit" -version = "0.5.0" +version = "0.5.1" source = { editable = "." } dependencies = [ { name = "jsonschema" },