tests: add refusal and mutation tests for gfx1013_sampled_pixel #3693

Manually merged
github merged 1 commit from github-bot/gh-3691 into gh-pr/3691/base 2026-12-01 03:13:39 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 02:00 UTC · original
Ammmae0x:tests/gfx1013-sampled-pixel → main · +2224 −0 · 5 files · 1 commits · merged 2026-12-01 03:12 UTC

Refs #1149

Direct unit and mutation tests for x2w::translate_gfx1013_sampled_pixel (src/gfx1013_sampled_pixel.cpp), with zero edits to existing files (5 new files only, +2224/-0; portable C++17 needing only tests/gfx1013_sampled_pixel_check.cpp + src/gfx1013_sampled_pixel.cpp).

  • tests/gfx1013_sampled_pixel_check.cpp: 57 cases, no-arg runs all, optional <case> arg, loud FAIL: <case>: ... with exit 1. 13 valid paths pinning exact hlsl and bindings (SampleLevel, Sample with mip filter 1 and 2, SampleBias at -4096, -128, 256 and 4093 with the bits[2] &= ~0x3fffu sampler dedup, mask 15, sampler/resource reuse, dead scalar moves incl. s_movk/s_bfm_b32/s_mov_b64 literal and 128..208 branches, prefetch/clause/waitcnt no-ops, interpolation of xyzw, VOP2 sub/mad); 44 refusals pinning exact "<reason> at pixel byte <addr>" (every refusal the translator can throw, incl. all three primary-bias bounds, conflicting/incomplete descriptors, and the three s_mov_b64 pair refusals). Includes <initializer_list>, MSVC /W4 clean intent.
  • tests/cmake/gfx1013_sampled_pixel.cmake: per-case tests + gfx1013_sampled_pixel_all + 5 WILL_FAIL TRUE configure-time copy mutations mirroring era_gpu_alias_open_base_control (bias_range, secondary_bias, incomplete_descriptor, inverted_lod, after_final_export).
  • tests/gfx1013_sampled_pixel_meta_check.py + tests/checks/python-linux/gfx1013_sampled_pixel.txt + docs/experiments/gfx1013-sampled-pixel.md: contract audit + compile & run the real C++ check with g++ -std=c++17 on Linux + all 5 CMake mutations, plus a Python transliteration model with 8/8 mutations killed (5 CMake + 3 model-only: dedup, implicit_mip, dst_overflow).

Linux (this host, base origin/main 1a9ccbc4):

  • meta check: PASS: gfx1013 sampled pixel: 57 cases, 5/5 real C++ mutations killed, 8/8 model mutations killed
  • run_checks_parallel.py --from-dir tests/checks/python-linux: all 80 checks passed
  • form/docs/bidi pass (198 files/765 links, 2793 files), py_compile pass, diff --check clean, merge-tree exits 0, zero personal paths
  • CTest (Linux CMake configure of the fragment): 63/63 passed (57 cases + all + 5/5 mutations)

Windows Verification (52c779f958a296623ffa367f66d794ea8a5b969e)

