tests: add toggle, missing_at, and 6 mutation controls to startup_compute_builder_gate #3871

Merged
Ammmae0x merged 7 commits from upstream-pr/3871 into main 2026-12-02 20:12:43 +00:00
Ammmae0x commented 2026-12-02 16:23:43 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-12-02T16:23:43Z.


Refs #1149.

Rework per review: the duplicate compute_builder_gate_unit suite is removed in full (all 5 files gone) and the existing tests/startup_compute_builder_gate_check.cpp fixture carries the mutation controls instead, following the PR #3866 / #3870 rework pattern. Zero edits to CMakeLists.txt or src/; the branch diff vs origin/main is 5 files, +680/-0. Merged with origin/main (beac8b20).

Only non-overlapping additions

tests/startup_compute_builder_gate_check.cpp gains 26 cases (106 -> 132); every earlier assertion is untouched:

  • module names: mixed-slash path (C:\Games/Sub\XboxBvhBuilder.dll) and UNC path (\\server\share\XboxBvhBuilder.dll) match, too-short name (bvh.dll) rejected, default-constructed std::wstring_view has no basename;
  • repeated toggle: note_pipeline real -> missing drops with_pso() (else --with_pso_;) and the set refuses again, back to real restores it and allows again; repeated note_pso on an already-real pipeline leaves with_pso() unchanged;
  • missing_at on a partial set: a missing entry yields its pointer, a real entry yields nullptr, index == tracked and a runtime-derived out-of-range index yield nullptr; after note_pso the filled entry stops being reported;
  • builder_gate_reason exact strings for all 4 decisions plus the "unknown" default for an invalid cast value.

tests/cmake/startup_compute_builder_gate.cmake keeps all existing targets/tests intact and adds the 6 WILL_FAIL TRUE controls, each building the same fixture .cpp against a configure-time mutated header copy (BEFORE PRIVATE, cxx_std_17, configure FATAL_ERROR if an anchor is missing, TIMEOUT 60) and running the whole fixture with no arguments — the fixture exits 1 loudly on any FAIL line, so no --case filter is needed.

New files: tests/startup_compute_builder_gate_meta_check.py (mirrors the 6 CMake controls 1:1, g++ + cl support), tests/checks/python-linux/startup_compute_builder_gate.txt, docs/experiments/startup-compute-builder-gate-mutation-controls.md.

