tests: cover input_view_token facts and refusal precedence #3866

Manually merged
github merged 2 commits from github-bot/gh-3864 into gh-pr/3864/base 2026-12-02 15:37:54 +00:00 AGit
Owner

@⁠Ammmae0x on GitHub · 2026-12-02 15:08 UTC · original
Ammmae0x:tests/input-view-token-unit → main · +1210 −0 · 5 files · 2 commits · merged 2026-12-02 15:33 UTC

Refs #1149

Portable C++17 unit and 1:1 header-mutation tests for input_view_token_facts and input_view_token_refusal in src/startup_stubs/input_view_token.h, with zero edits to existing files (5 new files only, +1210/-0, prefix input_view_token_unit). The existing tests/startup_input_view_token_check.cpp coverage is untouched.

What landed

  • tests/input_view_token_unit_check.cpp — 12 cases, header-only against src, no device, no temporary files, every shared constant static constexpr:
    • facts_passthrough: default facts and passthrough of known, slot, desc_bytes, view_dimension, resource_pointer, placement.
    • facts_wrapper_resource: the full 8-row truth table for resource = wrapper && owner_is_resource and desktop = resource && desktop.
    • unknown_precedence: !known beats sampler, UAV, truncated CBV, and truncated non-buffer non-wrapper SRV shapes.
    • slot_kinds: slots 22 (sampler), 19 (UAV), 20/21 (render or depth view), each before any size, dimension or ownership guard.
    • cbv_boundary: slot 17 with desc_bytes 0/11 truncated, 12/13/40 binding; truncation precedes the dimension guard and a 12-byte view binds without the dimension or wrapper guards.
    • unrecognized_slot: slots 0, 1, 16, 23, 100 and UINT32_MAX; slot 16 with 39 bytes is unrecognized before truncation, slot 0 with dimension 0 before the dimension guard.
    • srv_truncation: slot 18 with desc_bytes 0/39 truncated, 40/41 reaching the dimension guard; 39 bytes truncated before the dimension and wrapper guards.
    • non_buffer_dimension: dimensions 0, 2, 4 and UINT32_MAX keep the historical "not a buffer view" sentence, before the wrapper guard.
    • wrapper_guard: no resource pointer, non-wrapper owner, and neither — each refused as not a wrapper, before the resource and desktop guards.
    • resource_guard: a wrapper of another kind refused as not a resource, even with a desktop flag and with placement 1/2 and no desktop object.
    • desktop_placement: no desktop object with placement 1/2 refused as placed or copied, and with placement 0/3/UINT32_MAX as having no desktop resource.
    • valid_views: 12-byte and 100-byte CBVs bind, and 40-byte and 41-byte buffer SRVs of a desktop resource bind, including with placement 1/2 once the desktop object is present.
  • tests/cmake/input_view_token_unit.cmake — one CTest test per case plus input_view_token_unit_all, and 6 WILL_FAIL TRUE BEFORE PRIVATE header-copy controls, mirrored 1:1 in the meta check: facts_resource, facts_desktop, cbv_boundary, srv_boundary, sampler_slot, desktop_placement.
  • tests/input_view_token_unit_meta_check.py — audits the contract, compiles and runs the real check with g++ -std=c++17 -Wall -Wextra -Wpedantic -Werror (or cl with /W4 on a host without g++), and kills each mutant natively; temporary directories removed in a finally block.
  • tests/checks/python-linux/input_view_token_unit.txt
  • docs/experiments/input-view-token-unit.md

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

./out/pe-env/bin/python -B tests/input_view_token_unit_meta_check.py
PASS: input_view_token_unit: 12 cases, 6/6 mutations killed (g++)