Commit: 52c779f958a296623ffa367f66d794ea8a5b969e (merge-tree upstream/main HEAD -> 0176fa87, exit 0)
dev: cmake --build --preset dev --target gfx1013_sampled_pixel_check ... && ctest --preset dev --no-tests=error -R '^gfx1013_sampled_pixel' --output-on-failure -> 63/63 passed (1.46s; 57 cases + all + 5/5 mutations killed)
release: cmake --build --preset release --target gfx1013_sampled_pixel_check ... && ctest --preset release --no-tests=error -R '^gfx1013_sampled_pixel' --output-on-failure -> 63/63 passed (1.27s; 57 cases + all + 5/5 mutations killed)
Direct binary (dev & release): PASS: gfx1013_sampled_pixel: 57/57 cases passed
Checks: form_coverage_check.py, docs_links_check.py (199 files, 770 links), bidi_controls_check.py (2796 files) -> passed

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-12-01 02:00 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3691) `Ammmae0x:tests/gfx1013-sampled-pixel` → `main` · +2224 −0 · 5 files · 1 commits · merged 2026-12-01 03:12 UTC Refs #1149 Direct unit and mutation tests for `x2w::translate_gfx1013_sampled_pixel` (`src/gfx1013_sampled_pixel.cpp`), with zero edits to existing files (5 new files only, +2224/-0; portable C++17 needing only `tests/gfx1013_sampled_pixel_check.cpp` + `src/gfx1013_sampled_pixel.cpp`). - `tests/gfx1013_sampled_pixel_check.cpp`: 57 cases, no-arg runs all, optional `<case>` arg, loud `FAIL: <case>: ...` with exit 1. 13 valid paths pinning exact hlsl and bindings (SampleLevel, Sample with mip filter 1 and 2, SampleBias at -4096, -128, 256 and 4093 with the `bits[2] &= ~0x3fffu` sampler dedup, mask 15, sampler/resource reuse, dead scalar moves incl. s_movk/s_bfm_b32/s_mov_b64 literal and 128..208 branches, prefetch/clause/waitcnt no-ops, interpolation of xyzw, VOP2 sub/mad); 44 refusals pinning exact `"<reason> at pixel byte <addr>"` (every refusal the translator can throw, incl. all three primary-bias bounds, conflicting/incomplete descriptors, and the three s_mov_b64 pair refusals). Includes `<initializer_list>`, MSVC /W4 clean intent. - `tests/cmake/gfx1013_sampled_pixel.cmake`: per-case tests + `gfx1013_sampled_pixel_all` + 5 WILL_FAIL TRUE configure-time copy mutations mirroring `era_gpu_alias_open_base_control` (bias_range, secondary_bias, incomplete_descriptor, inverted_lod, after_final_export). - `tests/gfx1013_sampled_pixel_meta_check.py` + `tests/checks/python-linux/gfx1013_sampled_pixel.txt` + `docs/experiments/gfx1013-sampled-pixel.md`: contract audit + compile & run the real C++ check with `g++ -std=c++17` on Linux + all 5 CMake mutations, plus a Python transliteration model with 8/8 mutations killed (5 CMake + 3 model-only: dedup, implicit_mip, dst_overflow). Linux (this host, base `origin/main` 1a9ccbc4): - meta check: `PASS: gfx1013 sampled pixel: 57 cases, 5/5 real C++ mutations killed, 8/8 model mutations killed` - `run_checks_parallel.py --from-dir tests/checks/python-linux`: all 80 checks passed - form/docs/bidi pass (198 files/765 links, 2793 files), py_compile pass, diff --check clean, merge-tree exits 0, zero personal paths - CTest (Linux CMake configure of the fragment): 63/63 passed (57 cases + all + 5/5 mutations) ### Windows Verification (`52c779f958a296623ffa367f66d794ea8a5b969e`) ```text Commit: 52c779f958a296623ffa367f66d794ea8a5b969e (merge-tree upstream/main HEAD -> 0176fa87, exit 0) dev: cmake --build --preset dev --target gfx1013_sampled_pixel_check ... && ctest --preset dev --no-tests=error -R '^gfx1013_sampled_pixel' --output-on-failure -> 63/63 passed (1.46s; 57 cases + all + 5/5 mutations killed) release: cmake --build --preset release --target gfx1013_sampled_pixel_check ... && ctest --preset release --no-tests=error -R '^gfx1013_sampled_pixel' --output-on-failure -> 63/63 passed (1.27s; 57 cases + all + 5/5 mutations killed) Direct binary (dev & release): PASS: gfx1013_sampled_pixel: 57/57 cases passed Checks: form_coverage_check.py, docs_links_check.py (199 files, 770 links), bidi_controls_check.py (2796 files) -> passed ``` AI-assisted. <!-- WIN-VERIFY: passed | sha=52c779f958a296623ffa367f66d794ea8a5b969e | targets=gfx1013_sampled_pixel_check gfx1013_sampled_pixel_bias_range_mut gfx1013_sampled_pixel_secondary_bias_mut gfx1013_sampled_pixel_incomplete_descriptor_mut gfx1013_sampled_pixel_inverted_lod_mut gfx1013_sampled_pixel_after_final_export_mut | ctest=^gfx1013_sampled_pixel | release=true -->
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 02:01:25 +00:00
Author
Owner

