Skip to content

perf(ci): make micro-suite incompleteness loud + recalibrate alloc band - #704

Merged
Alexandre Zollinger Chohfi (azchohfi) merged 3 commits into
mainfrom
perf-micro-loud-incomplete
Jun 26, 2026
Merged

Alexandre Zollinger Chohfi (azchohfi) merged 3 commits into
mainfrom
perf-micro-loud-incomplete

Conversation

@azchohfi

Copy link
Copy Markdown
Collaborator

What & why

Two coupled follow-ups to the micro-suite leg, both surfaced by the #692 acceptance run (where the 13-bench micro section was silently absent from the /perf comment for #693's entire life because a timeout dropped it with no visible trace). Class-B harness-only PR — 0 src/Reactor changes, everything under tests/stress_perf/ci/**.

(c) Make incompleteness LOUD in the /perf comment

The root failure was silence: Invoke-MicroInterleaved returns $null on too-few-rounds → Format-PerfMicroSection returned @() → the section just vanished, indistinguishable from "not run". Now:

  • Format-PerfMicroSection has an explicit 3-way visibility contract:
    • rows present → the table, preceded by a > [!WARNING] "Incomplete — N/13 benches" callout when a side dropped benches (a short table otherwise looks like a clean full run);
    • no rows but an omit reason → a > [!WARNING] "Micro-suite omitted this run — <reason>" callout (the leg was attempted and failed);
    • no rows and no reason → empty (leg not requested → stay silent).
  • The orchestrator now captures the omit reason at all three failure sites (interleave kept <2 paired rounds / exe not built / leg threw) and threads it through Format-PerfComment -MicroOmitReason. The Invoke-MicroInterleaved return contract is unchanged (still $null on failure — its scenario tests A–E are untouched); the reason is inferred one level up.
  • New $script:MicroExpectedBenchCount = 13 (canonical spec-047 M1–M13; source of truth is AllBenches.cs) drives the N/13 check.

(d) Recalibrate the micro ALLOC band for the reduced iteration count

