Skip to content

perf-bench: fail the run when baseline cases go unmeasured unless --allow-unmeasured - #996

Merged
d-q222 merged 3 commits into
mainfrom
agent/daniel-muse-lead/plan7-perfbench-unmeasured-gate
Sep 27, 2026
Merged

d-q222 merged 3 commits into
mainfrom
agent/daniel-muse-lead/plan7-perfbench-unmeasured-gate

Conversation

@d-q222

@d-q222 d-q222 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Muse lane `plan7-perfbench-unmeasured-gate` (PLAN item 7, stability gate). `--only`-restricted runs now fail loudly by default instead of silently succeeding; `--allow-unmeasured` preserves the old behavior explicitly.

Tests: 2 new unit tests + real end-to-end manual verification of both exit codes.

🤖 Generated with Claude Code

…llow-unmeasured

An --only-restricted run (or a run with refused measurements) now exits
1 and names the unmeasured cases, instead of succeeding silently. The
new --allow-unmeasured flag preserves the old behavior explicitly. The
gate is independent of --check and does not touch the report JSON
schema -- --only-excluded cases are deliberately not added to the
report's unmeasured array, since report::gate treats a baseline id
there as a hard digest-mismatch failure, which would break existing
--baseline --check --only usage (currently a warning only).

Tests: 16/0 (2 new unit tests for excluded_ids/unmeasured_gate_error).
Manual end-to-end with the real debug binary: --only-restricted run
without the flag exits 1 naming all 31 excluded cases; identical run
with --allow-unmeasured exits 0 with unchanged per-case output. No new
build warnings.

Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane plan7-perfbench-unmeasured-gate, slice 1)
Commit-Executor: daniel-muse-lead (Claude Sonnet)
Reviewed-by: daniel-muse-lead (Claude Sonnet)
Muse-Lane-Head: e3b1fe661bb712524606faa40b1b09fe75d08341
Co-authored-by: d-q222 <[email protected]>
@d-q222

d-q222 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

opus-reviewer-B review — ab6f3ce (independent, Claude Opus; did not see the author's reasoning)
Verdict: NEEDS-FIX
Tests: perf-bench debug 17 pass / 0 fail, release 17 pass / 0 fail. The PR's own CI run shows the breakage described below.
Findings:

  1. This breaks the per-PR engine performance CI job. .github/workflows/perf.yml (lines ~90-106) runs the non-full benchmark on purpose with a fixed --only subset (15 ids, excluding the 2 MB document and the other 18 cases). The PR's new gate treats every excluded case as "unmeasured" and exits 1 unless --allow-unmeasured is given, and the workflow is not updated. The PR's own CI run confirms it: engine performance fails with flashtex-perf-bench: 18 baseline case(s) left unmeasured — excluded by --only (18): beamer-blocks-columns, … synthetic-2mb, thesis-chapter. Fix one of two ways:
    • pass --allow-unmeasured in the non-full branch of perf.yml, or
    • scope the gate to cases that were selected but refused, since exclusion by --only is an explicit user choice. The second fits the flag's name better.
  2. Refusals already print a list (main.rs ~384). Turning refusals into a hard failure is a real behaviour change for local runs on machines missing fonts. That is fine if intended, but the README wording should say that refusals alone now fail the run.
    Conflicts: none; merges cleanly with main.

… on refusals

The gate added in ab6f3ce counted every case left out by --only as
unmeasured, so the per-PR subset job in perf.yml (15 --only ids, no
--allow-unmeasured) failed by construction. report::gate already treats
an unselected baseline case as a warning and a refused one as a digest
mismatch, so the extra gate now matches: it fires only when a selected
case produces no valid timing. The excluded count is kept purely as
context in the refusal message and never affects the outcome.

Implementation-Agent: muse-spark-1.3-contributor
Commit-Executor: muse-spark-1.3-contributor
…--only-excluded cases

Fixes review finding 1 on #996: the new unmeasured-case gate counted every
case excluded by --only, so the per-PR perf subset (15 --only ids, no
--allow-unmeasured) failed by construction. The gate now fires only when a
selected case refuses measurement; excluded ids are mentioned in the message
but never counted. README gate paragraph updated.

Verification by the publisher (lane clone, own target dir):
- crates/perf-bench cargo test: 4 suites, 17 passed, 0 failed (debug and --release)
- lane E2E: --only hw1 exits 0 when measured (base exit 1); a forced refusal exits 1
- independent Muse review (xhigh, fresh context): APPROVE, no defects

Implementation-Agent: muse-spark-1.3-contributor (Muse Code, lane pr996-perf-gate-only-subset, slice 1)
Commit-Executor: claude-opus-5-5 (flashtex-2a/opus-10)
Reviewed-by: muse-spark-1.3-contributor (independent review, xhigh); claude-opus-5-5 (flashtex-2a/opus-10)
Muse-Lane-Head: 5065c36
@d-q222

d-q222 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

flashtex-2a/opus-10 (publisher for flashtex-2a's Muse lanes): pushed ab25e4141 onto this branch, a no-ff merge of Muse lane pr996-perf-gate-only-subset (lane head 5065c3688). It addresses review finding 1.

  • Change: the unmeasured-case gate now fails only when a selected case refuses measurement. Cases left out by --only are mentioned in the message but no longer counted, so the per-PR 15-id subset in perf.yml is no longer failed by construction. The README gate paragraph is updated to match.
  • Publisher verification (lane clone, separate target): crates/perf-bench cargo test passes in debug and --release, 17 passed and 0 failed in each.
  • Lane E2E: --only hw1 exits 0 when measured (the base exits 1). A forced refusal of hw1 exits 1 and names the case.
  • Independent Muse review (fresh context, xhigh): APPROVE, no defects.
  • Still open: the lane reports that the per-PR --check command still exits 1 on 6 unicode-accents digest mismatches from a stale baseline. That failure predates this PR and is unrelated to this gate.

🤖 Generated with Claude Code

@d-q222

d-q222 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor Author

flashtex-2a/opus-review @ab25e4141: MERGE-READY

flashtex-2a/opus-review (mac-m5pro-dq222, independent). This re-reviews the head the publisher pushed. All CI is green, including engine performance, which is the job reviewer-B's finding 1 said this gate broke.

  • Finding 1 is fixed. crates/perf-bench/src/main.rs unmeasured_gate_error now counts only the report's unmeasured list, meaning cases that were selected and then refused. Ids excluded by --only go only into the coverage note. So the 15-id per-PR subset in perf.yml:91-96 passes, and this PR's own perf job confirms it.
  • Finding 2 is addressed. The README paragraph now says that a refusal alone exits 1, independently of --check, and that --allow-unmeasured acknowledges it.
  • Overlap with main, not a duplicate. main e015c066f already fails a refused baseline case, but only as a digest mismatch inside report::gate, which needs --check and a baseline (see tests.rs a_baseline_case_refused_by_the_run_fails_but_one_not_selected_only_warns). This PR adds the gate for runs without --check/baseline and for refused cases missing from the baseline. Under CI's --check, a refusal now prints both messages. The exit code is still 1, so that is harmless.
  • The new tests exercise the pure excluded_ids/unmeasured_gate_error functions. No typesetting change, so no pdflatex probe applies. Rule 1 does not apply.
  • It merges cleanly with main 2504dd4b6 (git merge-tree: no conflicts).

@d-q222
d-q222 merged commit ffd66dd into main Sep 27, 2026
11 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