Note: the note is named startup-compute-builder-gate-mutation-controls.md because docs/experiments/startup-compute-builder-gate.md already exists on main (#2920, the runtime gate experiment note).

Spec mismatch flagged, not followed silently

is_compute_builder_module(nullptr) cannot be added as specified: the parameter is a std::wstring_view, whose pointer constructor is nonnull, so passing nullptr is undefined behaviour — g++ -std=c++17 -O2 -Werror rejects the call with -Werror=nonnull (verified on this host), and at runtime it would read through a null pointer in wcslen. The fixture pins the closest well-defined equivalent instead (default-constructed empty view -> false); the empty path was already covered.

Linux verification (this host, g++ 13.3.0)

./out/pe-env/bin/python -B tests/startup_compute_builder_gate_meta_check.py
PASS: startup_compute_builder_gate: 132 cases, 6/6 mutations killed (g++)
./out/pe-env/bin/python -B tests/form_coverage_check.py
form coverage checks passed
./out/pe-env/bin/python -B tests/docs_links_check.py
Checked 251 Markdown files and 954 links.
./out/pe-env/bin/python -B tests/bidi_controls_check.py
Checked 2988 tracked source, script and build/CI files: no bidirectional controls.

Scratch CMake + CTest (^startup_compute_builder_gate): 7/7 (startup_compute_builder_gate + 6 WILL_FAIL controls). git diff --check clean; git merge-tree against origin/main exits 0. Full Python Linux suite not run locally; GitHub Actions runs it on push. No mingw/MSVC on this host, so no Windows compile check; WIN-VERIFY is the arbiter.

Windows Verification (e36f0693)

  • Clean git merge-tree --write-tree upstream/main HEAD and git diff --check.
  • MSVC dev: cmake --preset dev, ctest --preset dev --no-tests=error -R '^startup_compute_builder_gate(_.*_mut)?$' --output-on-failure passed 7/7 (0.83s); full family ctest --preset dev --no-tests=error -R '^startup_compute_builder_gate' --output-on-failure (including _runtime and _request_warp) passed 9/9 (4.26s); direct startup_compute_builder_gate_check.exe printed startup_compute_builder_gate: 132 case(s), 0 failure(s).
  • MSVC release: cmake --preset release, ctest --preset release --no-tests=error -R '^startup_compute_builder_gate(_.*_mut)?$' --output-on-failure passed 7/7 (0.70s).
  • Native cl meta check: python -B tests/startup_compute_builder_gate_meta_check.py printed PASS: startup_compute_builder_gate: 132 cases, 6/6 mutations killed (cl).
  • Repo static checks on Windows: tests/docs_links_check.py (251 files, 954 links) and tests/bidi_controls_check.py (2988 files) passed.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5610521836 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3871). Originally posted by [Ammmae0x](https://github.com/Ammmae0x) on 2026-12-02T16:23:43Z. --- Refs #1149. Rework per review: the duplicate `compute_builder_gate_unit` suite is removed in full (all 5 files gone) and the existing `tests/startup_compute_builder_gate_check.cpp` fixture carries the mutation controls instead, following the PR #3866 / #3870 rework pattern. Zero edits to `CMakeLists.txt` or `src/`; the branch diff vs `origin/main` is 5 files, +680/-0. Merged with `origin/main` (`beac8b20`). ## Only non-overlapping additions `tests/startup_compute_builder_gate_check.cpp` gains 26 cases (106 -> 132); every earlier assertion is untouched: - module names: mixed-slash path (`C:\Games/Sub\XboxBvhBuilder.dll`) and UNC path (`\\server\share\XboxBvhBuilder.dll`) match, too-short name (`bvh.dll`) rejected, default-constructed `std::wstring_view` has no basename; - repeated toggle: `note_pipeline` real -> missing drops `with_pso()` (`else --with_pso_;`) and the set refuses again, back to real restores it and allows again; repeated `note_pso` on an already-real pipeline leaves `with_pso()` unchanged; - `missing_at` on a partial set: a missing entry yields its pointer, a real entry yields `nullptr`, index `== tracked` and a runtime-derived out-of-range index yield `nullptr`; after `note_pso` the filled entry stops being reported; - `builder_gate_reason` exact strings for all 4 decisions plus the `"unknown"` default for an invalid cast value. `tests/cmake/startup_compute_builder_gate.cmake` keeps all existing targets/tests intact and adds the 6 `WILL_FAIL TRUE` controls, each building the same fixture `.cpp` against a configure-time mutated header copy (`BEFORE PRIVATE`, `cxx_std_17`, configure `FATAL_ERROR` if an anchor is missing, `TIMEOUT 60`) and running the whole fixture with no arguments — the fixture exits 1 loudly on any `FAIL` line, so no `--case` filter is needed. New files: `tests/startup_compute_builder_gate_meta_check.py` (mirrors the 6 CMake controls 1:1, `g++` + `cl` support), `tests/checks/python-linux/startup_compute_builder_gate.txt`, `docs/experiments/startup-compute-builder-gate-mutation-controls.md`. Note: the note is named `startup-compute-builder-gate-mutation-controls.md` because `docs/experiments/startup-compute-builder-gate.md` already exists on `main` (#2920, the runtime gate experiment note). ## Spec mismatch flagged, not followed silently `is_compute_builder_module(nullptr)` cannot be added as specified: the parameter is a `std::wstring_view`, whose pointer constructor is nonnull, so passing `nullptr` is undefined behaviour — `g++ -std=c++17 -O2 -Werror` rejects the call with `-Werror=nonnull` (verified on this host), and at runtime it would read through a null pointer in `wcslen`. The fixture pins the closest well-defined equivalent instead (default-constructed empty view -> false); the empty path was already covered. ## Linux verification (this host, g++ 13.3.0) ```text ./out/pe-env/bin/python -B tests/startup_compute_builder_gate_meta_check.py PASS: startup_compute_builder_gate: 132 cases, 6/6 mutations killed (g++) ./out/pe-env/bin/python -B tests/form_coverage_check.py form coverage checks passed ./out/pe-env/bin/python -B tests/docs_links_check.py Checked 251 Markdown files and 954 links. ./out/pe-env/bin/python -B tests/bidi_controls_check.py Checked 2988 tracked source, script and build/CI files: no bidirectional controls. ``` Scratch CMake + CTest (`^startup_compute_builder_gate`): 7/7 (`startup_compute_builder_gate` + 6 `WILL_FAIL` controls). `git diff --check` clean; `git merge-tree` against `origin/main` exits 0. Full Python Linux suite not run locally; GitHub Actions runs it on push. No mingw/MSVC on this host, so no Windows compile check; WIN-VERIFY is the arbiter. ## Windows Verification (`e36f0693`) - Clean `git merge-tree --write-tree upstream/main HEAD` and `git diff --check`. - MSVC `dev`: `cmake --preset dev`, `ctest --preset dev --no-tests=error -R '^startup_compute_builder_gate(_.*_mut)?$' --output-on-failure` passed `7/7` (`0.83s`); full family `ctest --preset dev --no-tests=error -R '^startup_compute_builder_gate' --output-on-failure` (including `_runtime` and `_request_warp`) passed `9/9` (`4.26s`); direct `startup_compute_builder_gate_check.exe` printed `startup_compute_builder_gate: 132 case(s), 0 failure(s)`. - MSVC `release`: `cmake --preset release`, `ctest --preset release --no-tests=error -R '^startup_compute_builder_gate(_.*_mut)?$' --output-on-failure` passed `7/7` (`0.70s`). - Native `cl` meta check: `python -B tests/startup_compute_builder_gate_meta_check.py` printed `PASS: startup_compute_builder_gate: 132 cases, 6/6 mutations killed (cl)`. - Repo static checks on Windows: `tests/docs_links_check.py` (251 files, 954 links) and `tests/bidi_controls_check.py` (2988 files) passed. AI-assisted. <!-- WIN-VERIFY: passed | sha=e36f069312063e6e545c88271228557d28292996 | ctest=^startup_compute_builder_gate | dev=9/9 | release=7/7 | cl_meta=132cases_6of6 -->
R0Y00 commented 2026-12-02 17:16:51 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T17:16:51Z.

Review: APPROVED


Reviewed e36f0693. The toggle, missing-index and decision assertions extend the existing fixture. No production source changed. Independent Windows/MSVC Debug ctest --preset dev --no-tests=error -j 1 -R '^startup_compute_builder_gate' --output-on-failure passed 9/9, including six mutation tests, the existing runtime fixture and the WARP request case.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6155672582 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3871#pullrequestreview-6155672582). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T17:16:51Z. **Review:** APPROVED --- Reviewed e36f0693. The toggle, missing-index and decision assertions extend the existing fixture. No production source changed. Independent Windows/MSVC Debug `ctest --preset dev --no-tests=error -j 1 -R '^startup_compute_builder_gate' --output-on-failure` passed 9/9, including six mutation tests, the existing runtime fixture and the WARP request case.
R0Y00 commented 2026-12-02 19:39:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T19:39:05Z.

Review: APPROVED


Revalidated 32126662 after GitHub Update branch brought #3883 into the baseline. The files changed by this PR are unchanged from e36f0693. Independent Windows/MSVC Debug ctest --preset dev --no-tests=error -j 1 -R '^startup_compute_builder_gate' --output-on-failure passed 9/9, including six mutation controls, the runtime fixture and WARP request publication. The hosted checks still need to finish on this revision.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6157617823 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3871#pullrequestreview-6157617823). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T19:39:05Z. **Review:** APPROVED --- Revalidated 32126662 after GitHub Update branch brought #3883 into the baseline. The files changed by this PR are unchanged from e36f0693. Independent Windows/MSVC Debug `ctest --preset dev --no-tests=error -j 1 -R '^startup_compute_builder_gate' --output-on-failure` passed 9/9, including six mutation controls, the runtime fixture and WARP request publication. The hosted checks still need to finish on this revision.
R0Y00 commented 2026-12-02 20:05:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T20:05:56Z.

Review: APPROVED


Revalidated 9e508ada after GitHub Update branch brought #3885 into this PR. The owned files are unchanged. Independent Windows/MSVC Debug ctest --preset dev --no-tests=error -j 1 -R '^startup_compute_builder_gate' --output-on-failure passed 9/9, including the six mutation tests, runtime fixture and WARP request publication. The export catalog check passed all 476 checks including all six mutations.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6158037206 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3871#pullrequestreview-6158037206). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-12-02T20:05:56Z. **Review:** APPROVED --- Revalidated 9e508ada after GitHub Update branch brought #3885 into this PR. The owned files are unchanged. Independent Windows/MSVC Debug `ctest --preset dev --no-tests=error -j 1 -R '^startup_compute_builder_gate' --output-on-failure` passed 9/9, including the six mutation tests, runtime fixture and WARP request publication. The export catalog check passed all 476 checks including all six mutations.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!3871
No description provided.