Skip to content

The pin moves to 20a5616, and two doc claims did not survive the audit - #152

Merged
feitreim merged 2 commits into
mainfrom
pin-20a5616-audited
Jul 30, 2026
Merged

feitreim merged 2 commits into
mainfrom
pin-20a5616-audited

Conversation

@feitreim

Copy link
Copy Markdown
Owner

Rebuilds the orphaned origin/pin-20a5616-wip (db53cf5, one commit on top of pre-stack 0823d92) on top of main at 336e3d7, and audits every prose citation individually rather than blanket-replacing the hash.

The build files

All four manifests, all four lockfiles and CUDA_OXIDE_REF move together. The lock diffs are the rev string and nothing else — zero non-rev changed lines across the four, and zero occurrences of the old hash left in any manifest or lockfile:

$ git diff HEAD -- Cargo.lock */Cargo.lock | grep '^[+-]' | grep -v '^[+-][+-]' \
    | grep -vc 'b099f64c1a32869b74be99f4f88242fb68655b51\|20a56163f258e09f2c51e4c27ae4e4ff17582443'
0
$ grep -rn b099f64 --include=Cargo.toml --include=Cargo.lock . | wc -l
0

cargo fmt --check and cargo metadata --locked pass on all four crates locally — that is the device-surface job, and a stale lockfile is what it fails on.

The only surviving b099f64 outside prose is in upstream_ptx's docstring, which is a provenance statement about where the defect was observed; CUDA_OXIDE_REF itself has moved.

The citation audit

Per #106, every claim was read from a checkout whose git rev-parse HEAD was confirmed to be 20a56163f258e09f2c51e4c27ae4e4ff17582443 before anything was read from it: ~/.cargo/git/checkouts/cuda-oxide-6d394bb007f5e114/20a5616. Six of the seven checkouts in that directory are not the pin, and /Users/finn/projects/cuda-oxide sits at 29396b7 — nothing was read from it.

Re-verified at 20a5616, hash updated:

claim where verdict
the pin ships a thirteen-line clc.rs with no usage example README ~1925 ✅ exactly 13 lines
_x8_pack16 and _x8_raw both [u32; 32] README ~3683, gemm.rs ✅ both status = "active", both [u32; 32]
.x8 variants active with array results; _x8_pure/_x8_raw share one LLVM intrinsic README ~3730 ✅ both map to llvm.nvvm.tcgen05.ld.16x256b.x8
generated/stmatrix.rs ships stmatrix_m8n8_x4 src/ldst.rs ✅ x2/x4, plain and trans
every row of GAPS.md's support table GAPS ~890 ✅ all thirteen rows

Provenance kept at b099f64, annotated rather than rewritten: the gemm_sol_upstream copy point and the stmatrix defect observation. gemm_sol_final/ is byte-identical at the two revisions — diff -r is empty, and upstream's kernels.rs at both revisions plus the vendored gemm_sol_upstream_kernels.rs all hash to 6746e517eca19fdcc01cb0d5003e924bb638f5ee42e8c333d457a0d6f334d6e9. So "copied without a character changed" is verified independently, and the measurement does not turn on the pin.

Two claims that needed more than a hash

src/lib.rs's libdevice claim is not re-establishable at the new pin, so its citation stays put. It said libdevice math is legal beside tcgen05 in one pure-PTX artifact "at cuda-oxide b099f64". Nothing in this tree makes a libdevice call — Abs clears the sign bit rather than calling fabsf, fmax/fmin are comparison-selects, Sqrt/rsqrt lower to native sqrt.rn.f32, and exp2/log2 are FMA polynomials or the ex2 SFU. reg.rs says so on purpose: Abs is a sign-bit clear so that it "keeps the op usable in a pure-PTX artifact whatever becomes of the crate-level claim". No gate exercises it, so a green build says nothing either way, and moving the hash would have been #106's exact failure mode. The claim now names the revision it was established at and says why it stays there.

GAPS.md's cp.reduce claim was wrong, and wrong before the bump. It said cp.reduce.async.bulk.tensor was absent from cuda-oxide "in every form — not in the generated crate and not in intrinsics/imported.json either", and argued from that that reduction stores were a lowering to contribute rather than a transcription. The records are there, and were there at b099f64 too: 64 of them at both revisions, spelled int_nvvm_cp_async_bulk_tensor_reduce_{add,and,dec,inc,max,min,or,xor}_{tile,im2col}_{1..5}d. That spelling is why a grep for cp_reduce_* finds nothing and is how the claim survived as long as it did. What they are not is admitted to the generated cuda-device crate, where the count is zero. That reclassifies #42 as the same shape as prefetch one row below it — a generation-list change, not a lowering — and a smaller ask than the file claimed. This is the orphaned commit's correction, verified at the new pin and kept.

