tombox-xshader tests: bit-exact v_cmp_class_f32 / v_cmpx_class_f32 and buffer_gl0_inv / buffer_gl1_inv #305

Closed
github-bot wants to merge 1 commit from gh-pr/305/head into gh-pr/305/base
Owner

@⁠MeNoSkills on GitHub · 2026-11-23 17:13 UTC · original
MeNoSkills:test/class-gl-inv → main · +128 −0 · 3 files · 1 commits · closed without merging

Test only, no change to the translator. It adds exec tests for three mnemonics that the full hardware run with TOMBOX_EXEC_VERIFIED (main plus my open test PRs) still left in no group: v_cmp_class_f32 (19 uses in the analysed titles; only the x form and the f16/f64 forms had exec tests), buffer_gl0_inv and buffer_gl1_inv (192 uses each).

What is added

  • vopc_class_f32 (exec_vop/vopc.rs, the f32 twin of vopc_class_f16): 16 representative values (signalling and quiet NaN of both signs, +-inf, +-normal, +-denormal, +-0, largest and smallest normal, a NaN with the quiet bit as the only payload) against six masks each (the class's own bit, every other bit, an alternating pattern, own bit plus garbage in the upper 22 bits, none, all). The expected class comes from the IEEE bit pattern in the test, not from the translator. v_cmp_class_f32 and v_cmpx_class_f32, in the VOPC encoding and in VOP3 with every abs/neg combination (the modifiers act on the sign before the classification), inline float and integer constants and a 32-bit literal as the first operand, and the exec-zero case.
  • buffer_gl_inv_leaves_the_buffer_contents_alone (exec_mem/cache_inv.rs): buffer_gl0_inv and buffer_gl1_inv, with and without a store to the same dword just before, at three offsets: the following load must return the stored (or the original) value and the rest of the buffer is compared. The translator lowers both as no-ops, so this pins that they neither change memory nor drop an earlier store.

Results

All pass on an NVIDIA RTX 4070 Ti (Windows 10 build 19045, MSVC, TOMBOX_EXEC_HW=1); with TOMBOX_EXEC_VERIFIED set they write vopc_class_f32.txt (v_cmp_class_f32, v_cmpx_class_f32) and buffer_gl_inv.txt (both gl invalidates). Sensitivity check: moving the quiet-NaN bit test in tb_cmp_class (0x400000u to 0x200000u) makes vopc_class_f32 fail; reverted, not in the PR. python .github/scripts/pr_gate.py --base upstream/main --head HEAD: 0 problems; the branch is on main f89e410.

State of the gap list

The full run (145 passed, 0 failed, 2 ignored; plus isa_sweep 2 passed) on a branch with #284, #286, #287, #297 and #298 merged leaves 16 of 817 mnemonics in no group:

  • v_interp_p1_f32, v_interp_p2_f32, v_interp_mov_f32: the tests from #287 run through draw_graphics and do not call verified(); I will send that one-line change after #287 lands, to avoid touching a file the maintainer has already applied.
  • v_cmp_class_f32, buffer_gl0_inv, buffer_gl1_inv: this PR.
  • image_sample_c_l, image_gather4_c: tested in mimg.rs, but they need a shader model above the 6.5 of this machine's runtime, so the harness skips them here; they should verify on a newer runtime.
  • ds_ordered_count, ds_gws_barrier, ds_gws_init, ds_gws_sema_br, ds_gws_sema_v, ds_gws_sema_p, ds_gws_sema_release_all, s_sendmsghalt: refused by the translator on purpose (0 uses in the analysed titles), nothing to verify.
**@⁠MeNoSkills** on GitHub · 2026-11-23 17:13 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/305) `MeNoSkills:test/class-gl-inv` → `main` · +128 −0 · 3 files · 1 commits · closed without merging Test only, no change to the translator. It adds exec tests for three mnemonics that the full hardware run with `TOMBOX_EXEC_VERIFIED` (main plus my open test PRs) still left in no group: `v_cmp_class_f32` (19 uses in the analysed titles; only the `x` form and the f16/f64 forms had exec tests), `buffer_gl0_inv` and `buffer_gl1_inv` (192 uses each). ## What is added - `vopc_class_f32` (`exec_vop/vopc.rs`, the f32 twin of `vopc_class_f16`): 16 representative values (signalling and quiet NaN of both signs, +-inf, +-normal, +-denormal, +-0, largest and smallest normal, a NaN with the quiet bit as the only payload) against six masks each (the class's own bit, every other bit, an alternating pattern, own bit plus garbage in the upper 22 bits, none, all). The expected class comes from the IEEE bit pattern in the test, not from the translator. `v_cmp_class_f32` and `v_cmpx_class_f32`, in the VOPC encoding and in VOP3 with every `abs`/`neg` combination (the modifiers act on the sign before the classification), inline float and integer constants and a 32-bit literal as the first operand, and the exec-zero case. - `buffer_gl_inv_leaves_the_buffer_contents_alone` (`exec_mem/cache_inv.rs`): `buffer_gl0_inv` and `buffer_gl1_inv`, with and without a store to the same dword just before, at three offsets: the following load must return the stored (or the original) value and the rest of the buffer is compared. The translator lowers both as no-ops, so this pins that they neither change memory nor drop an earlier store. ## Results All pass on an NVIDIA RTX 4070 Ti (Windows 10 build 19045, MSVC, `TOMBOX_EXEC_HW=1`); with `TOMBOX_EXEC_VERIFIED` set they write `vopc_class_f32.txt` (`v_cmp_class_f32`, `v_cmpx_class_f32`) and `buffer_gl_inv.txt` (both gl invalidates). Sensitivity check: moving the quiet-NaN bit test in `tb_cmp_class` (`0x400000u` to `0x200000u`) makes `vopc_class_f32` fail; reverted, not in the PR. `python .github/scripts/pr_gate.py --base upstream/main --head HEAD`: 0 problems; the branch is on main f89e410. ## State of the gap list The full run (145 passed, 0 failed, 2 ignored; plus `isa_sweep` 2 passed) on a branch with #284, #286, #287, #297 and #298 merged leaves 16 of 817 mnemonics in no group: - `v_interp_p1_f32`, `v_interp_p2_f32`, `v_interp_mov_f32`: the tests from #287 run through `draw_graphics` and do not call `verified()`; I will send that one-line change after #287 lands, to avoid touching a file the maintainer has already applied. - `v_cmp_class_f32`, `buffer_gl0_inv`, `buffer_gl1_inv`: this PR. - `image_sample_c_l`, `image_gather4_c`: tested in `mimg.rs`, but they need a shader model above the 6.5 of this machine's runtime, so the harness skips them here; they should verify on a newer runtime. - `ds_ordered_count`, `ds_gws_barrier`, `ds_gws_init`, `ds_gws_sema_br`, `ds_gws_sema_v`, `ds_gws_sema_p`, `ds_gws_sema_release_all`, `s_sendmsghalt`: refused by the translator on purpose (0 uses in the analysed titles), nothing to verify.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:17:59 +00:00
github-bot closed this pull request 2026-11-26 06:17:59 +00:00
Author
Owner

@⁠QuentinDanblon on GitHub · 2026-11-23 18:37 UTC · original

Ran this PR's four tests on an NVIDIA RTX 5090 (driver 617.42, shader model 6.8, TOMBOX_EXEC_HW=1) and on WARP: all pass on both, including image_mimg_compare_gather and image_mimg_gather_explicit_lod, so the SM > 6.5 cases for image_sample_c_l and image_gather4_c run there with 0 skipped and match the reference bit-exact.

**@⁠QuentinDanblon** on GitHub · 2026-11-23 18:37 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/305#issuecomment-7110417437) Ran this PR's four tests on an NVIDIA RTX 5090 (driver 617.42, shader model 6.8, `TOMBOX_EXEC_HW=1`) and on WARP: all pass on both, including `image_mimg_compare_gather` and `image_mimg_gather_explicit_lod`, so the SM > 6.5 cases for `image_sample_c_l` and `image_gather4_c` run there with 0 skipped and match the reference bit-exact.
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-25 13:49 UTC · original

Applied on main in 36079a1 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

**@⁠omonkeyz** on GitHub · 2026-11-25 13:49 UTC · [original](https://github.com/omonkeyz/xbox-emulator/pull/305#issuecomment-7164333137) Applied on main in 36079a1 (cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.