ISA sweep: run every case on RDNA2 silicon and pin the reference models to the record (stacked on #385) #387
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from omonkeyz/xbox-emulator. Originally posted by SchmashinPrunes on 2026-11-25T17:50:37Z.
@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
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.