ISA sweep: run every case on RDNA2 silicon and pin the reference models to the record (stacked on #385) #387
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!387
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-387"
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-25 17:50 UTC · original
SchmashinPrunes:isa-sweep-rdna2-silicon→main· +2842 −31 · 10 files · 3 commits · open@omonkeyz, this is the silicon harness and record behind #385. It's stacked on #385: the first commit is #385's, so review the second and third. The record pins the corrected models.
The third commit adds
TOMBOX_SWEEP_SILICON_MODE=host. It translates each pack with a given initial MODE (TOMBOX_SWEEP_RSRC1), runs it on the D3D12 host, and compares every lane with the silicon outputs, so translator and hardware can be compared under any MODE. That's how #388 and #389 were found.What it adds
isa_sweep_silicon(CPU only; does nothing unlessTOMBOX_SWEEP_SILICONis set) exports every sweep case as a raw gfx10 program, and later checks or records the hardware outputs.exec_quarterwrites EXEC with a VOP3 compare, and on gfx1036 a VOPC with SDST = EXEC leaves EXEC unchanged (checked separately). The silicon program compares into an SGPR and then doess_mov. The instruction under test is never touched.tools/rdna2-hwprobe/sweep_silicon.pyandsweep_silicon_runner.cpprun the packs on an RDNA2 Linux box (ROCm/HIP,clang-18/ld.lld-18):sweep_silicon.py absentlists cases whose instruction gfx103x lacks, or decodes as something other than on gfx1013, by comparing LLVM's gfx1013 and gfx1036 disassembly. gfx10.3 removedv_mac/mad/madak/madmk(_legacy)_f32and reuses two of the opcodes forfma_legacy, so running those would execute a different instruction. They are not run.s_sendmsg,s_trap,s_sethalt, memory other than the sweep's own MUBUF loads and stores, and exports.tests/isa_sweep/rdna2_sweep_hw.rs(528 KB, text) is the gfx1036 record of all 2,196 cases that ran. Per case it stores an FNV-1a digest of every output word the model defines, plus only the words where the hardware differs from the model's bits (NaN payloads, ulp-tolerance results), each packed aslane << 34 | word << 32 | value.sweep_models_match_rdna2_silicon(CPU only, about 0.2 s) rebuilds each case's hardware output from the model plus the recorded words, checks the digest, and runs the sweep's own comparison on every lane. Any model change that moves a recorded bit fails it.Results (gfx1036 iGPU, Ryzen 5 9600X, ROCm/HIP 5.7.1)
v_add/sub/subrev/mul/mul_legacy/min/max_f32): omod acts only with IEEE 0 and f32 output denormals flushed (#386);v_mul_lo_i32: gfx103x doesn't have it; its low 32 bits equalv_mul_lo_u32's.gfx1036 is RDNA2 but not gfx1013. Wherever an instruction could differ between them, the absent check uses LLVM's tables for both.
Tests
sweep_models_match_rdna2_silicon(WARP box, CPU)v_cubemaof a zero axis)isa_sweeptarget on WARPWARP_KNOWNdeviationssweep_silicon.pyon two packsThe PR gate is clean. No game or console files are involved.
🤖 Generated with Claude Code
Three translator rules disagreed with gfx1036 silicon (the ISA sweep's own cases run as raw kernels): - op_sel is honoured only by VOP3-native opcodes (0x140-0x17f, 0x300-0x3ff). VOPC, VOP2 and VOP1 ops in the VOP3 encoding ignore the bits: they read the low source halves and write the low half (keeping the high half). LLVM rejects op_sel on those encodings for gfx1013 as well. vop3_opsel_ok() gates every op_sel read outside VOP3P/interp. - v_cube{id,sc,tc,ma}_f32 pick the major axis with denormal inputs treated as zero and return raw coordinates; v_cubema of a zero axis is +0. 588 of 588 recorded non-NaN cases per op match. - v_sat_pk_u8_i16 writes the full dword (D[31:16] = 0), so it is no longer merged as a 16-bit result. The sweep reference models and three exec expectations follow. Co-Authored-By: Claude Opus 5.5 <[email protected]>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.