feat: close 32-bit RDNA 2 ALU HLSL parity and add v_mul_legacy_f32, v_perm_b32 (#21) #119
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!119
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/119/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?
@Lewandox on GitHub · 2026-11-24 00:18 UTC · original
Lewandox:feat/rdna2-alu-hlsl-parity→main· +397 −18 · 14 files · 3 commits · merged 2026-11-24 10:14 UTCCloses the remaining 32-bit Scalar, Vector, VOP3, and VOP3b carry parity gap between
dna2_exec and
dna2_hlsl, and adds _mul_legacy_f32 and _perm_b32 to both the reference interpreter and HLSL recompiler (part of #21; intentionally avoids all f16/16-bit instructions claimed in #115).
Summary
dna2_exec_ops.py,
dna2_exec_vop3.py):
dna2_hlsl_ops.py,
dna2_hlsl.py,
dna2_hlsl_graphics.py):
dna2_exec and
dna2_hlsl, plus an @gpu parity test for Windows CI).
Verification
pytest tests/test_rdna2_alu_parity.py tests/test_rdna2_exec.py tests/test_rdna2_hlsl.py tests/test_rdna2_graphics.py tests/test_readme_sync.py -v-> 29 passed, 8 skipped (@gpu tests skip locally without dxc/nyxboxx_gpu_run.exe).ruff check --select W605,F,E9 PrototypeScarlett tests tools-> All checks passed!(AI-assisted implementation; zero game, console, or SDK data used.)
@Lewandox on GitHub · 2026-11-24 08:57 UTC · original
Addressed all review points:
@LooperSalty on GitHub · 2026-11-24 08:31 UTC · original · requested changes
Thanks. One test fails and one table looks wrong:
tests/test_rdna2_alu_parity.py::test_extended_alu_matches_interpreter_on_gpufails withUntranslated: v_nop (VOP1, opcode 0x0). Invop2("v_mul_legacy_f32", 9, const(0), LITERAL), 0x7FC0_0000the literal is invsrc1, a VGPR field, so the next dword is decoded as an instruction. In VOP2 the literal can only be src0:vop2(..., 9, LITERAL, 0), 0x7FC0_0000(or put the literal through VOP3 rules).v_perm_b32selectors (_perm_b32inrdna2_exec_vop3.pyandPermB32inrdna2_hlsl_ops.py): please check against the RDNA 2 ISA guide. As I read it, selectors 8-11 replicate sign bits (bit 15/31 of src1, then of src0), 12 gives 0x00, and 13+ give 0xFF. The PR has 8 → 0x00 and 9-12 → signs. The common zero-extension selector0x0C0C0C00would produce sign bytes here. The interpreter and the HLSL share the table, so the GPU comparison cannot catch it: the expected values should come from the ISA document or LLVM tests.v_sin_f32,v_cos_f32,v_rndne_f32,v_ffbl_b32,v_cvt_f32_ubyte*…) are only checked by HLSL string search. Please run them through the GPU comparison too.Conflicts: same
COMMON.format(...)lines as #117 inrdna2_hlsl_graphics.py. CI is blocked by the deleted Leonida submodule until #120 is merged.🤖 Generated with Claude Code
@LooperSalty on GitHub · 2026-11-24 10:06 UTC · original · reviewed
Checked: the
v_mul_legacy_f32VOP2 test is fixed andtest_extended_alu_matches_interpreter_on_gpupasses on the GPU here. Thev_perm_b32table now matches the RDNA 2 ISA (selectors 8/9: sign of S1 bits 15/31, 10/11: sign of S0 bits 15/31, 12: 0x00, 13+: 0xFF), second-checked against the ISA document. Looks good to me.🤖 Generated with Claude Code