bench: the PC-sampling overhead harness (numbers outstanding) - #91
Open
dpsoft wants to merge 1 commit into
Open
Conversation
…nd the decision it takes Plan Task 12. This produces the instrument, not the verdict: the implementer has CapEff 0 and no GPU, so every number is outstanding and the tier decision is not made. See .superpowers/sdd/task-12-overhead-report.md. The baseline arm is the shipping Phase 4 configuration with PC sampling OFF, not an uninjected run — spec 9.1 already measured injection and the activity path and those costs are paid either way. An uninjected run is taken once before the arms, labelled "calibration", never used as a baseline. The workload is a SECOND one, shim/nvidia/testdata/cuda_concurrent.cu, rather than a change to cuda_workload.cu: that file is the serial fixture the adapter, the join and the source resolution are proven against and the hardware gate asserts against its source lines, and a serial loop gives serialization nothing to destroy. The new one runs several non-blocking streams of non-trivial kernels whose duration comes from a dependency chain rather than a large grid, so they co-reside; its computation is the exact identity, so max_abs_err must be 0 and an arm that perturbed the result fails the run. Realism is measured, not claimed: the harness computes kernel concurrency and mean kernel duration out of the profile and refuses to report anything if the baseline arm is near-serial or its kernels are microseconds long. Every arm proves it ran in the mode it claims, from the producer's own report line and the consumer's counters independently — off means zero PC samples, zero windows and zero bursts; Tier B means samples and no window at all; Tier A means bursts, windows reconciling as 2N or 2N-1, an achieved duty inside a bound derived from the burst timer's tick, and at least one execution actually marked serialized. Cross-arm, a lower duty must open strictly fewer bursts, or the three Tier A arms are one arm under three names. Any failure withholds the decision and exits 3. The four pre-committed clauses are applied mechanically and the fired ones are printed. One finding, reported rather than resolved: cost/duty > 2 is the same statement as cost > 200*duty percent, so at 2.5% duty it is exactly the 5% wall bar — on the plan's own duties the deep-dive-only clause strictly implies the unshippable one and can never be the verdict. The harness says so whenever both fire instead of letting a reader think the branch was considered. Offline: 45 unit tests over the parsers, medians, ratio, all four clauses, the arm assertions each shown red, the concurrency measurement and all four skip branches. Without caps the scenario reports BENCH_SKIPPED, exits 0 and writes no file.
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.
Task 12 of the GPU PC sampling plan. The harness, not the verdict —
CapEff: 0and no GPU here, and the plan is explicit that "this task cannot be completed without hardware, and no part of the tier decision may be made without it." Every number is outstanding; no arm of this benchmark has ever executed.A second workload, not an extension
shim/nvidia/testdata/cuda_concurrent.cu(new,make -C shim nvidia-concurrent).cuda_workload.custays as it is: it is the serial fixture the adapter, the join, source resolution and the hardware gate's source-line assertions are all proven against, and reshaping it would change what those gates measure. It is also the wrong instrument — a serial loop gives serialization nothing to destroy.The new one runs N non-blocking streams whose kernel duration comes from a dependency chain rather than a large grid, so they occupy a fraction of the device and genuinely co-reside. Its computation is the exact identity, so
max_abs_errmust be 0. Compiled here (nvcc 13.3 is on this box) and verified withcuobjdump -sassthat the loops survive: exactly twoFFMAs, each inside its own backward branch — nothing folded or unrolled.Realism is measured, not claimed. Concurrency (
Σ exec duration / span) and mean kernel duration are computed from the profile, and the run fails if the baseline arm is near-serial or its kernels are microseconds long.Every arm proves its own mode, from two ends that can disagree
The adapter's stderr report line and the consumer's counters, both recorded in the JSON. Off ⇒ zero PC samples, windows and bursts. Tier B ⇒ samples and no window. Tier A ⇒ bursts ≥ floor, windows reconciling as 2N/2N−1, no start/stop failures, no graph execs, achieved duty inside a bound derived from the burst timer's tick, and at least one execution actually marked serialized. Cross-arm: a lower duty must open strictly fewer bursts.
Any failure withholds the decision object and exits 3. Tier A gaps are pinned from both sides so the clamp interval collapses to a point and an arm cannot drift to a duty nobody configured.
A benchmark arm that silently did not enable the tier it claims would be this project's signature defect wearing a stopwatch.
A flaw in the thresholds, found without any data
cost ÷ duty > 2is the same statement ascost > 200 × dutypercent — so at 2.5% duty it is exactly the 5% wall-clock bar.TIER_A_DEEP_DIVE_ONLYrequires ratio > 2 at every duty tested, which includes 2.5%, so it strictly impliesTIER_A_UNSHIPPABLE: on the plan's three duties the deep-dive outcome is unreachable whatever the numbers.No threshold was adjusted — deciding thresholds after seeing their structure is the same error as deciding them after seeing data. The harness applies them as written and prints the coincidence whenever both fire. Adding a 1%-duty arm would make the distinction real; that is a decision for whoever runs it.
The reassuring half is pinned too: on the plan's duties the decision is total — opt-in, smaller-duty, or unshippable — never indeterminate.
Verification
45 offline unit tests: the parsers, medians, the ratio, all four clauses fired and not-fired including exactly-at-the-bar, each arm assertion shown red, the concurrency measurement, and all four skip branches. Without caps:
BENCH_SKIPPED: missing required capabilities (CAP_BPF, CAP_PERFMON, CAP_CHECKPOINT_RESTORE)…, exit 0, no output file — and the message names gpuprobe's own set, deliberately notCAP_SYS_ADMIN.go build,go vet,go test ./... -count=1,golangci-lintall clean;make -C shim testunaffected.To run it on the 3090
~26 fixed-work runs, 15–25 min. Exit 0 means the measurement completed — an honest
TIER_A_UNSHIPPABLEis a successful run. Exit 3 means an arm could not prove what it measured, and the numbers are not a decision.