The merge conflict, and one retracted argument beside it

The single conflict was experiments/README.md's .pack::16b section. Took main's side. The incoming version's closing sentence — "The count does not fall, so nothing is being packed two-into-one for the same span" — is exactly the sentence the following paragraphs on main refute as a sixth instance of the register-count error (#47, #63, #67, #76, #81). Only the hash inside main's text changed; the retracted reasoning is not reintroduced.

experiments/src/gemm.rs's doc for the same rung still carried that retracted argument — #147 corrected the README and missed the kernel doc. Repointing the hash in that very doc block would have asserted the retracted reasoning at the new pin, so it now carries #147's two answers instead: cvt.rn.bf16x2 censuses at 0, and the arm faults with Xid 13, Out Of Range Address. This is a doc comment only — no kernel body is touched anywhere in this PR.

Not done here

src/ldst.rs's stmatrix ptx_asm! workaround stays; #145 proved the defect survives the bump, and both ldst.rs and upstream_ptx's docstring now record that the bump drops neither workaround rather than leaving the "run it after a pin bump" instruction to be re-litigated.

Validation

#142's 41-case B200 run predates the #144–#148 stack and is not leaned on. Gate results are posted below; the regcount census against main's is the thing to read, since a compiler-backend bump is exactly the change that moves registers, spills or opcode counts silently.

@feitreim
feitreim force-pushed the pin-20a5616-audited branch from 85d20c1 to 6d67a6d Compare July 30, 2026 01:50
@feitreim

Copy link
Copy Markdown
Owner Author

Gates, all green — and the register census is the finding

gate result
device-surface (local: fmt ×4, metadata --locked ×4, clippy, tests, docs) ✅ 100 tests + doctests, RUSTDOCFLAGS=-D warnings clean
build (Modal) ✅ exit 0 + completion sentinel — includes the ptxas step on kittens_experiments.ptx with upstream's vendored kernels compiled in
regcount (Modal) ✅ exit 0, occupancy gate #95 green, --determinism passes
device_tests (Modal B200) ✅ 42 of 42 cases passed

build green matters more than usual here: it is the step that actually assembles PTX, and it passed with gemm-sol-upstream compiled in — so both toolchain workarounds still hold at 20a5616 and neither is droppable, exactly as #145 predicted.

The device harness is 42 cases, not #142's 41, so the kernels and cases that landed in #147/#148 are covered at the new pin for the first time.

The headline: 44 of 270 register counts moved, and four of them are spills

regcount on 336e3d7 against the same tree with the pin moved, same image, same ptxas. The kernel set is identical on both sides — nothing appeared or vanished — and regcount --determinism passes on the new pin ("identical: 270 kernels, every counter, across two builds"), which is what makes this a function of the revision rather than of the build. #31 is why that control is not ceremony.

This is not an LLVM bump. rust-toolchain.toml is byte-identical between the two revisions and both validate against the same rust-llvm-22.1.2-1cb4e383. Inside rustc-codegen-cuda/src exactly two files differ (collector.rs, generated_intrinsics.rs), beside cargo-oxide's backend.rs.

Most movement is downward — gemm_256x256_k128_s1 246 → 168, gemm_cg2_staged_x8x4_hot 104 → 80 — and nothing examples/ ships regressed: gemm_sol_m256 104 → 96 with no spill, gemm_cg2_staged_x8x4 and groupnorm_tile unmoved.

But four kernels started spilling, and three read as wins on the register count alone:

kernel regs spill st/ld
gemm_ws_staged 43 → 40 0,0 → 16,20
gemm_ws_staged_x8 90 → 80 0,0 → 8,12
gemm_ws_staged_x8x4 90 → 80 0,0 → 8,12
gemm_sol_m512_mma 80 → 80 0,0 → 8,12

A count that falls while spill slots appear is ptxas taking a lower register target and paying in local memory — this file's oldest error, arriving from the toolchain rather than from a diff. No row stopped spilling, so the trade only went one way. (groupnorm_tile's 8/8 in examples/ is unmoved and pre-existing, not new.)

