T5: A console reference #412

Open
opened 2026-11-28 20:48:43 +00:00 by JeffreyBytes · 3 comments
JeffreyBytes commented 2026-11-28 20:48:43 +00:00 (Migrated from github.com)
Contributor

Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-28T20:48:43Z.


I'll take T5. I've got an RX 6700 XT (Navi 22, gfx1031) on RADV, Mesa 26.3.1.

tools/native_rdna2/ (@JohnVonWells) already runs hand-written instructions natively through ROCm with MODE set by s_setreg_b32, so I'm building on that instead of starting something new. It works on my card with HSA_OVERRIDE_GFX_VERSION=10.3.0: check_sad.py matches the checked-in RX 6950 XT receipt exactly.

First piece is in (#420, merged), the float arithmetic family: 20 instructions under all 1,024 MODE values through ROCm, and 17 of them again through RADV as a second witness (a compute shader per instruction, checked against the driver's disassembly). The two agree on every bit they share, and RADV's default is MODE 0xc0.

Second piece is in too (#437, merged): what VOP3 clamp and the output modifiers do under every MODE value, which is the part #333 left open.

Third piece is in too (#469, merged): the approximate ones (rcp, rsq, sqrt, log, exp, sin, cos), where only the chip can say what the exact bits are. f16 comes out correctly rounded, f32 is within one unit but not predictable, and RADV agrees with ROCm on every word they share.

Fourth is #446, merged: check_basic_alu_gpu.py now holds its float results to this reference instead of its own looser models. The old models computed from denormal sources the card flushes. What a host may still do differently is named and counted under tolerated. Two translator faults are left among those names: v_fma_f32 gets rounded twice when a v_mul_f32 shares its product (the one from #333), and on NVIDIA v_min_f32, v_max_f32, v_floor_f32 and v_ceil_f32 don't flush a denormal source. The second needs a flush in the translator. The NVIDIA runs (RTX 3090 and RTX 5090) came from contributors, thanks both.

What I think the deliverable is: the kernels and check scripts, the card's results checked in as evidence so the checks can be held to real hardware without needing an RDNA 2 card, and a doc with what matched and what didn't. If you had something else in mind for T5, tell me.

One limit: this is a GFX10.3 card and Xbox programs mix GFX10.1 and GFX10.3 instructions. The gfx1030 assembler refuses v_mad_f32, v_mac_f32 and the other RDNA 1 multiply-adds, and recorded shaders use them, so a card like mine can't be the reference for those. That would need a gfx1013 board (a BC-250, say). Does anyone have one?

Next: whichever float instructions are left that the recorded shaders use most.

<!-- greyfinch-sync:brcly/TuxBox:issue:6670967001 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/412). Originally posted by [JeffreyBytes](https://github.com/JeffreyBytes) on 2026-11-28T20:48:43Z. --- I'll take T5. I've got an RX 6700 XT (Navi 22, gfx1031) on RADV, Mesa 26.3.1. `tools/native_rdna2/` (@JohnVonWells) already runs hand-written instructions natively through ROCm with MODE set by `s_setreg_b32`, so I'm building on that instead of starting something new. It works on my card with `HSA_OVERRIDE_GFX_VERSION=10.3.0`: `check_sad.py` matches the checked-in RX 6950 XT receipt exactly. First piece is in (#420, merged), the float arithmetic family: 20 instructions under all 1,024 MODE values through ROCm, and 17 of them again through RADV as a second witness (a compute shader per instruction, checked against the driver's disassembly). The two agree on every bit they share, and RADV's default is MODE `0xc0`. Second piece is in too (#437, merged): what VOP3 `clamp` and the output modifiers do under every MODE value, which is the part #333 left open. Third piece is in too (#469, merged): the approximate ones (rcp, rsq, sqrt, log, exp, sin, cos), where only the chip can say what the exact bits are. f16 comes out correctly rounded, f32 is within one unit but not predictable, and RADV agrees with ROCm on every word they share. Fourth is #446, merged: `check_basic_alu_gpu.py` now holds its float results to this reference instead of its own looser models. The old models computed from denormal sources the card flushes. What a host may still do differently is named and counted under `tolerated`. Two translator faults are left among those names: `v_fma_f32` gets rounded twice when a `v_mul_f32` shares its product (the one from #333), and on NVIDIA `v_min_f32`, `v_max_f32`, `v_floor_f32` and `v_ceil_f32` don't flush a denormal source. The second needs a flush in the translator. The NVIDIA runs (RTX 3090 and RTX 5090) came from contributors, thanks both. What I think the deliverable is: the kernels and check scripts, the card's results checked in as evidence so the checks can be held to real hardware without needing an RDNA 2 card, and a doc with what matched and what didn't. If you had something else in mind for T5, tell me. One limit: this is a GFX10.3 card and Xbox programs mix GFX10.1 and GFX10.3 instructions. The gfx1030 assembler refuses `v_mad_f32`, `v_mac_f32` and the other RDNA 1 multiply-adds, and recorded shaders use them, so a card like mine can't be the reference for those. That would need a `gfx1013` board (a BC-250, say). Does anyone have one? Next: whichever float instructions are left that the recorded shaders use most.
JeffreyBytes commented 2026-11-28 21:10:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-28T21:10:47Z.


Two corrections to my own post.

"A Vulkan driver won't take raw machine code" is too strong. RADV exposes VK_KHR_pipeline_binary and VK_EXT_shader_object, and its binaries hold the actual machine code, so splicing console code into the blob from a trivial shader might get it through an unpatched driver. Haven't tried it. The catch is the ABI: console code expects its own register setup, descriptor layout and float mode, so realistically that's leaf arithmetic wrapped in RADV's prologue and epilogue, not whole shaders. I'll try it once the float family is recorded, since it's the only way I can see to hit exact console encodings.

The bigger one: this card is GFX10.3, and runtime/dxbc/src/rdna2/opcodes.rs says Xbox programs mix GFX10.1 and GFX10.3 instructions, including three legacy multiply-add opcodes that collide between the two. A desktop RDNA 2 card can't be the reference for the GFX10.1-only ones. Its compiler won't emit them, and the console's encoding would run as a different instruction. So T5 from a card like mine covers the GFX10.3 side only. The GFX10.1 side would need a gfx1013 board (a BC-250, say). Does anyone have one?

<!-- greyfinch-sync:brcly/TuxBox:comment:7245829159 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/412#issuecomment-7245829159). Originally posted by [JeffreyBytes](https://github.com/JeffreyBytes) on 2026-11-28T21:10:47Z. --- Two corrections to my own post. "A Vulkan driver won't take raw machine code" is too strong. RADV exposes `VK_KHR_pipeline_binary` and `VK_EXT_shader_object`, and its binaries hold the actual machine code, so splicing console code into the blob from a trivial shader might get it through an unpatched driver. Haven't tried it. The catch is the ABI: console code expects its own register setup, descriptor layout and float mode, so realistically that's leaf arithmetic wrapped in RADV's prologue and epilogue, not whole shaders. I'll try it once the float family is recorded, since it's the only way I can see to hit exact console encodings. The bigger one: this card is GFX10.3, and `runtime/dxbc/src/rdna2/opcodes.rs` says Xbox programs mix GFX10.1 and GFX10.3 instructions, including three legacy multiply-add opcodes that collide between the two. A desktop RDNA 2 card can't be the reference for the GFX10.1-only ones. Its compiler won't emit them, and the console's encoding would run as a different instruction. So T5 from a card like mine covers the GFX10.3 side only. The GFX10.1 side would need a `gfx1013` board (a BC-250, say). Does anyone have one?
JeffreyBytes commented 2026-11-28 21:16:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by JeffreyBytes on 2026-11-28T21:16:32Z.


I missed something obvious. tools/native_rdna2/ (@JohnVonWells's work) already runs hand-written instructions natively through ROCm with MODE set by s_setreg_b32, which is a better reference than what I described: exact forms, and all 1,024 MODE values. So ignore my "no way to run machine code" line.

It works on my card too. check_sad.py fails as is on the RX 6700 XT (gfx1031), but with HSA_OVERRIDE_GFX_VERSION=10.3.0 it passes and matches the checked-in RX 6950 XT receipt exactly, 81,920 comparisons, 0 mismatches.

So what should T5 add on top of that? The roadmap says "through its Vulkan driver". I've got the Vulkan side working locally for 17 float instructions (it found that the card flushes denormal inputs in the default mode, which check_basic_alu_gpu.py's models reject and its inputs never test), but the ROCm route can set the console's own MODE, and the translator starts that at 0xc0. My plan unless you say otherwise: extend the ROCm kernels to the float family under MODE 0xc0 and the neighbors that matter, and keep the Vulkan recording as a second witness. Tell me if that's not what you meant by T5.

<!-- greyfinch-sync:brcly/TuxBox:comment:7245899265 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/412#issuecomment-7245899265). Originally posted by [JeffreyBytes](https://github.com/JeffreyBytes) on 2026-11-28T21:16:32Z. --- I missed something obvious. `tools/native_rdna2/` (@JohnVonWells's work) already runs hand-written instructions natively through ROCm with MODE set by `s_setreg_b32`, which is a better reference than what I described: exact forms, and all 1,024 MODE values. So ignore my "no way to run machine code" line. It works on my card too. `check_sad.py` fails as is on the RX 6700 XT (gfx1031), but with `HSA_OVERRIDE_GFX_VERSION=10.3.0` it passes and matches the checked-in RX 6950 XT receipt exactly, 81,920 comparisons, 0 mismatches. So what should T5 add on top of that? The roadmap says "through its Vulkan driver". I've got the Vulkan side working locally for 17 float instructions (it found that the card flushes denormal *inputs* in the default mode, which `check_basic_alu_gpu.py`'s models reject and its inputs never test), but the ROCm route can set the console's own MODE, and the translator starts that at `0xc0`. My plan unless you say otherwise: extend the ROCm kernels to the float family under MODE `0xc0` and the neighbors that matter, and keep the Vulkan recording as a second witness. Tell me if that's not what you meant by T5.
1093i3511 commented 2026-11-29 21:52:28 +00:00 (Migrated from github.com)
Author
Contributor

Imported from brcly/TuxBox. Originally posted by 1093i3511 on 2026-11-29T21:52:28Z.


@JeffreyBytes, a second RDNA 2 chip for T5: an RX 6600 (Navi 23, gfx1032, 1002:73ff) on RADV, Mesa 26.3.1, Linux 7.3.6. I only ran the Vulkan route, so no ROCm.

python tools/native_rdna2/vulkan_float.py verify    # 17 instructions under 5 modes
python tools/native_rdna2/vulkan_approx.py verify   # 15 instructions under 5 modes, with the sweeps

Both match your RX 6700 XT (gfx1031) receipts bit for bit: the same output words and the same emitted instructions, for every instruction and mode, and for the approximate instructions' sweeps too. Both tools still print FAIL, but only because the receipts name your card and driver build:

DIFFERENT device_id: 0x73df then, 0x73ff now
DIFFERENT driver_info: Mesa 26.3.1-arch3.5 then, Mesa 26.3.1-arch1.3.1 now

So on these families, gfx1031 and gfx1032 behave the same through RADV. vulkan_approx.py gave identical output again in a second run.

The card already has a tuxbox.py verify receipt in evidence/ (#506), but that covers TuxBox's own checks, not this family. If it helps, I can record a gfx1032 receipt with record --evidence ... for the repository. I can also run the next instruction family you pick here as a second witness. The RDNA 1 multiply-adds are out of reach for this card too.

<!-- greyfinch-sync:brcly/TuxBox:comment:7263219498 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/412#issuecomment-7263219498). Originally posted by [1093i3511](https://github.com/1093i3511) on 2026-11-29T21:52:28Z. --- @JeffreyBytes, a second RDNA 2 chip for T5: an RX 6600 (Navi 23, gfx1032, `1002:73ff`) on RADV, Mesa 26.3.1, Linux 7.3.6. I only ran the Vulkan route, so no ROCm. ```text python tools/native_rdna2/vulkan_float.py verify # 17 instructions under 5 modes python tools/native_rdna2/vulkan_approx.py verify # 15 instructions under 5 modes, with the sweeps ``` **Both match your RX 6700 XT (gfx1031) receipts bit for bit:** the same output words and the same emitted instructions, for every instruction and mode, and for the approximate instructions' sweeps too. Both tools still print `FAIL`, but only because the receipts name your card and driver build: ```text DIFFERENT device_id: 0x73df then, 0x73ff now DIFFERENT driver_info: Mesa 26.3.1-arch3.5 then, Mesa 26.3.1-arch1.3.1 now ``` So on these families, gfx1031 and gfx1032 behave the same through RADV. `vulkan_approx.py` gave identical output again in a second run. The card already has a `tuxbox.py verify` receipt in `evidence/` (#506), but that covers TuxBox's own checks, not this family. If it helps, I can record a gfx1032 receipt with `record --evidence ...` for the repository. I can also run the next instruction family you pick here as a second witness. The RDNA 1 multiply-adds are out of reach for this card too.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox#412
No description provided.