tests: cover DxilModule resource handles, ViewID matrix, and loop dependencies #3735

Manually merged
github merged 1 commit from github-bot/gh-3733 into main 2026-12-02 02:13:42 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-01 13:02 UTC · original
Ammmae0x:tests/dxil-module → main · +1548 −0 · 5 files · 1 commits · merged 2026-12-02 02:08 UTC

Refs #1149

Portable C++17 unit and header-mutation tests for src/dxil_module.h
(x2w::DxilModule), leaving the existing tests/dxil_module_invoke_*
coverage untouched. Five new files only, zero edits to existing files.

What is covered (49 cases in tests/dxil_module_check.cpp, header-only
against src):

  • handle(): resource sorting by (cls, space, reg), static-handle
    deduplication, distinct spaces (_s<space>), indexed offsets
    (r.reg ? binary("add", reg, offset) : offset, %indexed<seq>,
    track_inputs / loop_dependencies propagation), cbuffer props
    (bytes) vs component + width * 256, cls == 1 +4096,
    comparison +32768, and all six incompatible-binding mismatch
    fields (kind, width, component, bytes, count,
    comparison) throwing the exact
    std::logic_error("incompatible DXIL binding declarations").
  • heap_handle() (heap_used, createHandleFromHeap 218 with
    i1 false, annotateHandle with uav ? 4096 : 0,
    track_inputs / loop_dependencies edges, annotateHandle
    declaration emitted even when resources is empty) and
    sampler_heap_handle() (i1 true, i1 false, kind 14, props 0).
  • finish_loop_dependencies(): cyclic multi-hop %t/%p/%indexed
    convergence ((mask & ~dest).none() termination) and rasterizer
    bit 128 propagation into output_dependencies.
  • finish_compute(): uav_slots > 8 ((min)(count, 9u)) setting the
    0x8000 flag (8 UAV slots clear vs 9 UAV slots and a single range
    with count = 9 set), uses_wave (524288), features,
    validator_minor, llvm.ident = !{!0} ("x2w"), and compute/gs/ms
    properties (mesh_vertices, mesh_primitives).
  • Graphics signatures and the ViewID bit matrix: row == UINT_MAX
    (-1 row/first without incrementing scalars), used == 0 vs
    != 0, multi-word stride (out_count + 31) / 32 when
    out_count > 32, gs +3 and ms +1 trailing zeros, and all
    five "invalid graphics signature" (std::runtime_error) checks.

tests/cmake/dxil_module.cmake registers one CTest test per case plus
dxil_module_all and five WILL_FAIL TRUE copy mutations of
src/dxil_module.h (cbuffer props, UAV +4096, loop-dependency merge,
UAV slot clamp, signature row 32). tests/dxil_module_meta_check.py
compiles and runs the real C++ check with g++ -std=c++17 and kills
each mutation against its control case (C++ and meta-check mutation
sets are 1:1, zero model-only mutants).

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

  • tests/dxil_module_meta_check.py: PASS: dxil_module: 49 cases, 5/5 mutations killed (g++)
  • CMake fragment smoke test in a scratch layout: CTest 55/55
    (49 per-case + dxil_module_all + 5 WILL_FAIL controls)
  • form_coverage_check.py, docs_links_check.py (208 files / 802 links),
    bidi_controls_check.py (2826 files): pass
  • run_checks_parallel.py --from-dir tests/checks/python-linux:
    all 90 checks passed
  • git diff --check: clean; merge-tree exits 0

No mingw on this host, so no Windows compile check; Windows
verification (MSVC CTest ^dxil_module) is the arbiter.

Windows Verification (a070245b)

  • git merge-tree --write-tree upstream/main HEAD -> 15b30782 (exit 0), git diff --check clean
  • Python checks: py_compile, form_coverage_check.py, docs_links_check.py (209 files, 806 links), bidi_controls_check.py (2829 files) passed
  • Commands:
cmake --build --preset dev --target dxil_module_check dxil_module_props_cbuffer_mut dxil_module_uav_4096_mut dxil_module_loop_merge_mut dxil_module_uav_min_mut dxil_module_signature_row_mut
ctest --preset dev --no-tests=error -R "^(dxil_module$|dxil_module_)" --output-on-failure
cmake --build --preset release --target dxil_module_check dxil_module_props_cbuffer_mut dxil_module_uav_4096_mut dxil_module_loop_merge_mut dxil_module_uav_min_mut dxil_module_signature_row_mut
ctest --preset release --no-tests=error -R "^(dxil_module$|dxil_module_)" --output-on-failure
  • Results: dev 55/55 passed (0.90s); release 55/55 passed (0.75s); dxil_module_check: PASS: dxil_module: 49/49 cases passed. AI-assisted.
