tests: cover gfx1013 constant pixel shader decoding #3698

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

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

Refs #1149

Portable C++17 unit, refusal, and mutation tests for
x2w::translate_gfx1013_constant_pixel and
x2w::direct_gfx1013_constant_pixel (src/gfx1013_pixel.cpp).
Only tests are added; the source is unchanged.

What landed — commit a6ce20f9, 5 new files only, +1478/−0,
zero edits to existing files:

  • tests/gfx1013_pixel_check.cpp: 136 cases (108 valid, 28
    refusals) calling both entry points directly. Valid cases pin
    the exact HLSL string and the exact DXIL 1.0 module: every
    inline integer 128..192, every negative inline integer
    193..208, every inline float 240..247, twelve 32-bit literals
    (including +inf, -inf, quiet/signalling NaN, -0.0), VGPR copy
    chains and overwrites, and MRT0 exports selecting distinct,
    repeated, reversed, and high-VGPR (v200..v203) channels.
    Refusals pin all 6 exact error strings with byte offsets:
    truncated program (1-byte, 1..3-byte tails, missing literal
    dword, missing export sources dword), unsupported instruction
    (bad opcode, s_endpgm before export), expected final
    s_endpgm (bad opcode / move after export, trailing words
    after s_endpgm), unresolved v_mov source (gaps 0..105,
    106..127, 209..239, 248..254, uninitialized VGPR copy),
    uninitialized export VGPR (channels 0, 1, 3), and missing
    final MRT0 export or s_endpgm (including the empty program,
    which throws missing rather than truncated because the decoder
    only reads a word when a byte remains).
  • tests/cmake/gfx1013_pixel.cmake: registers
    gfx1013_pixel_check plus one CTest test per case and 5
    WILL_FAIL TRUE mutation controls (inline-int offset,
    inline-neg offset, inline-float table entry, VGPR-copy lower
    bound, s_endpgm trailing-bytes check).
  • tests/gfx1013_pixel_meta_check.py: audits the contract,
    compiles and runs the real C++ check with g++ -std=c++17,
    compiles each CMake mutant the same way, and runs a Python
    model mutation audit (3 extra model-only mutants: literal-255
    branch, export opcode, uninitialized-export guard).
  • tests/checks/python-linux/gfx1013_pixel.txt and
    docs/experiments/gfx1013-pixel.md.

Linux verification (this host, g++ -std=c++17):

/tmp/pe-env/bin/python -B tests/gfx1013_pixel_meta_check.py
PASS: gfx1013 pixel: 136 cases, 5/5 real C++ mutations killed, 8/8 model mutations killed
/tmp/pe-env/bin/python -B tests/form_coverage_check.py
form coverage checks passed
/tmp/pe-env/bin/python -B tests/docs_links_check.py
Checked 198 Markdown files and 765 links.
/tmp/pe-env/bin/python -B tests/bidi_controls_check.py
Checked 2793 tracked source, script and build/CI files: no bidirectional controls.
/tmp/pe-env/bin/python tools/run_checks_parallel.py --from-dir tests/checks/python-linux
all 80 checks passed

git diff --check is clean. Windows execution (MSVC) awaits
Windows verification.

Windows Verification (a6ce20f904750c15e9949e14820e0df23b5c244e)