Scratch CMake + CTest (fragment standalone via symlinked src/tests with enable_testing(); the full configure needs DXC): 19/19 (12 per-case + _all + 6 WILL_FAIL controls). form_coverage_check.py passes, docs_links_check.py passes (242 files / 921 links), bidi_controls_check.py passes (2960 files), full python-linux suite 329/329 via tools/run_checks_parallel.py (txt-listed checks alone: 120/120), git diff --check clean, git merge-tree --write-tree origin/main HEAD exits 0.

Caveat: no mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter.

Remote mapping: the task said push to origin, but in this clone origin is R0Y00/Xbox2Windows, so as with all prior PRs it went to fork (Ammmae0x/Xbox2Windows, branch tests/input-view-token-unit, no force-push). Work was done in a dedicated worktree off origin/main 5770f14e; the main clone is untouched.

Windows Verification (55e7e211e53737b4f69482c6a01c25231c4dcc1c)

ctest --preset dev --no-tests=error -j16 -R '^input_view_token_unit' --output-on-failure
-> 100% tests passed, 0 tests failed out of 19 (0.78s)

ctest --preset release --no-tests=error -j16 -R '^input_view_token_unit' --output-on-failure
-> 100% tests passed, 0 tests failed out of 19 (0.70s)

input_view_token_unit_check.exe (dev + release): 12/12 cases passed
tests/input_view_token_unit_meta_check.py (cl): 12 cases, 6/6 mutations killed (cl)

AI-assisted.

