perf(bench): min-of-N interleaved with spread, and a Vulcanus block (#19) - #36
Merged
Conversation
) `pnpm perf` reported a median of 3, taken with every iteration of one view run back-to-back before the next started. That could not resolve the size of change it was used to gate - worse than no benchmark, because it produced confident numbers that were noise. Two perf decisions are already parked on hand-rolled loops because of it. Rebuilt around four changes: minimum of N (timing noise is additive and positive, so the min is the least-biased estimator); interleaved round-robin so load drift hits every arm alike; spread (max/min) printed beside every figure; and derived within-process figures rather than absolutes. Adds the Vulcanus block the gate was always quoted against but the tool never measured - 512x512 at origin (0,0), terrain/resources/rocks/cliffs/ all, with marginals and the all/terrain ratio. Defaults satisfy the issue as written (min of 7, all blocks, ~19 min), but FMW_PERF_N / FMW_PERF_TILE_N / FMW_PERF_BLOCK let you run one arm without paying for the rest - the Vulcanus block alone is ~3.7 min. Cheap iteration is the point: the friction of a 19-minute answer is what got the timing loops hand-rolled three times. **One correction to the issue's own prescription, from measuring the result.** #19 proposed `all/terrain` as the stable statistic. Over two back-to-back runs the ratio moved 3.8% while the MARGINALS held to ~2.5% (rocks identical to the millisecond) - the ratio divides two absolutes that drift independently (terrain +4.8%, `all` +0.8%), so it amplifies their disagreement rather than cancelling it. The ratio is still printed because it is the form the "under 2x terrain" gate is written in, but the header, the output preamble and both notes files now say the marginals are what to compare. Reproduction against the hand-measured figures is partial and the notes now say why: terrain reproduces (3394 -> 3402/3566, inside the baseline's own drift) but every overlay marginal is well outside it (resources 2013 -> ~1730, rocks 1362 -> 1079, cliffs 2133 -> ~1875). Three PRs landed on those paths after that measurement - #25, #28, #32 - so the recorded figures are stale rather than the instrument wrong. The gate conclusion is unchanged: `all` measures 2.31-2.40x terrain, still past 2x. Verified all three blocks end-to-end (exit 0, correct emit order) and that the default `vp test` still skips them: 1184 passed, 3 skipped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mcc72rnThnmTuBXZg63D4Y
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.
Closes #19.
pnpm perfreported a median of 3, taken with every iteration of one view run back-to-back before the next started. It could not resolve the size of change it was used to gate - worse than no benchmark, because it produced confident numbers that were noise. Two perf decisions (placement-roll-NOTES.md,vulcanus-cliffs-NOTES.md) are already parked on hand-rolled loops because of it.What changed
Four fixes, all from the issue:
Plus the Vulcanus block the gate was always quoted against but the tool never measured: 512x512 at origin (0,0), terrain/resources/rocks/cliffs/all, with marginals and the ratio.
Knobs
Defaults satisfy the issue as written (min of 7, all blocks, ~19 min). But paying 19 minutes for one number is the friction that got timing loops hand-rolled three times, so:
One correction to the issue's own prescription
#19 item 2 proposed
all/terrainas the stable statistic. Measuring the rebuilt tool over two back-to-back runs says that is only half right:The marginals are the most repeatable figure, not the ratio. The ratio divides two absolutes that drift independently, so it amplifies their disagreement rather than cancelling it. It is still printed - it is the form the "under 2x terrain" gate is written in - but the header comment, the output preamble and both notes files now say to compare marginals, and that a few percent in a ratio is noise.
Reproduction against the hand-measured figures: partial, and the notes say why
DoD asked for a re-run reproducing terrain 3394 / resources 5406 / rocks 4756 / cliffs 5526 / all 8458, ratio 2.492.
Since the marginals are stable to ~2.5% run-to-run but differ from the recorded figures by 11-21%, those are real changes, not noise - and three PRs landed on exactly those paths after the 2026-07-27 measurement: #25 (rocks rendering, "14x too faint"), #28 (
cliff_smoothing-> 1, which the notes measure as ~10% cheaper on the cliff pass), #32 (fixImpossibleCells, ~10% dearer). So the recorded figures are stale, not the instrument wrong. Both notes files are updated to say so.The gate conclusion is unchanged:
allmeasures 2.31-2.40x terrain, still past 2x.Verification
All three blocks run end-to-end (exit 0, correct emit ordering, well-formed output), and the default suite still skips them:
pnpm run verify= 1184 passed, 3 skipped (the third skip is the new Vulcanus block).🤖 Generated with Claude Code
https://claude.ai/code/session_01Mcc72rnThnmTuBXZg63D4Y