Skip to content

TileOP: fix element-vs-byte B.IOR stride in MGATHER/MSCATTER and TPREFETCH (#31 remainder) - #95

Merged
VV0003 merged 1 commit into
linxfrom
fix/ior-byte-stride-remainder
Sep 8, 2026
Merged

TileOP: fix element-vs-byte B.IOR stride in MGATHER/MSCATTER and TPREFETCH (#31 remainder)#95
VV0003 merged 1 commit into
linxfrom
fix/ior-byte-stride-remainder

Conversation

@VV0003

@VV0003 VV0003 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Closes the remaining half of #31.

Status of the original report

The main TLOAD/TSTORE paths from the report are already fixed on current linx: the generic TLOAD/TSTORE and the whole layout-converting family (TLOAD2/4_*, TLOAD_CUBE, TSTORE_CUBE, TSTORE_PART) use GetStrideBytes(3). Verified with the issue's own repro shape — FP16 [32,64] TLOAD encodes B.IOR stride 128 (64 elements × 2 bytes), not 64.

What was still broken (this PR)

Auditing every B.IOR stride site found 17 leftovers still passing GetStride(3) — a logical-element stride — into the byte-interpreted slot:

  • MGATHER / MSCATTER / MGATHER_MASK / MSCATTER_MASK (4 sites each): FP16 [32,64] GM encoded stride 64 instead of 128 bytes → every logical row after the first was gathered/scattered at a half-row offset, the exact corruption pattern [PTO v0.58][TLOAD/TSTORE] B.IOR 行跨度元素与字节单位不一致(基于tag:20260823) #31 described for TLOAD, just on the gather/scatter family.
  • TPREFETCH: same element-stride slip (FP16 RowMajor<8,512> encoded 512 instead of 1024); comment updated to name the byte contract explicitly.

All 17 sites now use GetStrideBytes(3) — the same (elements * bits + 7) / 8 conversion the report cited as the correct reference from TLoadBackend/TStoreBackend.

Verification

  • MGATHER FP16 [32,64]: B.IOR stride 64 → 128
  • TPREFETCH FP16 RowMajor<8,512>: 512 → 1024
  • Full gate 64/74 (11 failures identical on unmodified baseline); unittest 40/40

…FETCH

Completes the byte-stride contract from #31 (SuperScalarModel 2d467114):
the generic TLOAD/TSTORE and the layout-converting load/store family were
already fixed to GetStrideBytes(3), but 17 sites still passed
GetStride(3) — a logical-element row stride — into the B.IOR row-stride
slot, which the model interprets as bytes:

- MGATHER / MSCATTER / MGATHER_MASK / MSCATTER_MASK (4 sites each):
  for an FP16 [32,64] GM the B.IOR stride encoded 64 (elements) instead
  of 128 bytes, so every logical row after the first was read from a
  half-row offset — the same corruption pattern #31 reported for TLOAD.
- TPREFETCH: same element-stride slip; comment updated to name the byte
  contract.

Verified by disassembly: MGATHER FP16 [32,64] now encodes 128; TPREFETCH
FP16 RowMajor<8,512> encodes 1024. Full gate 64/74 (11 failures
identical on baseline); unittest 40/40.
@VV0003
VV0003 merged commit 82eb704 into linx Sep 8, 2026
2 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.

1 participant