perf: a diagnostic costs nothing on the read or write path, measured (#546) - #551
Open
gafferongames wants to merge 9 commits into
Open
perf: a diagnostic costs nothing on the read or write path, measured (#546)#551gafferongames wants to merge 9 commits into
gafferongames wants to merge 9 commits into
Conversation
#546) The owner's rule, 2026-09-05: "i'm all for greater diagnostics, but if it costs speed on read or write, it's not worth it." The law goes on the page in docs/SPEC-TABLES.md §13.2 and docs/PERFORMANCE.md, quoting him, and arrives with an instrument rather than an intention. bench/tools/perfgate runs the C++ reference over the bench corpus on both wires and compares four rows against bench/PERF-PINS, which records the sitting that cut them. The read row is round_trip, because neither runner times a read on its own: a read cost raises round_trip and leaves write flat, so a red verdict says which path got slower. The pins are not yet cut. The next commit measures them on a quiet box.
) bench/LOCK lifted on 2026-09-05 and left a standing gate behind it: a pull request that moves the packet emitters re-pins the reproduction rows in the same PR and states the sitting that produced them. A pin lock that refused a combined diff would forbid exactly that, so it does not. What it refuses is a re-pin with no sitting behind it, and a sitting.commit the branch does not contain.
…holds on a shared runner (#546)
…nts its environment (#546)
rowan-claude
force-pushed
the
perf-gate-546
branch
from
September 5, 2026 04:53
0dd6669 to
56f3b1f
Compare
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 #546.
The owner's rule, 2026-09-05:
and, on widening and the refusal reasons:
at runtime, when the packet or the table is being read.
1. The law, on the page
docs/SPEC-TABLES.md§13.2 (Cost and allocation, ruled) gains the quotation as a bullet beside the ladder's other rulings, and a paragraph naming what it binds: the read report and its counters, the refusal reasons, retain-unknown's counters (§6.6), the descriptor columns (§8.1), and anything added later that reports.docs/PERFORMANCE.mdgains a section of its own, because that is the page a reader goes to with a question about speed.Both say the same thing and neither says it alone: measured is the operative word, so the law arrives with an instrument.
2. The gate
make perf-gateruns the C++ reference over the bench corpus on both wires and compares four rows againstbench/PERF-PINS:bench_mixedwritebench_mixedround_tripbench_tablewritebench_tableround_tripThe read row is
round_trip, and that is a decision the page had to make. Neither runner times a read on its own, deliberately: the decode's output IS the re-encode's input, which is how the read side gets its sink discipline with no per-language fold to audit (BENCH-STANDARD §2.7). Both runners do print a read rate, round-trip minus write, and both mark it DERIVED and keep it out of the CSV. A gate pinning that number would be pinning a subtraction of two medians, carrying the noise of both. So the gate pins what was measured and reads the pair: a cost on the read path raisesround_tripand leaveswriteflat. A red verdict says WHICH path got slower, not merely that something did.Neither leg's flags are spelled in the gate. It drives
bench/run.sh's own cpp leg andbench/tables/cpp/leg, so it compiles the same translation units, with the same flags, as the published passes do.Two refusals keep it from going quietly green:
spread.max.pctrenders no verdict either. A gate that passes on a noisy box is a gate that passes on noise.3. The negative control
make perf-gate-controlplants the exact shape the law refuses, a counter behind a runtime flag with one added branch per field, on the READ path only, into a scratch copy of the emitter's output underbuild/. It measures a clean sitting and a planted one back to back and requires the plant to separateround_tripfromwriteby more than the band on both wires.The separation, rather than a bare
round_tripdrop, is the verdict on purpose: a box that ran faster during the planted half can hide a real cost inside its own drift, and the difference between the rows cancels whatever the box did to both. It is also the claim the law makes. Nothing is planted on the write path, sowriteis the control's own control.Nothing under
generated/orinternal/codegen/is touched. The plant lands inbuild/.4. Wired into certification
certify.ymlgains aperf-gateleg. It runscheck -advisory(the pin file parses, states its sitting, pins every guarded row, and the job says out loud that it is off the pinned box) and then the negative control, whose verdict is a ratio inside one sitting and therefore holds on hardware nobody here owns. The enforcing comparison stays on the box the pins name.ci.ymlgainsperf-pin-lock, which costs no measurement. It takes the modelbench/LOCK's standing gate uses since the freeze lifted in #545: a pull request moving the packet emitters re-pins the reproduction rows in the same PR and states the sitting. So a combined diff is allowed. What is refused is a re-pin with no sitting behind it (pins moved whilesitting.date,sitting.uptimeandsitting.commitdid not), and asitting.committhe branch does not contain. When the pins move it prints each row's move as a percentage, so the size of a re-pin is visible in the log.5. The pins
Cut on this machine at a stated quiet moment.
bench/PERF-PINSrecords the box, the date, the commit, the compiler and theuptimeline the machine was carrying, and the band's derivation travels with the numbers.One shared hook
bench/run.shandbench/tables/cpp/leggainBENCH_CXXFLAGS_PREFIX, prepended to the C++ bench compiles and empty in every published pass. One caller exists: the negative control, which needs to win the include search over-Igenerated/bench/cpp.perfgate pinrefuses to cut a pin while it is set, because a number measured under flags the shipped build does not carry is a number for a build nobody runs.