@⁠lukaslw-lab on GitHub · 2026-12-01 02:59 UTC · original · approved these changes

Reviewed 52c779f9 by reading the diff; not built or run.

Verdict: approve. The 57 cases reach every refusal the translator throws, and the five C++ controls each drop a real guard. The SHOULD can follow later. No MUST.

  • SHOULD Three of the eight "killed" mutations (dedup, implicit_mip, dst_overflow, tests/gfx1013_sampled_pixel_meta_check.py:311-319) only change the Python transliteration. Their anchors are unique in src/gfx1013_sampled_pixel.cpp (:161, :156, :170), and the meta check already compiles the other five mutants with g++ (:859). Applying these three to the real source the same way, or as CMake controls, would make "8/8 killed" a claim about the C++. It would also catch drift between the 898-line model and the translator.
  • Checked, no finding:
    • Every distinct require/throw message in src/gfx1013_sampled_pixel.cpp (36) is pinned by at least one refusal case, with the at pixel byte <addr> suffix.
    • The valid cases pin the exact HLSL and bindings, including the four SampleBias edges and the bits[2] &= ~0x3fffu sampler dedup that dedup targets.
    • The five CMake anchors each appear once and stop with FATAL_ERROR if they are lost. Control (a) uses bias 4094, exactly one past the upper bound. The fixture writes no files, and no existing file changes.

Tests: the cases prove the accepted HLSL and each refusal substring, and the *_mut controls prove the bias bounds, the secondary-bias, descriptor and LOD-order guards, and the final-export guard are each needed. CI at this head: Linux ran the meta check, which compiles and runs the real check and the five mutants with g++. The Windows pr filter (CMakePresets.json) runs none of the gfx1013_sampled_pixel* tests, so the MSVC evidence is the author's dev + release run (63/63).

**@⁠lukaslw-lab** on GitHub · 2026-12-01 02:59 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3691#pullrequestreview-6124367258) · **approved these changes** Reviewed `52c779f9` by reading the diff; not built or run. **Verdict: approve.** The 57 cases reach every refusal the translator throws, and the five C++ controls each drop a real guard. The SHOULD can follow later. No MUST. - **SHOULD** Three of the eight "killed" mutations (`dedup`, `implicit_mip`, `dst_overflow`, `tests/gfx1013_sampled_pixel_meta_check.py:311-319`) only change the Python transliteration. Their anchors are unique in `src/gfx1013_sampled_pixel.cpp` (`:161`, `:156`, `:170`), and the meta check already compiles the other five mutants with g++ (`:859`). Applying these three to the real source the same way, or as CMake controls, would make "8/8 killed" a claim about the C++. It would also catch drift between the 898-line model and the translator. - Checked, no finding: - Every distinct `require`/`throw` message in `src/gfx1013_sampled_pixel.cpp` (36) is pinned by at least one refusal case, with the `at pixel byte <addr>` suffix. - The valid cases pin the exact HLSL and bindings, including the four SampleBias edges and the `bits[2] &= ~0x3fffu` sampler dedup that `dedup` targets. - The five CMake anchors each appear once and stop with FATAL_ERROR if they are lost. Control (a) uses bias 4094, exactly one past the upper bound. The fixture writes no files, and no existing file changes. Tests: the cases prove the accepted HLSL and each refusal substring, and the `*_mut` controls prove the bias bounds, the secondary-bias, descriptor and LOD-order guards, and the final-export guard are each needed. CI at this head: Linux ran the meta check, which compiles and runs the real check and the five mutants with g++. The Windows `pr` filter (`CMakePresets.json`) runs none of the `gfx1013_sampled_pixel*` tests, so the MSVC evidence is the author's dev + release run (63/63).
github-bot changed target branch from main to gh-pr/3691/base 2026-12-01 03:13:39 +00:00
github manually merged commit 52c779f958 into gh-pr/3691/base 2026-12-01 03:13:39 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.