**@⁠Ammmae0x** on GitHub · 2026-12-01 13:02 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3733) `Ammmae0x:tests/dxil-module` → `main` · +1548 −0 · 5 files · 1 commits · merged 2026-12-02 02:08 UTC Refs #1149 Portable C++17 unit and header-mutation tests for `src/dxil_module.h` (`x2w::DxilModule`), leaving the existing `tests/dxil_module_invoke_*` coverage untouched. Five new files only, zero edits to existing files. What is covered (49 cases in `tests/dxil_module_check.cpp`, header-only against `src`): - `handle()`: resource sorting by `(cls, space, reg)`, static-handle deduplication, distinct spaces (`_s<space>`), indexed offsets (`r.reg ? binary("add", reg, offset) : offset`, `%indexed<seq>`, `track_inputs` / `loop_dependencies` propagation), cbuffer props (`bytes`) vs `component + width * 256`, `cls == 1` `+4096`, comparison `+32768`, and all six incompatible-binding mismatch fields (`kind`, `width`, `component`, `bytes`, `count`, `comparison`) throwing the exact `std::logic_error("incompatible DXIL binding declarations")`. - `heap_handle()` (`heap_used`, `createHandleFromHeap` 218 with `i1 false`, `annotateHandle` with `uav ? 4096 : 0`, `track_inputs` / `loop_dependencies` edges, `annotateHandle` declaration emitted even when `resources` is empty) and `sampler_heap_handle()` (`i1 true, i1 false`, kind 14, props 0). - `finish_loop_dependencies()`: cyclic multi-hop `%t`/`%p`/`%indexed` convergence (`(mask & ~dest).none()` termination) and rasterizer bit 128 propagation into `output_dependencies`. - `finish_compute()`: `uav_slots > 8` (`(min)(count, 9u)`) setting the `0x8000` flag (8 UAV slots clear vs 9 UAV slots and a single range with `count = 9` set), `uses_wave` (524288), `features`, `validator_minor`, `llvm.ident = !{!0}` (`"x2w"`), and compute/gs/ms properties (`mesh_vertices`, `mesh_primitives`). - Graphics signatures and the ViewID bit matrix: `row == UINT_MAX` (`-1` row/first without incrementing `scalars`), `used == 0` vs `!= 0`, multi-word stride `(out_count + 31) / 32` when `out_count > 32`, `gs` `+3` and `ms` `+1` trailing zeros, and all five `"invalid graphics signature"` (`std::runtime_error`) checks. `tests/cmake/dxil_module.cmake` registers one CTest test per case plus `dxil_module_all` and five `WILL_FAIL TRUE` copy mutations of `src/dxil_module.h` (cbuffer props, UAV `+4096`, loop-dependency merge, UAV slot clamp, signature row 32). `tests/dxil_module_meta_check.py` compiles and runs the real C++ check with `g++ -std=c++17` and kills each mutation against its control case (C++ and meta-check mutation sets are 1:1, zero model-only mutants). Linux verification on this host (`g++ -std=c++17`): - `tests/dxil_module_meta_check.py`: `PASS: dxil_module: 49 cases, 5/5 mutations killed (g++)` - CMake fragment smoke test in a scratch layout: CTest 55/55 (49 per-case + `dxil_module_all` + 5 `WILL_FAIL` controls) - `form_coverage_check.py`, `docs_links_check.py` (208 files / 802 links), `bidi_controls_check.py` (2826 files): pass - `run_checks_parallel.py --from-dir tests/checks/python-linux`: all 90 checks passed - `git diff --check`: clean; merge-tree exits 0 No mingw on this host, so no Windows compile check; Windows verification (MSVC CTest `^dxil_module`) is the arbiter. <!-- WIN-VERIFY: passed | sha=a070245bafa12782b692e4f16b33bc9ebd77072e | targets=dxil_module_check dxil_module_props_cbuffer_mut dxil_module_uav_4096_mut dxil_module_loop_merge_mut dxil_module_uav_min_mut dxil_module_signature_row_mut | ctest=^dxil_module$|^dxil_module_ | release=true --> ### Windows Verification (`a070245b`) - `git merge-tree --write-tree upstream/main HEAD` -> `15b30782` (exit 0), `git diff --check` clean - Python checks: `py_compile`, `form_coverage_check.py`, `docs_links_check.py` (209 files, 806 links), `bidi_controls_check.py` (2829 files) passed - Commands: ```text cmake --build --preset dev --target dxil_module_check dxil_module_props_cbuffer_mut dxil_module_uav_4096_mut dxil_module_loop_merge_mut dxil_module_uav_min_mut dxil_module_signature_row_mut ctest --preset dev --no-tests=error -R "^(dxil_module$|dxil_module_)" --output-on-failure cmake --build --preset release --target dxil_module_check dxil_module_props_cbuffer_mut dxil_module_uav_4096_mut dxil_module_loop_merge_mut dxil_module_uav_min_mut dxil_module_signature_row_mut ctest --preset release --no-tests=error -R "^(dxil_module$|dxil_module_)" --output-on-failure ``` - Results: `dev` 55/55 passed (0.90s); `release` 55/55 passed (0.75s); `dxil_module_check`: `PASS: dxil_module: 49/49 cases passed`. AI-assisted.
Refs #1149

Portable C++17 unit and header-mutation tests for src/dxil_module.h: 49 cases covering handle() sorting, static-handle deduplication, distinct spaces, indexed offsets, cbuffer/component props, the +4096 UAV and +32768 comparison kind adjustments and all six incompatible-binding mismatches; heap_handle() and sampler_heap_handle(); finish_loop_dependencies() cyclic multi-hop convergence, rasterizer bit 128 and two-source merging; finish_compute() UAV-slot 0x8000 flag, uses_wave, features, validator_minor, llvm.ident and compute/gs/ms properties; graphics signatures and the ViewID bit matrix (UINT_MAX rows, used 0 vs non-zero, multi-word stride, gs/ms trailing zeros, all five invalid-signature refusals). Five WILL_FAIL TRUE copy mutations of the header, each killed by its control case.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:02:44 +00:00
github manually merged commit f198285fca into main 2026-12-02 02:13:42 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.