PR5a (#700) cut MicroIterations 10000→1000 to fit budget, but left MicroAllocMinEffectPct = 1.0 — the value effectively validated at 10000 iters. The residual per-op process-to-process alloc offset on non-deterministic benches (M5 dispatcher) scales as offset/iterations, so 1.0% is now too tight → latent false-flag risk (measurement-only; mislabels a verdict, never blocks a merge).

  • MicroIterations 1000 → 2000 (the coordinator's stated (a)/(d) target; halves the per-op offset vs the merged 1000; ~+2–4 min micro leg, well within the 75-min job timeout; per-round 180s cap bounds any hang).
  • MicroAllocMinEffectPct 1.0 → 3.0 — a deliberately conservative interim hedge (≤ the ns band), chosen to avoid a false-flag at 2000 iters while still catching real structural alloc changes (several percent to many-x). Provisional, exactly like the ns band: the precise value can only be set from a real-CI identical-binary interleaved A/B at the live iteration count, which builds from the default branch → a post-merge calibration expected to tighten it back toward the true offset.
  • Refreshed the stale band-rationale comments (the "not rep-interleaved" note predates PR5b; the ns "wider than alloc" note — both bands are now provisionally equal pending calibration) and a 16-bench→13-bench typo.

Footprint

4 files, all tests/stress_perf/ci/**, 0 src/Reactor:

  • PerfLib.ps1 — render contract + band constants
  • Run-PerfBenchmark.ps1 — omit-reason capture + iter default
  • PerfLib.Tests.ps1 / RunPerfBenchmark.Tests.ps1 — coverage

Tests

PerfLib.Tests 272 (+15) and RunPerfBenchmark.Tests 72 (+2) green CI-style. New coverage: omit-callout render, N/13 incompleteness note, silent-when-not-requested, end-to-end -MicroOmitReason threading, and the updated 2000-iter default assertion. The band-integration test is unchanged (its ~0.3% synthetic rise reads "noise" under either band).

Two decisions flagged for coordinator verify

  1. The 1000→2000 iter bump reverses perf(ci): fit the reconciler micro-suite inside its per-side budget #700's merged 1000. It aligns the merged state with the coordinator's stated ~2000 target. One-line revert to 1000 if the tighter budget is preferred.
  2. The 3.0% alloc band is PROVISIONAL pending a post-merge identical-binary A/B (same discipline as the ns band). The flag stays armed but conservatively banded.

🤖 Class-B coordinator-merge: gate-clean DRAFT → both reviews → HOLD for coordinator verify + press. Do not self-merge.

Co-authored-by: Copilot [email protected]

The reconciler micro section silently vanished from the perf-compare comment
whenever the leg produced no comparison (the #693 regression: a per-round
timeout dropped M5-M13 and went unnoticed for the PR's entire life). The omit
reason was only Write-Log'd to the build log; the comment just lacked the table,
so a timeout/missing-exe/thrown leg read as a clean absence.

Surface incompleteness in the COMMENT instead:
- Run-PerfBenchmark.ps1 captures a $microOmitReason at each omit site (interleave
  kept < 2 paired rounds, micro exe not built, leg threw) and threads it into
  Format-PerfComment.
- Format-PerfMicroSection renders a visible GitHub [!WARNING] callout
  ("Micro-suite omitted this run -- <reason>") when there are no rows but the leg
  was attempted, and an "Incomplete -- N/13 benches" warning above the table when
  fewer than the canonical spec-047 M1-M13 count paired (a short table is
  otherwise indistinguishable from a clean full run). Stays silent only when the
  leg was not requested (null rows AND no reason).
- New $script:MicroExpectedBenchCount = 13 sources the completeness check from the
  AllBenches.cs M1-M13 canonical count.

Invoke-MicroInterleaved's return contract is unchanged (still $null on too-few
rounds), so the existing interleave scenarios A-E are untouched; the omit reason
is derived at the orchestrator level.

Tests: PerfLib.Tests +15 (omit callout, N/13 note, silent-when-not-requested,
end-to-end threading through Format-PerfComment), RunPerfBenchmark.Tests +2
(omit reason captured + threaded). 272 + 72 assertions green CI-style.

Co-authored-by: Copilot <[email protected]>
PR5a cut MicroIterations 10000 -> 1000 to fit the per-side CI budget, but the
micro-suite ALLOC min-effect band (MicroAllocMinEffectPct) was left at 1.0 --
the value that was effectively validated at 10000 iters. The residual per-op
process-to-process alloc offset on non-deterministic benches (M5 dispatcher)
scales as offset/iterations, so at the lower count the 1.0% band is too tight
and risks a latent false-flag on live main (measurement-only -- it mislabels a
verdict, never blocks a merge).

- Raise MicroIterations 1000 -> 2000: the coordinator's (a)/(d) target; halves
  the per-op offset vs the merged 1000 and keeps wide headroom under the 180s
  per-round timeout (a round needs tens of seconds; a hang is still bounded).
- Widen MicroAllocMinEffectPct 1.0 -> 3.0 as a deliberately conservative interim
  hedge (<= the ns band) so it does not false-flag at 2000 iters, while still
  catching real structural alloc changes (several percent to many-x).

The PRECISE band, like the ns band, can only be set from a real-CI identical-
binary interleaved A/B at the live iteration count (it runs from the default
branch, so it is a POST-MERGE calibration); that pass is expected to tighten the
band back toward the true offset. The band rationale comment was also refreshed
to reflect PR5b's rep-interleaving (the old "not rep-interleaved" note was
stale) and the ns "wider than alloc" note (both bands are now provisionally
equal pending calibration).

Tests: RunPerfBenchmark.Tests asserts the new 2000 default; PerfLib.Tests band-
integration is unchanged (its 0.3% rise reads noise under either band). 272 + 72
assertions green CI-style.

Co-authored-by: Copilot <[email protected]>

Copilot AI 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.

Pull request overview

This PR updates the /perf CI harness micro-suite reporting so that missing/incomplete micro results are visible in the sticky comment (instead of silently disappearing), and adjusts micro-suite capacity/threshold constants to better match the newer iteration budget.

Changes:

  • Add a visibility contract for the micro-suite section (explicit warning when omitted; warning when incomplete vs expected bench count).
  • Thread a captured micro omit-reason from the orchestrator into Format-PerfComment/Format-PerfMicroSection.
  • Recalibrate micro defaults/bands (MicroIterations default to 2000; alloc min-effect band to 3.0%) and extend tests accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/stress_perf/ci/PerfLib.ps1 Adds micro omit/incomplete rendering contract, introduces expected bench count constant, updates min-effect band, and threads -MicroOmitReason into comment rendering.
tests/stress_perf/ci/Run-PerfBenchmark.ps1 Captures micro omit reasons at failure points, passes them into Format-PerfComment, and bumps -MicroIterations default to 2000.
tests/stress_perf/ci/PerfLib.Tests.ps1 Adds/updates tests for the new micro section visibility contract and end-to-end omit-reason threading.
tests/stress_perf/ci/RunPerfBenchmark.Tests.ps1 Updates default assertions (2000 iterations) and locks the new omit-reason wiring into the assembled comment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/stress_perf/ci/PerfLib.ps1 Resolved
Comment thread tests/stress_perf/ci/PerfLib.ps1 Resolved
The PR5c loud-incompleteness check undercounted the micro suite as 13
benches. BenchCatalog.All actually emits 16 for `--variant Reactor`
(spec-047 M1-M13 + OAlloc / OUpdate / C207), and Read-MicroBenchResults
has no bench-id allowlist, so all 16 are compared. With ExpectedCount=13
a real 13-of-16 run reads "complete" -- and extra rows could mask a
missing M-bench (>=13 rows, no warning) -- the exact silent-omit this PR
exists to kill. Caught independently by the internal pr-review fan-out,
the gpt-5.4 cross-check, and the GitHub Copilot reviewer.

- PerfLib.ps1: $script:MicroExpectedBenchCount 13 -> 16, with a doc
  comment naming the 3 supplementary benches and the source of truth.
  Setting the denominator to the true full emitted count eliminates the
  masking: the max distinct paired count is 16, so any dropped bench
  drops below 16 and fires the warning.
- Drift guard (PerfLib.Tests): parse BenchCatalog.All from AllBenches.cs
  and assert it equals the constant, so the mirror cannot silently drift
  again. Source is read, never built -- runs on any host.
- Default-resolution test: Format-PerfMicroSection with no -ExpectedCount
  must resolve to the canonical 16 (the production Format-PerfComment
  call shape that the wrong default would have mis-labeled).
- Close the last silent-omit path (review F2): when the interleave
  succeeds but yields zero comparable rows, set an omit reason so the
  section renders the loud callout instead of vanishing. Per-site
  omit-reason assertions added for all four failure modes.
- Sanitize the omit reason (review F3 / Copilot): collapse whitespace +
  CR/LF and cap length before interpolating into the single-line GitHub
  blockquote, so a stack-trace-laden message can't corrupt the comment.
- Lock the widened 3.0% alloc band (review F4): near-threshold tests
  prove a ~2% delta now reads noise (would have flagged at the old 1.0%)
  while a ~4% delta still flags; fix the stale "~1%" band comment.
- Revert the wrong "13-bench" comments to 16; update the stale README
  MicroIterations default 1000 -> 2000.

PerfLib.Tests 283 green, RunPerfBenchmark.Tests 76 green. Footprint:
5 files, all tests/stress_perf/ci/**, 0 src/Reactor.

Co-authored-by: Copilot <[email protected]>
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) marked this pull request as ready for review June 26, 2026 16:56
@azchohfi
Alexandre Zollinger Chohfi (azchohfi) merged commit 52baebb into main Jun 26, 2026
20 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.

2 participants