Two of the six gated rows moved — gemm_cg2 166 → 168, experiments' gemm_cg2_staged_x8x4 96 → 80 — and both stay inside their occupancy step, so the gate this repo actually enforces is green on both sides. The spills are a finding, not a blocker.

The opcode census barely moved: 3 of 74 kernels, all in the selp column (gemm_sol_m256_twice_{all,global,shared}, 19 → 17). No memory, MMA, stmatrix or cvt column changed anywhere, so no rung's phase claim is disturbed.

One published number does not survive the bump

gemm_sol_m512_mma is #144/#146's mma only arm — the one at 88.7% of tensor-core peak with nothing memory-shaped left in it — and at the new pin it spills 8/12 at the same 80 registers. That arm is not comparable across the pin and wants re-timing. Nothing else in the K-loop attribution moves, because none of its other arms changed.

Written up in experiments/README.md §7 rather than left in this thread.

Two smaller things checked and closed

  • cuda-core removed a public error variant (ClusteredCooperativeValidationUnsupported) and added two SizeRequirement* ones. The repo never names the enum, so nothing breaks.
  • .reqntid is now emitted from a declared exact block, and the driver enforces it per axis where .maxntid only bounded the product. The repo does declare exact blocks (block = (128,1,1), (192,1,1)) and groupnorm_tile carries #[launch_bounds(128, 3)]; ptxas rejects an entry declaring both, and cuda-macros resolves that by emitting .reqntid alone. build, regcount and 42/42 device cases all pass, so this is closed empirically rather than by reading.

@feitreim
feitreim marked this pull request as ready for review July 30, 2026 01:53
@feitreim feitreim added the gpu-ci Run the B200 device-test tier on this PR (costs GPU minutes) label Jul 30, 2026
@feitreim

Copy link
Copy Markdown
Owner Author

CI, all four green on 6d67a6d — independent of the local runs above:

check
device-surface pass, 26s
build pass, 6m59s
regcount pass, 4m12s
device-tests (B200, via gpu-ci label) pass, 2m6s

device-tests needed the gpu-ci label to run on a PR; added, and it is green there too.

