Repository navigation
perf(ci): add low-mutation skip-floor column to /perf - #697
Merged
Alexandre Zollinger Chohfi (azchohfi) merged 4 commits intoJun 26, 2026
Merged
Conversation
Add a second interleaved A/B macro leg at `--percent 0` to the /perf comparison, rendered as its own "Low-mutation skip-floor" table after the 50%-mutation headline table. Why: at 50% mutation the per-tick cost is dominated by the changed cells, so the O(n) positional child skip-walk (ChildReconciler re-walks every child each tick even when nothing moved) is diluted to a fraction of the work. A structural-skip optimization that skips untouched child ranges barely moves the 50% headline number. At `--percent 0` the workload still mutates exactly one cell/tick (StockDataSource.Update clamps the change count to Math.Max(1, ...)), so reconcile/diff isolate that skip-walk floor — it becomes the whole signal, which is what lets such a win clear a paired-delta 95% CI. The floor leg reuses the same interleaving, reps, warmup, GC/affinity pinning, and 95%-CI gating as the headline leg (each leg's delta independently cancels time-correlated drift). Opt-out via -IncludeSkipFloor $false; percent via -SkipFloorPercent. No harness/src change — it just drives the existing exe at a different mutation percent. Tooling-only (tests/stress_perf/**); 0 src/Reactor. PerfLib.Tests 202 / RunPerfBenchmark.Tests 27 green; validated end-to-end against a stub harness (both -IncludeSkipFloor on and off render/omit the table correctly). Co-authored-by: Copilot <[email protected]>
- Keep the paired A/B macro legs (headline + skip-floor) index-aligned: a one-sided run failure now drops BOTH halves of the pair instead of shifting later samples, so Get-PerfPairedDeltaStats (which zips main[i] vs pr[i]) can never compare mismatched run indices. No-op on the happy path. - Add .PARAMETER help for -IncludeSkipFloor / -SkipFloorPercent. - Reword the skip-floor preamble "50%-mutation table" -> "headline table" so it stays accurate when -Percent is customized. - Harden the renderer test with a mixed-direction fixture: rps and reconcile both decrease, but rps (higher-better) must read regression while reconcile (lower-better) reads improvement — locking per-metric direction-awareness. - Refresh stale comment-structure docs (perf-compare.yml header, ci/README "Two tables") to reflect the added tables. Tooling-only; 0 src/Reactor. PerfLib.Tests 203 / RunPerfBenchmark.Tests 27 green. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the /perf CI comparison comment by adding a second interleaved macro leg at near-zero mutation (--percent 0 by default) and rendering its results as a dedicated “low-mutation skip-floor” table immediately after the existing 50%-mutation headline table. This strengthens the harness’ ability to detect improvements that primarily reduce fixed per-tick overhead (e.g., structural-skip work) which are diluted at higher mutation rates.
Changes:
- Added
-IncludeSkipFloor(default on) and-SkipFloorPercent(default0) to the perf runner and implemented a second interleaved main/PR macro loop taggedmain-floor/pr-floor, with results serialized intoresult.json. - Added
Format-PerfSkipFloorSectionand threaded floor aggregates intoFormat-PerfComment, plus unit tests that validate omission/ordering and per-metric direction awareness. - Updated methodology/docs and refreshed the workflow header comment to reflect the expanded comment layout.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/stress_perf/METHODOLOGY.md | Documents rationale for the new low-mutation skip-floor leg and how it isolates the O(n) skip-walk floor. |
| tests/stress_perf/ci/RunPerfBenchmark.Tests.ps1 | Adds assertions that Invoke-OneRun correctly threads --percent via the new -RunPercent parameter. |
| tests/stress_perf/ci/Run-PerfBenchmark.ps1 | Adds new params + a second interleaved macro leg at -SkipFloorPercent, keeps paired runs index-aligned, and threads floor aggregates into outputs. |
| tests/stress_perf/ci/README.md | Updates CI usage docs and comment layout description to include the skip-floor section. |
| tests/stress_perf/ci/PerfLib.Tests.ps1 | Adds coverage for rendering/omission/placement of the skip-floor section and direction-aware statuses. |
| tests/stress_perf/ci/PerfLib.ps1 | Implements the skip-floor renderer and integrates it into the main comment formatter. |
| .github/workflows/perf-compare.yml | Updates workflow header comment to describe the expanded multi-section perf comment. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The skip-floor table renders all four headline metrics with their own direction arrows, including Renders/sec (higher is better), so a blanket 'lower is better' in the preamble contradicted the per-row arrows. Drop the clause (matching the headline Table 1 intro, which carries none) — direction is conveyed per-row and by the comment's global footnote legend. Co-authored-by: Copilot <[email protected]>
- Preamble no longer asserts 'virtually no cell changes' for every -Percent (it is configurable). Reword as a trend: few cells mutate per tick (always >=1) and the closer --percent is to 0, the more the O(n) skip-walk floor is the signal. - Correct the test fixture comment: rps/reconcile/diff move down main->PR while memory is held flat as a within-noise control (not 'EVERY metric moves DOWN'). Co-authored-by: Copilot <[email protected]>
Alexandre Zollinger Chohfi (azchohfi)
marked this pull request as ready for review
June 26, 2026 10:14
Alexandre Zollinger Chohfi (azchohfi)
requested a review
from Chris Anderson (codemonkeychris)
as a code owner
June 26, 2026 10:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a low-mutation skip-floor column to the
/perfcomparison: a second interleaved A/B macro leg run at--percent 0, rendered as its own table directly after the 50%-mutation headline regression table.This is PR3 of the harness-improvement split (PR1 #691 alloc metric + paired-CI, PR2 #693 micro-suite — both merged). Measurement-tooling only: 7 files, all measurement-tooling (incl.
.github/workflows/perf-compare.yml), 0src/Reactor.Why
The headline leg runs at
--percent 50(half the cells mutate per tick). At that rate the per-tick cost is dominated by the changed cells, and a large fixed cost is diluted:ChildReconcilerre-walks all children every tick to find what moved — an O(n) pass that runs whether 1 cell changed or 500 did. At 50% that skip-walk is a fraction of the work, so a structural-skip optimization (skip untouched child ranges) barely moves the headline number.At
--percent 0the workload still mutates exactly one cell per tick (StockDataSource.Updateclamps the change count toMath.Max(1, …)), so virtually every child is unchanged and reconcile/diff time is the skip-walk floor. That makes the floor the whole signal instead of a diluted fraction — which is what lets a structural-skip PR's win clear a paired-Δ 95% CI.This is the column the in-flight reconciler structural-skip work needs to be measured cleanly: at 50% mutation its win is buried; at 0% it is isolated.
Methodology rationale (carried from the n=12 validation)
The earlier validation (12 interleaved PR-vs-
mainpairs on this workload) established the band these harness PRs are built on:The skip-floor leg attacks that last point directly: same interleaving, reps (12), warm-up (2), GC/affinity pinning, and paired-Δ 95%-CI gating as the headline leg (a change is flagged only when the CI excludes 0), but at a mutation rate where the O(n) floor is the dominant term.
Changes
Run-PerfBenchmark.ps1—-IncludeSkipFloor(default$true) +-SkipFloorPercent(default0);Invoke-OneRungains-RunPercent(defaults to$Percent); a second interleaved A/B loop taggedmain-floor/pr-floor; floor aggregates threaded into$ctx+result.json.PerfLib.ps1— newFormat-PerfSkipFloorSection(mirrors Table 1, reuses$PerfMetricSpec+ the paired-CIGet-PerfDelta; empty when either floor aggregate is null);Format-PerfCommentgains-MainFloor/-PrFloorand renders the section after the regression table.PerfLib.Tests.ps1(+11 assertions → 203): section renders/omits, ordering between the regression and cross-framework tables, and a mixed-direction fixture proving per-metric direction-awareness (rps and reconcile both fall, but rps reads regression / reconcile reads improvement).RunPerfBenchmark.Tests.ps1(+2 → 27): locks that the floor leg actually drives the harness at--percent 0(and that omitting-RunPercentfalls back to$Percent).ci/README.md(params + comment section) andMETHODOLOGY.md(new skip-floor subsection).No harness/
srcchange — the floor leg just drives the existing exe at a different mutation percent.Validation
PerfLib.Tests.ps1202 green ·RunPerfBenchmark.Tests.ps127 green.metrics.jsonwhose reconcile/diff scale with--percent): the real orchestrator ran both interleaved legs and rendered the skip-floor table in the designed position with sane numbers (floor reconcile ~8 ms vs 50% headline ~76 ms).-IncludeSkipFloor $falsecorrectly omits the leg and the table.Cost
The floor leg roughly doubles the macro-leg runtime (a second
Warmup + Repsinterleaved A/B). It is opt-out via-IncludeSkipFloor $false. The workflow leaves it on by default so/perfon a fleet PR picks it up automatically.Review
Ran the internal
pr-reviewskill (8 dimensions + a cross-family multi-model check). It surfaced 0 critical / 0 high; all actionable findings are addressed:Get-PerfPairedDeltaStats(which zipsmain[i]vspr[i]) from ever comparing mismatched indices..PARAMETERhelp for the two new params; reworded the floor preamble to "headline table" (accurate for any-Percent); refreshed the staleperf-compare.ymlheader +ci/READMEtable list.Declined with rationale: the
Format-PerfCommentoptional-before-mandatory param order (consistent with the pre-existing-WinUI3/-Rust/-Microconvention; all callers use named binding) and a full orchestration-flow unit test (the main script body isn't dot-sourceable — same reason the pre-existing headline leg isn't unit-tested at that layer; covered by an end-to-end smoke).Discipline
DRAFT until the 5-point harness gate holds (footprint = tooling-only ✓, CI green, Copilot 0-unresolved on final HEAD,
pr-reviewskill + findings addressed, PerfLib.Tests green + local smoke ✓). No/perfrun needed — this changes/perfitself.