compute: decode the 10-bit-x buffer format as 2_10_10_10, not 10_10_10_2 #2184
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2192"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by archielcqp-a11y on 2026-11-25T03:31:48Z.
Refs #2022. This fixes the format table shared by the descriptor-format stores (#1542) and loads (#2150).
Problem
The 10-bit-x packer (x in bits 9:0, y and z in the next 10-bit fields, w in bits 31:30) was registered for
BUF_FMT_10_10_10_2_UNORM, which is gfx10 code 44 and legacy DFMT 8. That format has a different layout: x is the 2-bit field in bits 1:0, followed by 10-bit y, z and w. So a store or load with code 44 would have written or read the wrong fields, with no refusal.Sources:
src/amd/common/gfx10_format_table.pyreverses each name into channel sizes ("Keep the bit sizes in little-endian order"), so2_10_10_10is [10, 10, 10, 2] from bit 0 and10_10_10_2is [2, 10, 10, 10].si_translate_buffer_dataformat) and radv (radv_translate_buffer_dataformat) map formats whose first channel is 10 bits and whose fourth is 2 bits (R10G10B10A2) toBUF_DATA_FORMAT_2_10_10_10.BUF_FMT_10_10_10_2_UNORM44 andBUF_FMT_2_10_10_10_UNORM50, astools/disasm_rdna2.pyalready does.Change
BUF_FMT_2_10_10_10_UNORM(code 50, legacy DFMT 9).Implementing the real
10_10_10_2layout is left out, so the change stays a pure correction.Tests
draw-descriptor-store-format): thexyzwstore uses code 50, with unchanged pinned words. A new GPU run gives that store code 44 and must leave its element at the sentinel.compute_load_format_check.py draw): thexyzwload uses code 50. A fifth invalid-format run gives it code 44 and must leave all 320 words at the sentinel; a zero-filled reference must fail.0x00040FAC). The pinned legacy word for code 50 is0x00048FAC. With the old mapping restored, the store controls and the load model fail.Results
Run at
282f630on8bfbabf(main), Windows 10 build 19045, debug layer enabled, 0 debug errors and 0 debug warnings on every dispatch.tests/compute_store_check.py draw-descriptor-store-formattests/compute_load_format_check.py drawOther checks:
tests/compute_store_check.py binarywith LLVM 15: pass.tests/compute_load_format_check.py binarywith LLVM 15: pass.form_coverage_check,docs_links_checkandbidi_controls_check: pass.No capability skips.
The open d16 PR #2165 uses code 44 in its fixture. Once one of the two merges, I'll update the other.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T03:40:00Z.
Review: COMMENTED
Review of head
282f63012e(comment only).Findings: 0 P1, 0 P2.
BUF_FMT_2_10_10_10_UNORM(gfx10 code 50, legacy DFMT 9). Code 44 / DFMT 8 (10_10_10_2) has a 2-bit x field in bits 1:0, so refusing it is right._legacy_field(9, 0): 50), the format table and the pinned legacy word0x00048FACagree with each other.10_10_10_2_UNORMcase, the store controls reject code 44 and legacy0x00040FAC, and the draw test adds a refused-store run. Docs are updated to match.Commands run locally on the PR head:
python3 -B tests/compute_load_format_check.py-> exit 0descriptor_store_controls()from tests/compute_store_check.py -> passedpython3 tests/docs_links_check.py-> Checked 18 Markdown files and 404 linkspython3 tests/bidi_controls_check.py-> passgit diff --check origin/main...HEAD-> cleantools/compute_store_aot.pyformat table50: ("unorm10", 4)->44:-> store controls FAIL (killed)_legacy_field(9, 0): 50->_legacy_field(8, 0): 50-> store controls FAIL (killed)AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T05:32:17Z.
Review: APPROVED
Verified head
282f6301on Windows x64 (devpreset, MSVC19.44.35228.0, SDK/DXC10.0.26100.0):python -B tests/compute_load_format_check.py-> passedctest --preset dev --no-tests=error -R 'compute_store_aot_.*format' -V-> 8/8 passed (compute_store_aot_mubuf_load_format_d16_{hardware,warp},compute_store_aot_mubuf_format_{hardware,warp},compute_store_aot_mubuf_store_format_{hardware,warp},compute_store_aot_mubuf_store_format_xyz_{hardware,warp})ctest --preset dev --no-tests=error -R '^compute_store_aot_descriptor_load_format_' -V-> 2/2 passed (compute_store_aot_descriptor_load_format_{hardware,warp}; 7 dispatches, 14 wrong references, 11 mutated sources checked,debug_errors=0 debug_warnings=0)AMD Radeon RX 7900 XTX(vendor=1002 device=744c, driver32.0.32029.2010)Microsoft Basic Render Driver(vendor=1414 device=008c, driver10.0.26100.9818)Verdict: Approved at
282f6301.