Skip to content

GAPS.md: audit every claim against the source, and hold the landed half in a test (#65) - #72

Merged
feitreim merged 2 commits into
mainfrom
gaps-audit-65
Jul 28, 2026
Merged

feitreim merged 2 commits into
mainfrom
gaps-audit-65

Conversation

@feitreim

Copy link
Copy Markdown
Owner

Closes #65.

GAPS.md §3.2 read "Missing: everything column-wise, prod, min, generic
row_reduce"
for the whole of #6's life. Auditing the rest the same way — by
reading each module rather than the log, which is the point, since no commit
message contradicts an entry like that — found four more sections describing a
crate that no longer exists, three counts that had drifted, and a work order
that was thirteen-sixteenths closed without saying so.

Claims corrected, with the source that contradicted each

Claim (before) Source What is true
§3.2 "Missing: everything column-wise, prod, min, generic row_reduce, and all shared-tile reductions" src/reg.rs:1665,1687,1713 row_reduce/col_reduce/tile_reduce are generic over ReduceOp; Add/Mul/Max/Min impl it (:290-296); the twelve named wrappers are at :1751-1776. Only the shared-tile/vector half is still missing.
§3.2 "what is left is the strided shuffle across the 8 lanes of a column group" src/reg.rs:1700, :165 column_group_reduce is written — the three-shuffle butterfly over masks 4, 8, 16.
§1.4 "No shared vectors (sv) — Absent entirely" src/shared.rs:850-1039, src/ldst.rs:254,282, src/global.rs:414 SharedVec<E, N> with at/get/set, four TMA paths, a TileBox impl, and ldst::load_vec/store_vec. Landed in #53, three merged PRs before this one.
§1.5 "Global layout is one concrete builder, not a type" / "prerequisite to most of section 2" src/global.rs:443-660 GlobalLayout<E, RANK> for rank 1–5, packed/strided, tensor_map::<T: TileBox>, check_driver_requirements. PanelMap is now a type alias for TensorMap (:677) and encode_bf16_panels a five-line wrapper (:697). The prerequisite is discharged.
§3.1 "The per-column operand of col_map … not yet produced — that reduction is #6" src/reg.rs:1687, src/ldst.rs:254 col_reduce produces one and load_vec reads one out of shared memory.
§3.1 "Missing: the shared-tile and shared-vector instantiations (#13)" gh issue view 13 (CLOSED); no map/fold anywhere in src/shared.rs Still missing, but the pointer is dead: #13 closed on the vector type alone. Now flagged as tracked nowhere.
§2.2 "fp32 only, because the element parameter belongs to Element and that is bf16-only until #2" src/shared.rs:166,252; src/global.rs:69 #2 and #3 landed; F32 is an Element. Still fp32-only, but because GlobalRows names a *mut f32 outright — the stated reason had expired.
§6 "No CI. Nothing runs cargo check … automatically" .github/workflows/{ci,cuda,gpu}.yml, CI.md Three tiers since #17. Replaced with what each gates, and the one real hole (fork PRs get tier 1 only).
§6 "Device tests cover six paths" device-tests/src/main.rs:4500 The harness registers far more than six, including several this entry predates: load_tile/store_tile bands, ldmatrix, both SharedVec ranks, block_reduce, the reduction shuffles, the early-recycle store wait, the repeated-launch TMEM probe.
§6 "We have 73 #[cfg(test)] unit tests … all of them pure coordinate and pointer math" cargo test Both halves stale. The count moves every PR (#59 already fixed 19 → 73), and the tests are no longer all address arithmetic — the error-bound, op-definition, wrapper-resolution and reduction tests are not.
§6 "cargo test --features host" as the command cuda-bindings build script --features host needs cuda.h; it fails on a stock machine. Plain cargo test is the laptop command, --features host is a CI tier.
§6 "four of the ladder's rungs" device-tests/src/main.rs timed_ladder! Four shapes × five spellings = twenty timed kernels.
Header "ferro-kittens is 1851 lines" wc -l src/*.rs 7353. Replaced with the command plus a date, since this one is 4× off and would go stale again.
Work order "Tracked as issues #1–#16" gh issue list #1–#13 are closed and the live set has moved past #16 (#29, #42, #49, #50, #51). Table now lists only what is open, dated, with gh issue list named as the live version.

Verified-still-true, so left alone: §1.3 (Swizzle128B and BaseLdtm are still
the sole impls), §2.3's reduction stores and prefetch (no cp.reduce anywhere),
§2.4's hardcoded cg2, §2.5, §3.3, §3.4's absent transpose/swap_layout, §4's
lcf-only pipeline, §5, and the cuda-oxide table (rev matches Cargo.toml).
Added issue pointers where a gap had one and the file did not say so — #14, #15,
#16, #42, #49, #51 — and marked the five that are filed nowhere.

The check

tests/gaps.rs names every symbol the rewritten sections cite as landed, inside
a generic function that is never instantiated. Nothing in it is
monomorphized, so warp shuffles, stmatrix and TMA intrinsics are safe to name
from a host test; the compiler checks the names and signatures exist and stops
there. Renaming an exported symbol fails cargo test next to the section
claiming it. One real #[test] under it asserts the ReduceOp identities,
which is the one §3.2 claim cheap enough to assert rather than name.

Deliberately not a framework: no registry, no macro, and adding a claim is
adding a line. Scoped to reg/shared/ldst — the modules whose entries this
PR rewrote — and away from src/sync.rs and src/global.rs, which other agents
are editing concurrently.

Absence is the half that matters and it cannot be checked: there is no way to
write "no second FragmentLayout exists". So the missing half stays prose and
gains a date instead, and the header says which half is which.

Two findings for the record

  • modal_app.py::gaps no longer exists. GAPS.md §3.2 (Reductions) is stale from before #6 landed #65 suggests "a note pointing at
    the ::gaps entrypoint"; it was retired at Block-scope reductions: the fold four warps need, and the fp32 Element under it #3 and modal_app.py:219 is now
    only a comment where it used to be. examples/README.md:107 still spells it
    as a command string. Not changed here — that file is next to code other agents
    are editing — but it is the one place a reader would go looking.
  • Modal's image mounts src/ but not tests/ (modal_app.py:135), so tier
    2's cargo test --features host will not see tests/gaps.rs. Harmless as
    written, since the file uses no host-gated item and tier 1 runs it on every
    PR from a full checkout — but worth knowing before anyone puts a host-only
    claim in there.

Verification

  • cargo fmt --all -- --check, cargo clippy --all-targets -- -D warnings,
    cargo test (74 lib + 1 gaps), RUSTDOCFLAGS=-D warnings cargo doc --no-deps
    — all clean locally.
  • modal run modal_app.py::build passes: cargo test --features host is 84
    tests, and both kernel crates codegen for sm_100a.

No source file changed, so nothing this PR touches can affect a kernel.

feitreim added 2 commits July 28, 2026 11:00
…lf in a test (#65)

§3.2 read "Missing: everything column-wise, `prod`, `min`, generic
`row_reduce`" for the whole of #6's life. Auditing the rest the same way —
by reading each module, not the log — found four more entries describing a
crate that no longer exists, three stale counts, and a work order whose
sixteen rows were thirteen-sixteenths closed.

Adds `tests/gaps.rs`: the symbols this file cites as landed, named inside a
generic function that is never instantiated, so warp shuffles and TMA
intrinsics are safe to name from a host test and a rename breaks the build.
Absence cannot be asserted in Rust, so the *missing* half stays prose and
gains a date instead.
@feitreim
feitreim merged commit 9f39839 into main Jul 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GAPS.md §3.2 (Reductions) is stale from before #6 landed

1 participant