RDNA2 silicon evidence for 29 held-back or unverified instructions (RDNA2 instructions 768 -> 789) #191
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!191
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/191/head"
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?
@SchmashinPrunes on GitHub · 2026-11-22 23:00 UTC · original
SchmashinPrunes:rdna2-hw-verify→main· +927 −36 · 12 files · 1 commits · closed without mergingRDNA2 hardware evidence for the instruction squares that were grey or amber for want of verification. RDNA2 instructions go from 768 to 789 of 797 (two commits: 778 with the first, 789 with the image atomics), and the two items
progress.jsonheld back (thes_bfewidth >= 32 rule andcvt_pknormrounding) are settled against silicon.Library / area: tombox-xshader tests,
tools/progress,tools/rdna2-hwprobeExports changed (exports.txt rows): none
Source of the behaviour: results recorded on RDNA2 hardware, the gfx1036 iGPU of a Ryzen 5 9600X (ROCm/HIP 5.7.1), with the new
tools/rdna2-hwprobe/verify_probe.pykernels. Each sweep was run twice and kept only when both runs were identical. The test replays the recorded inputs through the translator with the same instruction encodings, so it checks translator against silicon, not translator against a model. gfx1036 is RDNA2, not the console's gfx1013. No game or console files are involved.What is verified
tests/exec_vop/rdna2_silicon.rs(new, WARP): 480 recorded results, 32 per instruction, for 15 instructions. Every case passes with fixed inputs and with runtime inputs (run_both):v_fmac_f16,v_fmamk_f16,v_fmaak_f16: zeros, ±1, denormals, max, infinities, quiet NaNs and random values; random upper halves.v_pk_lshlrev_b16,v_pk_lshrrev_b16: shift counts 0 to 19 in both halves, plus random values.v_cvt_norm_i16_f16,v_cvt_norm_u16_f16,v_cvt_pknorm_{i16,u16}_{f16,f32}: exact rounding ties(k + 0.5) / 32767and/ 65535, one ulp either side of them, out-of-range values, specials.s_bfe_u32,s_bfe_i32,s_bfe_u64,s_bfe_i64: result and SCC, widths 0, 1, 7, 16, 31, 32, 33, 63, 64, 65 and 127, offsets 0 to 39, junk in the unused control bits.image_atomic_*ops run on the hardware against a linearR32_UINTimage, with the initial texels and the 8(x, data, cmp)tuples ofexec_mem::mimg::image_mimg_atomics, with and withoutglc. All 208 results (new texel, untouched neighbours, the returned pre-op value, or vdata unchanged withoutglc) equal that test's expectations, which the translator already passes on WARP. So the existing test is the silicon check and needs no change.ds_write_b16_d16_hi(64 values, both half offsets) andbuffer_store_format_xy/_xyzwere recorded on the same hardware. The results match whatexec_mem::ds::ds_lds_computeand theexecbuffer store tests already expect.What the hardware says
s_bfe_*with width >= 32 returnsS0 >> offset(all remaining bits). That is the reference's rule, not "returns 0", and it is what the translator already does after #178.v_cvt_pknorm_*andv_cvt_norm_*: the translator's rounding matches on every tie and near-tie case.x, y[, z]and then 0 in the components the instruction doesn't write, as the existing tests assume. With 3- and 1-component formats only the format's own components are written. Format 62 storedx, 0; I haven't looked into why, and the translator's tests don't use it.Not covered
Signalling NaN inputs are left out of the f16 FMA cases. With IEEE mode off, the hardware returns a signalling NaN operand unquieted (for example
0x7d01comes back as0x7d01), while the translator returns0x7f01. That follows from all of the translator's host float math quieting NaNs, not from these three instructions, so I've only recorded it here;v_fma_f32and the other verified float ops behave the same way. I can open an issue if that's useful.The 8 squares left are the translator's deliberate refusals:
ds_gws_*,ds_ordered_countands_sendmsghalt(BLOCKERS: no faithful PC equivalent). The_pckimage loads and stores from #103 are not decoded yet. No title uses them, and decoding them would add squares, so they're left out here.Change
tests/exec_vop/rdna2_silicon.rs(new), registered inexec_vop/mod.rs.tools/progress/progress.json:rdna2_verified, with evidence entries;s_bfeops leaverdna2_pending, which is now empty.gen.pyoutput regenerated:summary.json,docs/img/progress.svg,badge-instructions.svg,docs/MILESTONES.md,docs/LIBRARY_MAP.md. Only the instruction count changes (768 to 789).tools/rdna2-hwprobe:verify_probe.py(kernels and inputs),image_probe.py(image atomic kernels, a hand-built T#, and acheckmode against the test model),verify_runner.cpp(HIP runner),verify_gen.py(writes the test from a recording), and README.txt sections.Tests (Windows 11 Pro, WARP, DXC 1.9.2609, on
baadb80)Before the signalling-NaN inputs were removed, the same test failed exactly those 14 f16 FMA cases (got
0x7f01, want0x7d01). The other cases agreed, so the test does detect a translator/silicon difference.cargo test -p tombox-xshaderpasses🤖 Generated with Claude Code
tests/exec_vop/rdna2_silicon.rs runs v_fmac_f16, v_fmamk_f16, v_fmaak_f16, v_pk_lshlrev_b16, v_pk_lshrrev_b16, v_cvt_norm_{i16,u16}_f16, v_cvt_pknorm_{i16,u16}_{f16,f32} and s_bfe_{u32,i32,u64,i64} (result and SCC) through the translator on WARP and compares against 480 results recorded on RDNA2 hardware (gfx1036) with the same encodings and inputs: 0 failing with fixed and runtime inputs. That settles the two items progress.json held back: the s_bfe width >= 32 rule (the hardware returns S0 >> offset, as the translator already does) and cvt_pknorm rounding (the translator matches). ds_write_b16_d16_hi and buffer_store_format_xy/xyz, recorded the same way, match the expectations of the existing WARP tests (the format stores write 0 to the components they do not write, for 4-component formats). progress.json: these move to rdna2_verified with the evidence, the pending list is empty, and gen.py output is regenerated (RDNA2 instructions 768 -> 778 of 797). tools/rdna2-hwprobe gains the probe (verify_probe.py, verify_runner.cpp) and the test generator (verify_gen.py). Signalling NaN inputs are left out: with IEEE mode off the f16 FMAs return them unquieted on the hardware, the translator quiets them, as all of its host float math does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xsrj8HzdWhzzYYavNNpHjk@omonkeyz on GitHub · 2026-11-23 00:07 UTC · original
The hardware results and WARP replay tests are applied in
59c2475(merged ina4cc592) with your authorship kept, thanks. The full tombox-xshader suite passes.I made two changes:
verify_gen.py, the#[test]line inside the Python string now goes through a separatelines.append. The gate was reading it as a comment line. The generated output is unchanged.tools/progress/progress.json,summary.json, the badges and the docs.progress.jsonhas one writer, the lead's generator. The 768 -> 778 change happens when that generator sees your new passing tests.Pull request closed