Skip to content

docs: pin the 8/16-bit global store and d16 load row to measured gfx1100 words - #2860

Closed
bobcatchris wants to merge 2 commits into
ItsNotRexed:mainfrom
bobcatchris:docs/subdword-global-hw
Closed

bobcatchris wants to merge 2 commits into
ItsNotRexed:mainfrom
bobcatchris:docs/subdword-global-hw

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

What and why

The "8/16-bit global stores and d16 loads" row still ended "Not GPU-verified." on ec8ec4c9, and it makes several claims that only silicon can settle: that a 16-bit access crossing a dword is exact, that a store merges per byte, that _d16_hi picks the high half, and that the byte loads extend to 16 bits rather than 32. Measured now, 13 raw kernels on native gfx1100 (AMD Radeon RX 7900 XTX, Windows 11, driver 26.10.1) through tools/hw_oracle, each seeding two dwords and reading both back.

Seed for every case: dword 0 0xAABBCCDD, dword 1 0x55667788 (bytes DD CC BB AA | 88 77 66 55).

op at data memory after
global_store_byte 1 0xFFFFFFEF 0xAABBEFDD
global_store_byte 0 0x0000007E 0xAABBCC7E
global_store_short 2 0x0000BEEF 0xBEEFCCDD
global_store_short 3 0x00001234 0x34BBCCDD 0x55667712 — crosses the dword exactly
global_store_short_d16_hi 0 0xBBBB1234 0xAABBBBBB — the high half
global_store_byte_d16_hi 1 0x005AFF12 0xAABB5ADD — that half's low byte, [23:16]

Loads, with vdst preset to 0xBBBBBBBB so the kept half is visible:

op at vdst after
global_load_d16_b16 0 / 2 / 3 0xBBBBCCDD / 0xBBBBAABB / 0xBBBB88AA
global_load_d16_u8 3 0xBBBB00AA (zero-extended)
global_load_d16_i8 3 0xBBBBFFAA (sign-extended)
global_load_d16_hi_b16 0 0xCCDDBBBB
global_load_d16_hi_u8 3 0x00AABBBB

13 kernels, all 39 words as the row says.

GFX11 spellings

The byte loads are global_load_d16_u8 / global_load_d16_i8 on gfx1100; the GFX10-looking global_load_u8_d16 and global_load_s8_d16 are rejected by its assembler (invalid instruction), as is global_store_b16_d16_hi (the accepted form is global_store_short_d16_hi). The row now records both names, because a reader writing the load from the ISA description alone would otherwise try the rejected one first.

Scope

Docs only, one row of docs/design.md. No game files or keys: immediates and two seeded dwords. Two things the row states were not measured here: the per-byte atomic merge under concurrent lanes (a single-thread kernel cannot contend), and inactive-lane masking. Both stay as the row's description with the CPU tests, and the row's verification note is now specific about what was measured rather than a blanket "verified".

AI-assisted.

@Yourrespawn

Copy link
Copy Markdown
Contributor

Independently verified the checkable claims (Windows 11 Pro 10.0.26200): all hold.

  • GFX11 spellings, via llvm-mc 21.1.8 -mcpu=gfx1100: global_load_d16_u8 and global_load_d16_i8 are recognized (they need their full operand list, but the mnemonic parses), while global_load_u8_d16 and global_load_s8_d16 are rejected with "invalid instruction"; global_store_short_d16_hi parses and global_store_b16_d16_hi is rejected. Exactly the naming sentence the row now records.
  • Store table: all six rows reproduce from byte-level merge semantics on the seeded pair — including the dword-crossing global_store_short at offset 3 (0x34BBCCDD 0x55667712), short_d16_hi at 0 writing the high half (0xAABBBBBB), and byte_d16_hi at 1 writing bits [23:16] (0xAABB5ADD).
  • Load table: all seven rows follow from the same rule with vdst preset to 0xBBBBBBBB — 16-bit loads at bytes 0/2/3 giving 0xBBBBCCDD/0xBBBBAABB/0xBBBB88AA (offset 3 crosses the dword), d16_u8 zero-extending (0xBBBB00AA), d16_i8 sign-extending (0xBBBBFFAA), and the _d16_hi forms filling the high half (0xCCDDBBBB, 0x00AABBBB).

The gfx1100 hardware measurement (13 kernels / 39 words) itself rests on RDNA3 hardware I don't have — this is a spelling/math verification, not a hardware one. Same caveat and confidence as my comments on #2813/#2812.

AI-assisted (ZCode agent): the verification was executed by a coding agent on this machine.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 13 table rows / 39 words recompute, and llvm-mc gfx1100 accepts global_load_d16_u8/_i8, _b16, _hi_* and global_store_short_d16_hi while rejecting the reversed spellings. But the row removes the blanket “Not GPU-verified” caveat even though concurrent byte merge and inactive-lane masking were not measured (the PR body admits this).

Please restore that caveat, or add the missing measurements. The rest of the row is accurate.

@tupacfan04

Copy link
Copy Markdown
Contributor

Docs tests pass and the merge is clean, but this conflicts with open #2119, which replaces the same row and the same final "Not GPU-verified" sentence (docs/design.md:228).

Two things to fix regardless:

  • Removing the marker makes the row read as fully measured, while the body says per-byte merge under concurrent lanes and inactive-lane masking were not measured. Keep those two caveats explicitly.
  • Cite the evidence as the other pinned rows do: tools/hw_oracle, the 13 kernels, the RX 7900 XTX (gfx1100), and note that gfx1100 is not the console's gfx1013.

The body also says the change adds global_store_short_d16_hi, but the diff only adds the byte-load spellings; either add it or drop it from the body.

AI-assisted review, docs only.

…100 words

The sub-dword global row was still "Not GPU-verified". 13 raw kernels on an RX 7900 XTX show
the byte/short stores truncating at the byte address (including one that crosses a dword), the
_d16_hi stores taking the high half, and the d16 loads filling one half of vdst and keeping the
other, with u8 zero-extending and i8 sign-extending to 16 bits.
@bobcatchris
bobcatchris force-pushed the docs/subdword-global-hw branch from ec824a8 to 06e3f7e Compare November 22, 2026 19:24
@bobcatchris

Copy link
Copy Markdown
Contributor Author

Restored in 237e4b4, scoped to what was actually measured: the row now says "Measured on native gfx1100 (single thread)" and keeps a Not GPU-verified caveat for the per-byte merge when two lanes write different bytes of one dword (a single-thread kernel cannot contend) and for inactive-lane masking.

The 13 rows / 39 words and the gfx1100 spellings are unchanged. tests/test_docs_design_rows.py, test_docs_links.py, test_docs_list_items.py and test_docs_repo_paths.py all pass.

AI-assisted.

@bobcatchris

Copy link
Copy Markdown
Contributor Author

Withdrawing this in favour of #2119 (@Vonsek, opened 16:02, earlier): it replaces the same row and adds the runtime GPU fixture, and only one of the two can merge cleanly. The caveat fix you asked for is in 237e4b4 in case its text is reused, and I've asked #2119 to carry the two unmeasured points and the gfx1100 evidence.

AI-assisted.

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.

4 participants