tombox-xshader tests: bit-exact pixel sampling cases for image_sample, _b, _d, _c_lz, _lz_o, gather4_lz and image_load_mip #286
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!286
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/286/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?
@MeNoSkills on GitHub · 2026-11-23 12:59 UTC · original
MeNoSkills:test/pixel-edge-cases→main· +114 −0 · 1 files · 1 commits · closed without mergingTest only, no change to the translator. It adds bit-exact exec cases for pixel-stage image instructions that no exec group verified until now. Per the answer in #187 ("adding bit-exact exec tests for that stage's instructions and edge cases"), this is one step for the Pixel stage.
How I found the gaps
I ran the whole
execsuite andisa_sweepon hardware withTOMBOX_EXEC_VERIFIEDset, which makes the harness write the mnemonics each group verified, and subtracted that from the mnemonic groups intools/progress/data/mnem_groups.json. Of 817 mnemonics, 40 are in no group. The pixel-stage MIMG ones among them, with the number of uses in the analysed titles fromtools/progress/data/mnemonics.txt:image_sample_b(34,846),image_sample(19,247),image_sample_d(344),image_load_mip(125),image_sample_lz_o(107),image_sample_c_lz(66),image_gather4_lz(45).What is added (
tests/exec_mem/mimg.rs, three tests, 107 cases)image_mimg_implicit_lod_samples:image_samplewith the implicit LOD taken from the pixel position gradient (texel gradients 1, 2, 4, 8 and 16, so LOD 0 to 4, the last clamped to the last of 4 mips), three dmasks;image_sample_bwith biases +1, -1, +0.4, +2 and -3 (negative LODs clamp at 0);image_sample_dwith six explicit gradient sets (axis aligned, mixed u/v, powers of two from 1 to 16 texels).image_mimg_lz_variants_ignore_the_gradients:image_sample_c_lzwith seven compare functions and gradients that would select LOD 0 to 4 on a 2-mip depth texture, so the result must come from mip 0 anyway;image_sample_lz_owith four packed offsets at the same gradients;image_gather4_lzfor each dmask channel at five gradients.image_mimg_load_mip_selects_the_level:image_load_mipof every mip of a 4-mip texture, with partial dmasks, plus four out-of-range cases (x or y past the mip size, mip past the last) that must read 0.Expected values come from the existing helpers in the file (
nearest,pt,foot_at,ea,td), not from the translator. The three tests also run each case a second time with its inputs coming from registers at run time, as the other groups in this file do.Results
All pass on WARP and on an NVIDIA RTX 4070 Ti (Windows 10 build 19045, MSVC,
TOMBOX_EXEC_HW=1). They found no difference with the translator, so this adds coverage and no fix.cargo test --locked -p tombox-xshader --test exec -- exec_mem::mimg(the whole group, 14 tests): 14 passed on the RTX. The fullexecrun before adding these (mainf89e410): 128 passed, 0 failed, 2 ignored.python .github/scripts/pr_gate.py --base upstream/main --head HEAD: 0 problems.Not covered
v_interp_p1_f32,v_interp_p2_f32andv_interp_mov_f32(55,320, 55,320 and 15,330 uses) are also in no group. They need a vertex shader that exports a known attribute and a matching pixel input signature, which the exec harness does not build today (its vertex shader exports only SV_Position), so I did not fold that into this PR.@omonkeyz on GitHub · 2026-11-23 14:08 UTC · original
Applied locally on main with your authorship kept (cherry-picked,
be98784); the tombox-xshader suite passes in a sandbox (exec 155/155 on WARP). It ships in the next release; this PR will be closed when that is pushed. Thanks.@omonkeyz on GitHub · 2026-11-25 13:08 UTC · original
Applied on main in
be98784(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed