Repository navigation
regcount census of .local in the PTX text, and its first run is why it reports rather than gates - #167
Merged
Conversation
…t reports rather than gates Built against the depot a value-select among per-stage shared symbols lowers to -- a `match` yielding pointers or barrier references, one static per stage, which stock LLVM stores to `.local` and reloads in the hot loop. Measured on the real work-stealing gemm at 8192^3 in cuda-learning's `kernels/barrier_bench`, three otherwise-identical kernels: 710 TFLOP/s for the depot spelling against 857 for stage selection as `base.add(i)`. The rings and `SharedPlan` exist so selection is always the latter, but that property was emergent and nothing was watching for the class. The check reads the PTX *text* -- the `.local .align` frame declaration and its `st.local`/`ld.local` traffic -- because the depot is LLVM's and a ptxas spill happens after PTX and never appears in it. Disjoint from the spill columns by substrate, which is exactly how the finding stayed hidden: it shipped as a hard gate on the examples crate plus GATED_KERNELS, and its first run failed on every one of them. 256 B with 64 st.local / 16 ld.local across the whole staged-x8x4 family and every gemm_sol_* rung, 528 B on gemm_cg2, 1824 B on flash_forward, ~1540 B on groupnorm_tile -- all sitting in ptxas' stack column all along, unread, because #152 and every audit before it watched the spill columns, which are ptxas' own decisions and stayed zero. The register-tile probes (band_roundtrip, fragment_map_32x128, the store_ring_* family) carry the same shape -- scalar stores, a quarter as many loads -- so the suspect is a dynamically-indexed fragment array in `reg.rs`, not stage selection. That is a guess and is marked as one. So the raise is demoted to a report until the frames are attributed: failing on a number nobody understands gates nothing. The arming condition is written where the census prints -- a shipped set that reads zero flips it back. The gate variant was watched to fail on the real tree before being demoted, and the report ran green through `scripts/modal-run regcount` with the sentinel seen; the census table diffs across a change the way the register table does.
This was referenced Aug 3, 2026
Merged
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.
Built against the depot a value-select among per-stage shared symbols lowers to — a
matchyielding pointers or barrier references, one static per stage, which stock LLVM stores to.localand reloads in the hot loop. Measured on the real work-stealing gemm at 8192³ in cuda-learning'skernels/barrier_bench, three otherwise-identical kernels: 710 TFLOP/s for the depot spelling against 857 for stage selection asbase.add(i). The rings andSharedPlanexist so selection is always the latter, but that property was emergent and nothing was watching for the class.The check reads the PTX text — the
.local .alignframe declaration and itsst.local/ld.localtraffic — because the depot is LLVM's and a ptxas spill happens after PTX and never appears in it. Disjoint from the spill columns by substrate, which is exactly how the finding stayed hidden: it shipped as a hard gate on the examples crate plusGATED_KERNELS, and its first run failed on every one of them. 256 B with 64 st.local / 16 ld.local across the whole staged-x8x4 family and everygemm_sol_*rung, 528 B ongemm_cg2, 1824 B onflash_forward, ~1540 B ongroupnorm_tile— all sitting in ptxas' stack column all along, unread, because #152 and every audit before it watched the spill columns, which are ptxas' own decisions and stayed zero. The register-tile probes carry the same shape — scalar stores, a quarter as many loads — so the suspect is a dynamically-indexed fragment array inreg.rs, not stage selection. That is a guess and is marked as one; #166 carries the attribution work.So the raise is demoted to a report until the frames are attributed: failing on a number nobody understands gates nothing. The arming condition is written where the census prints — a shipped set that reads zero flips it back (#166 is the exit condition). The gate variant was watched to fail on the real tree before being demoted, and the report ran green through
scripts/modal-run regcountwith the sentinel seen; the census table diffs across a change the way the register table does.