**@⁠Ammmae0x** on GitHub · 2026-12-02 15:08 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3864) `Ammmae0x:tests/input-view-token-unit` → `main` · +1210 −0 · 5 files · 2 commits · merged 2026-12-02 15:33 UTC Refs #1149 Portable C++17 unit and 1:1 header-mutation tests for `input_view_token_facts` and `input_view_token_refusal` in `src/startup_stubs/input_view_token.h`, with zero edits to existing files (5 new files only, +1210/-0, prefix `input_view_token_unit`). The existing `tests/startup_input_view_token_check.cpp` coverage is untouched. **What landed** - `tests/input_view_token_unit_check.cpp` — 12 cases, header-only against `src`, no device, no temporary files, every shared constant `static constexpr`: - `facts_passthrough`: default facts and passthrough of `known`, `slot`, `desc_bytes`, `view_dimension`, `resource_pointer`, `placement`. - `facts_wrapper_resource`: the full 8-row truth table for `resource = wrapper && owner_is_resource` and `desktop = resource && desktop`. - `unknown_precedence`: `!known` beats sampler, UAV, truncated CBV, and truncated non-buffer non-wrapper SRV shapes. - `slot_kinds`: slots 22 (sampler), 19 (UAV), 20/21 (render or depth view), each before any size, dimension or ownership guard. - `cbv_boundary`: slot 17 with `desc_bytes` 0/11 truncated, 12/13/40 binding; truncation precedes the dimension guard and a 12-byte view binds without the dimension or wrapper guards. - `unrecognized_slot`: slots 0, 1, 16, 23, 100 and `UINT32_MAX`; slot 16 with 39 bytes is unrecognized before truncation, slot 0 with dimension 0 before the dimension guard. - `srv_truncation`: slot 18 with `desc_bytes` 0/39 truncated, 40/41 reaching the dimension guard; 39 bytes truncated before the dimension and wrapper guards. - `non_buffer_dimension`: dimensions 0, 2, 4 and `UINT32_MAX` keep the historical "not a buffer view" sentence, before the wrapper guard. - `wrapper_guard`: no resource pointer, non-wrapper owner, and neither — each refused as not a wrapper, before the resource and desktop guards. - `resource_guard`: a wrapper of another kind refused as not a resource, even with a desktop flag and with placement 1/2 and no desktop object. - `desktop_placement`: no desktop object with placement 1/2 refused as placed or copied, and with placement 0/3/`UINT32_MAX` as having no desktop resource. - `valid_views`: 12-byte and 100-byte CBVs bind, and 40-byte and 41-byte buffer SRVs of a desktop resource bind, including with placement 1/2 once the desktop object is present. - `tests/cmake/input_view_token_unit.cmake` — one CTest test per case plus `input_view_token_unit_all`, and 6 `WILL_FAIL TRUE` `BEFORE PRIVATE` header-copy controls, mirrored 1:1 in the meta check: `facts_resource`, `facts_desktop`, `cbv_boundary`, `srv_boundary`, `sampler_slot`, `desktop_placement`. - `tests/input_view_token_unit_meta_check.py` — audits the contract, compiles and runs the real check with `g++ -std=c++17 -Wall -Wextra -Wpedantic -Werror` (or `cl` with `/W4` on a host without `g++`), and kills each mutant natively; temporary directories removed in a `finally` block. - `tests/checks/python-linux/input_view_token_unit.txt` - `docs/experiments/input-view-token-unit.md` **Linux verification (this host, `g++ -std=c++17`)** ```text ./out/pe-env/bin/python -B tests/input_view_token_unit_meta_check.py PASS: input_view_token_unit: 12 cases, 6/6 mutations killed (g++) ``` Scratch CMake + CTest (fragment standalone via symlinked `src`/`tests` with `enable_testing()`; the full configure needs DXC): 19/19 (12 per-case + `_all` + 6 `WILL_FAIL` controls). `form_coverage_check.py` passes, `docs_links_check.py` passes (242 files / 921 links), `bidi_controls_check.py` passes (2960 files), full python-linux suite 329/329 via `tools/run_checks_parallel.py` (txt-listed checks alone: 120/120), `git diff --check` clean, `git merge-tree --write-tree origin/main HEAD` exits 0. Caveat: no mingw on this host, so no Windows compile check; WIN-VERIFY run is the arbiter. **Remote mapping:** the task said push to `origin`, but in this clone `origin` is R0Y00/Xbox2Windows, so as with all prior PRs it went to `fork` (Ammmae0x/Xbox2Windows, branch `tests/input-view-token-unit`, no force-push). Work was done in a dedicated worktree off `origin/main` `5770f14e`; the main clone is untouched. ### Windows Verification (`55e7e211e53737b4f69482c6a01c25231c4dcc1c`) ```text ctest --preset dev --no-tests=error -j16 -R '^input_view_token_unit' --output-on-failure -> 100% tests passed, 0 tests failed out of 19 (0.78s) ctest --preset release --no-tests=error -j16 -R '^input_view_token_unit' --output-on-failure -> 100% tests passed, 0 tests failed out of 19 (0.70s) input_view_token_unit_check.exe (dev + release): 12/12 cases passed tests/input_view_token_unit_meta_check.py (cl): 12 cases, 6/6 mutations killed (cl) ``` AI-assisted. <!-- WIN-VERIFY: passed | sha=55e7e211e53737b4f69482c6a01c25231c4dcc1c -->
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 15:10:47 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-12-02 15:23 UTC · original · approved these changes

Independent Windows/MSVC Debug validation: ctest --preset dev --no-tests=error -R '^input_view_token_unit' --output-on-failure passed 19/19, including all six mutation controls. Compared the tested head 55e7e211 with 7bfa5567: the only difference is the unrelated packed mesh fixture fix from main. Test targets and fixture inputs are identical.

**@⁠R0Y00** on GitHub · 2026-12-02 15:23 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3864#pullrequestreview-6153788735) · **approved these changes** Independent Windows/MSVC Debug validation: `ctest --preset dev --no-tests=error -R '^input_view_token_unit' --output-on-failure` passed 19/19, including all six mutation controls. Compared the tested head 55e7e211 with 7bfa5567: the only difference is the unrelated packed mesh fixture fix from main. Test targets and fixture inputs are identical.
github-bot changed target branch from main to gh-pr/3864/base 2026-12-02 15:37:51 +00:00
github manually merged commit 7bfa55675e into gh-pr/3864/base 2026-12-02 15:37:54 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.