Commit: a6ce20f904750c15e9949e14820e0df23b5c244e (merge-tree upstream/main HEAD -> 91be506e, exit 0; git diff --check clean)
dev: cmake --build --preset dev --target gfx1013_pixel_check ... && ctest --preset dev --no-tests=error -R '^gfx1013_pixel' --output-on-failure -> 142/142 passed (2.55s; 136 cases + all + 5/5 mutations killed)
release: cmake --build --preset release --target gfx1013_pixel_check ... && ctest --preset release --no-tests=error -R '^gfx1013_pixel' --output-on-failure -> 142/142 passed (2.13s; 136 cases + all + 5/5 mutations killed)
Direct binary (dev & release): PASS: gfx1013_pixel: 136/136 cases passed
Checks: form_coverage_check.py, docs_links_check.py (199 files, 769 links), bidi_controls_check.py (2796 files) -> passed

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-12-01 02:54 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3696) `Ammmae0x:tests/gfx1013-pixel` → `main` · +1478 −0 · 5 files · 1 commits · merged 2026-12-01 03:13 UTC Refs #1149 Portable C++17 unit, refusal, and mutation tests for `x2w::translate_gfx1013_constant_pixel` and `x2w::direct_gfx1013_constant_pixel` (`src/gfx1013_pixel.cpp`). Only tests are added; the source is unchanged. **What landed** — commit `a6ce20f9`, 5 new files only, +1478/−0, zero edits to existing files: - `tests/gfx1013_pixel_check.cpp`: 136 cases (108 valid, 28 refusals) calling both entry points directly. Valid cases pin the exact HLSL string and the exact DXIL 1.0 module: every inline integer 128..192, every negative inline integer 193..208, every inline float 240..247, twelve 32-bit literals (including +inf, -inf, quiet/signalling NaN, -0.0), VGPR copy chains and overwrites, and MRT0 exports selecting distinct, repeated, reversed, and high-VGPR (v200..v203) channels. Refusals pin all 6 exact error strings with byte offsets: truncated program (1-byte, 1..3-byte tails, missing literal dword, missing export sources dword), unsupported instruction (bad opcode, `s_endpgm` before export), expected final `s_endpgm` (bad opcode / move after export, trailing words after `s_endpgm`), unresolved `v_mov` source (gaps 0..105, 106..127, 209..239, 248..254, uninitialized VGPR copy), uninitialized export VGPR (channels 0, 1, 3), and missing final MRT0 export or `s_endpgm` (including the empty program, which throws missing rather than truncated because the decoder only reads a word when a byte remains). - `tests/cmake/gfx1013_pixel.cmake`: registers `gfx1013_pixel_check` plus one CTest test per case and 5 `WILL_FAIL TRUE` mutation controls (inline-int offset, inline-neg offset, inline-float table entry, VGPR-copy lower bound, `s_endpgm` trailing-bytes check). - `tests/gfx1013_pixel_meta_check.py`: audits the contract, compiles and runs the real C++ check with `g++ -std=c++17`, compiles each CMake mutant the same way, and runs a Python model mutation audit (3 extra model-only mutants: literal-255 branch, export opcode, uninitialized-export guard). - `tests/checks/python-linux/gfx1013_pixel.txt` and `docs/experiments/gfx1013-pixel.md`. **Linux verification** (this host, `g++ -std=c++17`): ```text /tmp/pe-env/bin/python -B tests/gfx1013_pixel_meta_check.py PASS: gfx1013 pixel: 136 cases, 5/5 real C++ mutations killed, 8/8 model mutations killed /tmp/pe-env/bin/python -B tests/form_coverage_check.py form coverage checks passed /tmp/pe-env/bin/python -B tests/docs_links_check.py Checked 198 Markdown files and 765 links. /tmp/pe-env/bin/python -B tests/bidi_controls_check.py Checked 2793 tracked source, script and build/CI files: no bidirectional controls. /tmp/pe-env/bin/python tools/run_checks_parallel.py --from-dir tests/checks/python-linux all 80 checks passed ``` `git diff --check` is clean. Windows execution (MSVC) awaits Windows verification. ### Windows Verification (`a6ce20f904750c15e9949e14820e0df23b5c244e`) ```text Commit: a6ce20f904750c15e9949e14820e0df23b5c244e (merge-tree upstream/main HEAD -> 91be506e, exit 0; git diff --check clean) dev: cmake --build --preset dev --target gfx1013_pixel_check ... && ctest --preset dev --no-tests=error -R '^gfx1013_pixel' --output-on-failure -> 142/142 passed (2.55s; 136 cases + all + 5/5 mutations killed) release: cmake --build --preset release --target gfx1013_pixel_check ... && ctest --preset release --no-tests=error -R '^gfx1013_pixel' --output-on-failure -> 142/142 passed (2.13s; 136 cases + all + 5/5 mutations killed) Direct binary (dev & release): PASS: gfx1013_pixel: 136/136 cases passed Checks: form_coverage_check.py, docs_links_check.py (199 files, 769 links), bidi_controls_check.py (2796 files) -> passed ``` AI-assisted. <!-- WIN-VERIFY: passed | sha=a6ce20f904750c15e9949e14820e0df23b5c244e | targets=gfx1013_pixel_check gfx1013_pixel_inline_int_mut gfx1013_pixel_inline_neg_mut gfx1013_pixel_inline_float_mut gfx1013_pixel_vgpr_copy_mut gfx1013_pixel_endpgm_trailing_mut | ctest=^gfx1013_pixel | release=true -->
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 02:54:57 +00:00
github-bot changed target branch from main to gh-pr/3696/base 2026-12-01 03:13:24 +00:00
github manually merged commit a6ce20f904 into gh-pr/3696/base 2026-12-01 03:13:26 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-01 03:11 UTC · original · approved these changes

Reviewed the synthetic constant-pixel decoder cases and their five mutation controls, including inline constants, register copies and trailing words. ctest --test-dir <build> --no-tests=error -j1 -R '^gfx1013_pixel_' --output-on-failure passed in the Windows integration.

**@⁠R0Y00** on GitHub · 2026-12-01 03:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3696#pullrequestreview-6124498385) · **approved these changes** Reviewed the synthetic constant-pixel decoder cases and their five mutation controls, including inline constants, register copies and trailing words. `ctest --test-dir <build> --no-tests=error -j1 -R '^gfx1013_pixel_' --output-on-failure` passed in the Windows integration.
This discussion has been locked. Commenting is limited to contributors.
No description provided.