xshader tests: sync the s_bfe exec oracles with main (exec back to 70/70 on WARP) #70
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!70
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/70/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?
@QuentinDanblon on GitHub · 2026-11-21 22:54 UTC · original
QuentinDanblon:test/sbfe-oracle-sync→main· +21 −3 · 2 files · 1 commits · closed without mergingLibrary / area: tombox-xshader tests (
tests/exec.rs,tests/exec_vop/basic.rs). No translator change.Exports changed (exports.txt rows): none
Source of the behaviour: the translator and the sweep oracle already on main (
8491769:s_bfe_u32width from S1[22:16],s_bfe_i64arithmetic shift;tests/isa_sweep/ops_s.rs::bfe64). The 32-bit oracle is the one from #38 by @artareias, applied unchanged.What is wrong on main
8491769changed the scalars_bfelowering and updated the ISA sweep, but two older exec oracles still model the previous behaviour. On WARP,cargo test -p tombox-xshader --release --test exec:0fc72958491769(main)vop::basic::salu_basic: 26 cases (14s_bfe_u32, 12s_bfe_i32; the first are#201/#202,#316/#317,#390/#391), all with a width field of 32 or more. The oraclebfemasks the width to 5 bits and expects 0; the translator returns the shifted value.scalar_sop2#158 s_bfe_i64(a = 0x8123456789abcdef, offset 28, width 40): got high word0xfffffff8, the oracle wants0x00000008. The oracle shifts logically; the translator and the sweep oracle shift arithmetically for the signed form.Change
tests/exec_vop/basic.rs: thesbfeoracle of #38 (7-bit width; a width of 32 or more selects the whole shifted value). Thehlsl.rshalf of #38 is already on main, this is the half that was left out.tests/exec.rs:bfe64shifts arithmetically when signed, the same asisa_sweep/ops_s.rs::bfe64.Tests
--test exec scalar_sop21/1,--test exec salu_basic1/1 (both fail on main).TOMBOX_EXEC_HW=1): same two, 1/1 and 1/1.Not decided here
A signed field that runs past the top bit (
offset + widthabove 32 or 64) is the one place where the ISA formula read literally ((S0 >> offset) & mask, then sign-extend from bitwidth - 1) gives a different answer from main: literal zero-fills, main sign-fills. This PR follows main; it does not claim hardware evidence either way. I wrote probe kernels for therdna2-hwprobeharness of #41 that would measure it on RDNA2 (branchprobe/valu-open-questionson my fork, see my comment on #41). They have not been run: I have no AMD GPU.Also failing on main, not touched here
--test meshon WARP: 10 passed, 3 failed at8491769. The new rule that closes the conditional block before ans_barrierin a mesh shader makes the divergent barrier unconditional, so:mesh_divergent_barrier_with_lds_is_refusedandmesh_divergent_barrier_with_memory_store_is_refusednow translate (they expect the "divergent path" refusal);gpu_mesh_divergent_barrier_without_memory_writescounts 4GroupMemoryBarrierWithGroupSync()where it expects 3.If hoisting the barrier is intended, these three tests need new expectations; I left them alone because turning a refusal into an accepted translation is your call.
cargo test -p tombox-xshader: the two exec tests fixed here pass on WARP and on an RTX 5090; the three mesh tests above still fail, as on mainmissingwith a note🤖 Generated with Claude Code
@QuentinDanblon on GitHub · 2026-11-21 23:42 UTC · original
Update on the three
--test meshfailures listed above: #76 by @thatirishguyyy makes them pass by removing the rule that moves a meshs_barrierout of its branch guard. I tested it (13 / 13 on WARP and on an RTX 5090, 15 / 15 merged with #58) and posted the numbers there, together with what the two options change for a shader that writes LDS or memory.@QuentinDanblon on GitHub · 2026-11-22 00:07 UTC · original
The section "Not decided here" is now decided by a measurement. @SchmashinPrunes ran the
s_bfeprobe of #72 on an RDNA2 GPU (gfx1036): #418491769and what the two oracles in this PR expect. The literal ISA formula (zero-fill) matches 114, width modulo the operand size matches 100.Status against main
f6b979d: this PR is not in main yet, soscalar_sop2andvop::basic::salu_basicstill fail there. The three--test meshfailures are gone, since59e5ed7took the change of #76.@QuentinDanblon on GitHub · 2026-11-22 11:37 UTC · original
Main has these oracles in sync now:
cargo test -p tombox-xshader --release --test execpasses 73 of 73 on WARP at51f5319. Closing, nothing left to take from this one.Pull request closed