Every Rust change in this PR is a doc comment — git diff main -- '*.rs' has zero non-comment changed lines, so no kernel body is touched and neither live branch (the eight-warp epilogue split, #149) is contended.

cuda-oxide goes from b099f64 to 20a5616 across all four manifests, all four
locks and `CUDA_OXIDE_REF` in `modal_app.py` — nine build files that move
together, since the codegen backend and the device/host/core crates have to come
from one revision. The lockfile diffs are the rev string and nothing else: zero
non-rev changed lines across the four, and `cargo metadata --locked` passes on
each.

#142's 41-case validation predates the #144–#148 stack, so it no longer covers
the tree and is not leaned on. What is leaned on is re-verification: every claim
this commit repoints was read out of a checkout whose `git rev-parse HEAD` was
confirmed to be `20a56163f258e09f2c51e4c27ae4e4ff17582443` first, which is
#106's rule. Six of the seven checkouts in that cargo directory are not the pin,
`/Users/finn/projects/cuda-oxide` (at `29396b7`) among them.

**Two claims did not just need a new hash.**

`src/lib.rs` said libdevice math is legal beside tcgen05 in one pure-PTX
artifact "at cuda-oxide b099f64". Moving that hash would have asserted it at a
revision nothing checks, because **nothing in this tree makes a libdevice
call** — `Abs` clears the sign bit rather than calling `fabsf`, `fmax`/`fmin`
are comparison-selects, `Sqrt`/`rsqrt` lower to native `sqrt.rn.f32`, and
`exp2`/`log2` are FMA polynomials or the `ex2` SFU. So no gate re-establishes
it, a green `build` says nothing either way, and the citation stays at
`b099f64` with the reason written down.

`GAPS.md` said `cp.reduce.async.bulk.tensor` was absent from cuda-oxide "in
every form — not in the generated crate and not in `intrinsics/imported.json`
either", and argued from that that reduction stores were a lowering to
contribute. The records are there, and were there at `b099f64` too: 64 of them
at both revisions, spelled `int_nvvm_cp_async_bulk_tensor_reduce_*` — which is
why a grep for `cp_reduce_*` finds nothing and how the claim lasted. They are
simply not admitted to the generated crate, where the count is zero. That makes
#42 the same shape as prefetch one row below it, a generation-list change rather
than a lowering, and a smaller ask than the file claimed.

**Provenance kept where it is the historical fact.** The `gemm_sol_upstream`
copy was taken at `b099f64` and the port measured there; `gemm_sol_final/` is
byte-identical at `20a5616` and upstream's `kernels.rs` and the vendored copy
all hash to `6746e517…`, so those citations keep `b099f64` and say why. The
`stmatrix` defect is annotated rather than rewritten: #145 proved it survives
the bump, so `ldst.rs`'s `ptx_asm!` workaround stays and `upstream_ptx`'s
docstring now records that the bump drops neither workaround.

**One retracted argument removed rather than repointed.** `gemm.rs`'s
`.pack::16b` doc still carried "the register count does not fall, so nothing is
packed" — the sixth instance of the register-count error (#47, #63, #67, #76,
#81) that #147 refuted and corrected in `experiments/README.md`. Repointing the
hash beside it would have asserted the retracted reasoning at the new pin, so
the doc now carries #147's two answers instead: `cvt.rn.bf16x2` censuses at 0
and the arm faults with `Xid 13`.
@feitreim
feitreim force-pushed the pin-20a5616-audited branch from 6d67a6d to 707abc8 Compare July 30, 2026 02:31
@feitreim

Copy link
Copy Markdown
Owner Author

Rebased onto aaadcc2, and redoing the census changed the finding

Rebase was clean (every Rust change here is a doc comment). Re-verified after it: pin intact in all four manifests + all four lockfiles + CUDA_OXIDE_REF, zero b099f64 left in any build file, and cargo fmt --check + cargo metadata --locked pass on all four crates.

The census is baseline-sensitive, and that is the first result

vs 336e3d7 vs aaadcc2
rows moved 44 of 270 46 of 272
newly spilling gemm_sol_m512_mma, gemm_ws_staged, _x8, _x8x4 gemm_sol_m256_n128 (both crates), gemm_ws_staged, _x8, _x8x4

gemm_sol_m512_mma does not spill against the current main — it goes 80 → 79, 0/0. #154 moves registers on its own, and it moved that kernel out of the spill. My first reading was not wrong about the tree it measured; it was the wrong tree. The newly-spilling set is not stable under the choice of baseline, which is the general lesson.

regcount --determinism passes on the new pin (270 kernels, every counter, two builds), so the diff is a function of the revision. Still not an LLVM bump: rust-toolchain.toml byte-identical, both at rust-llvm-22.1.2-1cb4e383, only collector.rs/generated_intrinsics.rs + cargo-oxide's backend.rs differ.

Four spills, and every one falls in register count

kernel crate regs spill st/ld
gemm_sol_m256_n128 both 86 → 80 0,0 → 4,8
gemm_ws_staged experiments 43 → 40 0,0 → 16,20
gemm_ws_staged_x8 experiments 90 → 80 0,0 → 8,12
gemm_ws_staged_x8x4 experiments 90 → 80 0,0 → 8,12

All four read as improvements on the register count alone. None are. That is ptxas taking a lower target and paying in local memory — the register-count error this repo has been burned by five times (#47, #63, #67, #76, #81), arriving from the toolchain instead of from a diff, which is a sharper version of the same point than any of the five. No row stopped spilling.

gemm_sol_m256_n128 is the one that matters: unlike the gemm_ws arms it is a shipped launch variant (Variant::M256xN128, what select_variant picks for a shape too narrow to fill a wave of the wider tile), and it spills in both crates. Occupancy gate #95 green both sides; opcode census moved in 3 of 80 kernels and only in selp.

The decomposition survives — re-timed on both pins, laddered

Thank you for the correction on 88.7%; I re-ran the K ladder (sol_ablate), not the launch figure. Each arm twice, at [256, 256] 4096², as % of peak:

arm old pin new pin
feed only 103.2 / 104.2% 104.2 / 103.8%
mma only 99.5 / 99.6% 99.7 / 99.6%
issue only 99.6 / 99.5% 99.8 / 99.7%
no drain 80.4 / 80.4% 80.2 / 80.9%
whole 78.5 / 79.0% 79.0 / 78.7%
runtime stage 76.4 / 76.3% 76.9 / 77.1%

Every arm agrees across the pin to 0.2 points or better, inside its own two-pass spread. [512, 256] is the same at 99.3–99.7% on both. Upstream's ladder: 82.3% old, 81.9% new.

mma only is still at peak, so "the MMA issue stream has no deficit" stands and no row of the published decomposition needs amending.

One number does not reproduce and it is not the pin's: mma only is published at 100.6% and reads 99.5–99.6% on the old pin at aaadcc2. Old and new pin agree to 0.1 point, so #154 or the session moved it, not the bump. Flagged rather than silently restated — it is not mine to fix, but it should not sit there unremarked.

The shipped spill does not resolve as a time

bench sol-small (both rungs twice round-robin) on both pins. The two pins cannot share a container, so the N128/N256 ratio is beside the absolute rates:

shape N128 old → new N256 old → new ratio old → new
1024³ 0.0144 → 0.0147 0.0179 → 0.0187 0.807 → 0.786 (−2.6%)
1536³ 0.0160 → 0.0171 0.0211 → 0.0212 0.758 → 0.807 (+6.4%)
2048³ 0.0249 → 0.0260 0.0241 → 0.0242 1.035 → 1.074 (+3.8%)
3072³ 0.0560 → 0.0572 0.0452 → 0.0469 1.238 → 1.221 (−1.4%)

The ratio moves ±6.4% with inconsistent sign, and M256xN256 — whose register count did not move — reads 0.5–4.8% slower too. A change that hits the unmoved kernel as hard as the moved one is the container, not the diff.

So the spill's cost is unestablished rather than zero. That table's own spread column runs 4–87% at these shapes, which is why it says so itself, and settling it needs a same-container A/B that a dependency bump cannot provide. It is the one open item the pin leaves, and the static 4/8 is why it is worth opening.

Both earlier flags kept in the PR: cuda-core dropping public ClusteredCooperativeValidationUnsupported (never named here), and .reqntid now driver-enforced per axis where .maxntid only bounded the product — closed empirically by green build, regcount and 42/42 device cases.

@feitreim

Copy link
Copy Markdown
Owner Author

CI green on the rebased head 707abc8 (base aaadcc2): device-surface 23s, build 5m27s, regcount 4m32s, device-tests 2m21s — 42 of 42 on a B200.

…ll is outside the hot loop

Measured against `aaadcc2` rather than argued about, because a compiler-backend
bump is exactly the change that moves registers with nothing watching: `regcount`
on `aaadcc2` and on the same tree with the pin moved. 46 of 272 rows moved, the
kernel set is identical on both sides, and `regcount --determinism` passes on the
new pin — 270 kernels, every counter, across two builds.

**This census was taken twice and the answer changed.** Against `336e3d7` it was
44 of 270 rows with `gemm_sol_m512_mma` among the newly-spilling four; #154 landed
in between and moves registers on its own, and against `aaadcc2` that kernel is
80 -> 79 with no spill. The newly-spilling set is not stable under the choice of
baseline, so a dependency diff has to be taken against the commit it will land on.

Not an LLVM bump: `rust-toolchain.toml` is byte-identical and both revisions
validate against `rust-llvm-22.1.2-1cb4e383`. Two files differ inside
`rustc-codegen-cuda/src` (`collector.rs`, `generated_intrinsics.rs`) beside
`cargo-oxide`'s `backend.rs`.

Four rows started spilling and **every one falls in register count while doing
so** — that is `ptxas` taking a lower target and paying in local memory, this
file's oldest error arriving from the toolchain instead of from a diff. No row
stopped spilling. Those columns are **bytes**, which is worth 20x: `4,8` is one
32-bit register stored once and reloaded twice, not four stores and eight loads,
and the file now says so where it prints them.

`gemm_sol_m256_n128` is the only one that ships (`Variant::M256xN128`), so it is
the only one that had to be answered.

**The decomposition survives, laddered on both pins.** `mma only` reads
99.5/99.6% of peak on the old pin and 99.7/99.6% on the new, every arm agrees
across the pin to 0.2 points or better inside its own two-pass spread, and
`[512, 256]` is the same at 99.3-99.7%. So `mma only` is still at peak and no
published row needs amending. One number does not reproduce and it is not the
pin's: `mma only` is published at 100.6% and reads 99.5-99.6% on the *old* pin at
`aaadcc2`, so #154 or the session moved it.

**The shipped spill is outside the hot loop, and a CPU container settled it.**
`bench sol-small` could not: the N128/N256 ratio moves +-6.4% with inconsistent
sign and `M256xN256`, whose registers did not move, reads 0.5-4.8% slower too, so
that table's 4-87% spread is the container and not the diff. The disassembly can.
`nvdisasm -c` through `_print_sass_loops`' backward-branch loop finder says the
pin adds **exactly three** local-memory instructions to `m256_n128` and none to
the two unspilled controls: one `STL` and two `LDL` at `[R1+0x100]`, which is the
4 and 8 bytes arrived at independently. All three sit in 510-727 instruction
regions; the innermost 216-instruction loop, where this kernel's 64 pre-existing
frame accesses live on *both* pins, contains none of them. That bounds the cost at
<=0.6% of issue in one outer loop and zero in the inner one, against an instrument
that reproduces to 4-87%. Below the noise floor, with the noise floor stated.
@feitreim
feitreim force-pushed the pin-20a5616-audited branch from 707abc8 to a47adfa Compare July 30, 2026 02:52
@feitreim

Copy link
Copy Markdown
Owner Author

Step 1 settled it. #152 lands — the spill is outside the hot loop, and one register wide.

Pushed as a47adfa42382018b96848bd2b8295177c75d839c (base aaadcc2). Step 2 was not needed; no GPU container was spent.

First, a units correction that changes the magnitude by 20×

ptxas -v reports "N bytes spill stores, M bytes spill loads" — _parse_ptxas's _FRAME regex confirms it. So gemm_sol_m256_n128's 4,8 is one 32-bit register, stored once and reloaded twice — not four stores and eight loads. gemm_ws_staged's 16,20 is four or five registers. I wrote "spill slots" in my earlier reports, which reads as instruction counts and over-states the whole table by more than an order of magnitude. Corrected in experiments/README.md where the columns are printed, since a reader will make the same mistake.

Where the spill lives

nvdisasm -c through _print_sass_loops' backward-branch loop finder, both pins, with the two unspilled entries as controls:

kernel old pin new pin spill bytes
gemm_sol_m256_n128 64 LDL/STL 67 0,0 → 4,8
gemm_sol_m256 (control) 64 64 0,0 → 0,0
gemm_sol_m512 (control) 64 64 0,0 → 0,0

The pin adds exactly three instructions, only to the kernel that spills: one STL and two LDL at a single address, [R1+0x100]. That is the 4 bytes stored and 8 bytes loaded, arrived at independently from the disassembly.

The controls were load-bearing. All three kernels already carry 64 local accesses on both pins, from their own 256-byte frames. So LDL/STL presence was never the spill, and counting them without a control would have "found" 67 hot-loop local accesses and concluded the opposite.

And they are not in the hot loop

access count tightest containing loop
the 64 pre-existing, both pins 64 216 insns/iter
STL [R1+0x100] — new 1 727 insns/iter
LDL [R1+0x100] — new 2 510 insns/iter

The innermost 216-instruction loop — where the 64 frame accesses live, and the tightest structure in this kernel — contains none of the new traffic. The spill is one register saved and restored around a 510–727 instruction region.

Cost bound: three instructions per 510 ⇒ ≤0.6% of issue in that outer region, and exactly zero in the inner loop.

The noise floor, stated

The instrument that would have to see ≤0.6% is bench sol-small, which reproduces to 4–87% at these shapes — and independently, its N128/N256 ratio moved ±6.4% with inconsistent sign while M256xN256 (registers unmoved) read 0.5–4.8% slower, which is the container. So the effect is roughly an order of magnitude below what the instrument can resolve, in the one region where it is nonzero at all.

Below the noise floor, and that is the noise floor. Per your rule: #152 lands. The spill is real, localized to one register, outside the hot loop, and cannot matter at any shape M256xN128 serves. I am not raising the register floor on that entry: it would be a kernel change to fix something bounded at ≤0.6% of issue in a cold region, and the #[launch_bounds] it would need is a real occupancy commitment on a shipped variant, which is a change that should be made on its own evidence rather than as a rider here.

Housekeeping

The diagnostic entry point was temporary and is not in the diff — modal_app.py's only changes in this PR remain the CUDA_OXIDE_REF bump and the upstream_ptx docstring correction (git diff origin/main -- modal_app.py is 5 insertions, 2 deletions). Every Rust change is still a doc comment, zero non-comment lines.

Post-rebase re-verification, as asked: pin present in all four manifests and all four lockfiles, zero b099f64 in any build file, cargo fmt --check and cargo metadata --locked green on all four crates.

@feitreim
feitreim merged commit 3419920 into main Jul 30, 2026
4 checks passed
feitreim added a commit that referenced this pull request Jul 31, 2026
…t reports rather than gates (#167)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gpu-ci Run the B200 device-test tier on this PR (costs GPU minutes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant