xshader: hardware-checked vectors as exec tests (SDWA, pk shifts, wave64 masks, MUBUF bounds); add v_pk_lshlrev/lshrrev_b16 #64
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/64"
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 QuentinDanblon on 2026-11-21T22:09:38Z.
Library / area: tombox-xshader: exec tests from published hardware-checked vectors, plus v_pk_lshlrev/lshrrev_b16
Exports changed (exports.txt rows): none
Source of the behaviour: RDNA2 ISA. Test vectors re-expressed as facts from Leonida's GPU tests (
runtime/test/shaders/*.asm, GPL-3.0; no code copied, credited in comments). Encodings come from llvm-mc-mcpu=gfx1013.v_pk_lshlrev_b16(0x404) andv_pk_lshrrev_b16(0x405) had no decoder name (they came out asvop3<0x404>), so any shader using them failed to translate. They are now named and translated per the ISA: per-half shift by bits [3:0] of S0's selected half; OPSEL/OPSEL_HI handled as for the f16 packed ops; NEG/NEG_HI/CLAMP refused.tests/exec_vop/leonida.rs, each case run with constant and runtime inputs:v_add_nc_u16VOP3 keeps the dst high half (0xbeef0000);v_sin_f16keeps the high half (0x12343c00);v_mul_legacy_f320×inf / 0×NaN;s_bfm_b64(16,8) and (8,40);#[ignore]d test (wave_scc_readfirstlane_isa) documents a known limit of the one-lane-per-invocation model. Afters_and_saveexec_b64, SCC andv_readfirstlaneare per-lane values, not wave values. The usual allocation pattern (bcnt → mbcnt → one atomic → readfirstlane) is still self-consistent under that model, so nothing was changed there.Tests
WARP:
--lib17,--test exec73 pass / 2 ignored (main: 70 / 1),--test opcodes22,--test synthetic9,--test isa_sweep2.RTX 5090: the new leonida tests pass in both input modes. The full hardware suite was not re-run.
cargo test -p tombox-xshaderpassesNo game or console files and no binaries included
No fake success; anything not possible is left
missingwith a noteImported from omonkeyz/xbox-emulator. Originally posted by QuentinDanblon on 2026-11-21T23:15:35Z.
Rebased onto
8491769and re-run.--test execThe failures are the ones main has on each backend (main: 68 / 2 on WARP, 61 / 9 on the 5090): the two stale
s_bfeoracles that #70 fixes, plus on hardware the NVIDIA cases that #61 fixes. The tests this PR adds (leonida_ps_vectors,leonida_mubuf_bounds,leonida_wave64_scalar_masks) pass on both.Imported from omonkeyz/xbox-emulator. Originally posted by QuentinDanblon on 2026-11-22T12:04:00Z.
Folded into #61 (commit
4d2995d, same change rebased on51f5319, with theRootSiginitializer updated forstatic_samplers). The full suite now ran on the RTX 5090 too:--test exec76 pass, 0 fail. Closing this one.Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-22T13:12:05Z.
Main's history was rewritten, which auto-closed this PR. It is applied in
4f89f4e(merged in81a1252) with your authorship kept, thanks! (via #61's rebased copy). The added comment lines were stripped on the applied copy (the project keeps code free of comment lines). Leonida is credited in crates/tombox-xshader/THIRD_PARTY (14e873c).Imported from omonkeyz/xbox-emulator. Originally posted by omonkeyz on 2026-11-22T13:15:48Z.
Small follow-up: credits now live in one root file, so the per-crate THIRD_PARTY entry for this PR moved to THIRD_PARTY/CREDITS (
79a3b2f). CONTRIBUTING.md is updated to match.Pull request closed