Repository navigation
Description
Found by the #127 work (PR #135), which declined to act on it — correctly, since it is a safety contract and loosening one on reasoning alone is the dangerous direction.
src/ldst.rs:210-213, load_fragment's safety contract:
chunksmust belong to a tile at leastrow + 16rows tall whose bytes are already visible to the generic proxy (a TMA load needs its barrier waited on, astmatrixneedsfence.proxy.async.shared::cta), andcolumn + 16must fit the tile.
Why it looks wrong
fence.proxy.async.shared::cta orders generic-proxy writes so the async proxy (TMA, tcgen05 MMA) can see them. That is the fence store_fragment's and tma_store's contracts owe, and it is correct there — those are generic-write then async-read.
But stmatrix and ldmatrix are both generic-proxy accesses: warp-level shared-memory store and load executed by threads. Generic-to-generic needs no proxy fence at all. What it needs, when the writing and reading threads differ, is a barrier. The TMA half of the same sentence is right (async write, generic read, ordered by the load's own mbarrier) — it is the stmatrix half that does not follow the rule the rest of the crate states.
src/shared.rs's publish_to_async_proxy doc, added in #135, states that rule explicitly and lists the two cases where the fence is not owed, one of which is exactly a generic-write/generic-read pair.
What would settle it
Not reasoning — this needs a B200. Both the redundant-fence reading and the missing-barrier reading produce working code most of the time, which is what makes a wrong contract here expensive later rather than now.
- Whether any caller pairs
store_fragment/stmatrixwithload_fragment/ldmatrixon the same tile today, and across warps or within one. - Whether the sentence meant
bar.syncand named the wrong instruction, or meant a case that does not arise.
If it is redundant, the fix is to say barrier and cite the rule; if the real hazard is a missing barrier, the contract is understating the obligation, which is the direction worth finding out about.
Not urgent, and why it is filed anyway
load_fragment is the .x2 load side, which #131 notes is the half that never got .x4. The contract being wrong costs nothing until someone builds on it — which is precisely when a wrong safety contract is most expensive. Related: #131, #129.
Activity
A device-tests case for what orders an `stmatrix` before the `ldmatri…
The fence between an `stmatrix` and an `ldmatrix` is a barrier, and `…
The fence-only row read stale too, so the fence failing to order the …
The `.x4` load side inherits the barrier obligation, and its contract…
An `ldmatrix` reads what `stmatrix` wrote under a barrier, measured: …