Skip to content

bench.py follow-up; ruff format --check as a CI gate - #100

Merged
skavhaug merged 13 commits into
masterfrom
bench-followup
Sep 27, 2026
Merged

skavhaug merged 13 commits into
masterfrom
bench-followup

Conversation

@skavhaug

Copy link
Copy Markdown
Member

What

  • CLAUDE.md §2 (Ola, 2026-09-27): lines count as written; hand-packing under # fmt: skip / # fmt: off is allowed with a reason.
  • tools/bench.py fixes (red 48cb90f before green c854edd):
    • exactly 5 % slower is ACCEPTED; float rounding had flagged it as a regression (now compares exact products);
    • a missing --dem/--domain or a malformed/missing named run.json exits 3 naming the file, before any build;
    • the baseline search skips a malformed stored run.json with a UserWarning.
  • ruff format --check . as a gate (Ola): ruff pinned ~=0.16.8; docs/ (cited code quotations) and .claude/ excluded from formatting; one layout-only reformat 41db2ab (ASTs and comments identical), listed in .git-blame-ignore-revs; the step in CI, in the after-commit hook (Ola's yes) and in CLAUDE.md's local gates.
  • bench.py's # fmt: off had its # fmt: on indented, so formatting never switched back on and the gate skipped run to EOF; removed in 91d5b76 (AST identical).
  • Citations: nine stale citations in the 05b, 05c and 06 records pinned to the commit they were written at, or corrected.

Review

@Reviewer: several rounds, APPROVED at d6d6beb. Local: pytest 1719 passed / 6 skipped; mypy, ruff check, ruff format --check, governance gates green.

Merge with a merge commit, not a squash: .git-blame-ignore-revs names 41db2ab.

🤖 Generated with Claude Code

skavhaug and others added 13 commits September 27, 2026 09:45
…son (Ola)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two follow-ups from @Reviewer's round on tools/bench.py, approved by Ola
(2026-09-27), pinned in bench-py.md's "Pinned by the red suite":

- Threshold boundary: exactly 5 % (20.0 -> 21.0) is ACCEPTED, 5.5 % is a
  REGRESSION; same at 7.5. Red today: 21.0 / 20.0 - 1 rounds above 0.05,
  so the ratio test calls exactly 5 % a regression.
- Clean exits: a missing --dem or --domain, and a malformed run.json the
  caller named (compare NEW_DIR, compare/run --baseline), exit 3 with the
  file named and no evidence; run refuses before building. A malformed
  run.json met in the baseline search is skipped with a UserWarning naming
  it (settled here, reasons in bench-py.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- verdict: a time regression is `new * 100 > base * (100 + threshold)`,
  exact products instead of the rounded ratio, so exactly 5 % is ACCEPTED.
- _load raises BenchError naming the run.json it could not read or
  validate; run refuses a missing --dem/--domain and a bad --baseline
  before the build and any child, compare refuses a bad NEW_DIR or
  --baseline; both exit 3 through typer.Exit.
- find_baseline skips a malformed run.json with a UserWarning naming it.
- bench-py.md "Size": the 700-line ceiling is per PR (lines the PR adds or
  changes), replacing the "about 10 lines of room" misreading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed quotations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Layout only, produced by `ruff format .` (0.16.8). Listed in
.git-blame-ignore-revs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…format

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inned or corrected; bench-py.md points at §2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…VER fixture

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…26-09-27)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nwards

The top-level `# fmt: off` before run() was paired with a `# fmt: on`
indented inside the function body. ruff honours `fmt: on` only at the
indentation of its `fmt: off`, so formatting stayed off to end of file
and `ruff format --check` skipped run(), compare() and child_main().

The run() signature is already in ruff's own format (one parameter per
line, none over 100 columns), so no exemption is needed: both lines are
removed and ruff format changes nothing. AST unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y it went

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@skavhaug
skavhaug merged commit 997b8fc into master Sep 27, 2026
8 checks passed
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