shader: align not_checked schema and add CLI and contract suite for xbox_intrinsic_gate #1917

Merged
Ammmae0x merged 1 commit from upstream-pr/1924 into main 2026-11-24 21:34:56 +00:00
Ammmae0x commented 2026-11-24 21:23:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-24T21:23:42Z.


Change

Align not_checked() dictionary keys with decide() in tools/xbox_intrinsic_gate.py, accept an optional argv=None in main(), and add a unit and CLI contract test suite in tests/xbox_intrinsic_gate_check.py registered in CMakeLists.txt:

  • Add "references": {}, "debug_only": [], "blocking_calls": [], and "blocking_references": [] to not_checked(reason) so callers see identical schema keys across ALLOW, REJECT, and NOT_CHECKED.
  • Update main(argv=None) to pass argv to parser.parse_args(argv).
  • Add tests/xbox_intrinsic_gate_check.py covering not_checked() vs decide() key parity, check-text allow cases (ordinary, declared-only, debug-only, and stdin -), check subcommand with synthetic DXBC and mocked probe_roots.validate_shader(), REJECT cases for calls and all five executable reference forms (alias, store, bitcast, global-initializer, call-operand) even under an advisory LOWERED table, exit code 1 for NOT_CHECKED, exit code 2 without tracebacks on invalid CLI invocations or missing DXIL/files, and zero-submission enforcement in gate_submission().
  • Register xbox_intrinsic_gate_check in CMakeLists.txt.

Verification

Verified on rebased branch shader/xbox-intrinsic-gate-cli-and-contract (on top of upstream/main 9881fef0):

  • cmake --preset dev -DINTAKE_PYTHON=... -> Configuring done (0.3s), Total Tests: 1205 (#1173..1176: dxil_retarget_probe, dxil_retarget_probe_hardware, dxil_retarget_controls, xbox_intrinsic_gate_check)
  • cmake --preset release -DINTAKE_PYTHON=... -> Configuring done (0.3s), Total Tests: 1205 (#1173..1176)
  • ctest --preset dev --no-tests=error -R "^(xbox_intrinsic_gate_check|dxil_retarget.*)$" -V -> 4/4 passed (dxil_retarget_probe, dxil_retarget_probe_hardware, dxil_retarget_controls, xbox_intrinsic_gate_check)
  • ctest --preset release --no-tests=error -R "^(xbox_intrinsic_gate_check|dxil_retarget.*)$" -V -> 4/4 passed (Total Test time (real) = 9.21 sec; xbox_intrinsic_gate_check Ran 7 tests in 2.854s)
  • python -B tests/xbox_intrinsic_gate_check.py -v -> Ran 7 tests in 2.852s, OK
  • python -B tests/dxil_retarget_check.py -> pure-python dxil_retarget controls: ok
  • python -B tests/form_coverage_check.py -> form coverage checks passed
  • python -B tests/docs_links_check.py -> Checked 18 Markdown files and 386 links.
  • python -B tests/bidi_controls_check.py -> Checked 1351 tracked source, script and build/CI files: no bidirectional controls.

Evidence and follow-up

All fixtures in tests/xbox_intrinsic_gate_check.py are constructed synthetically in memory (LLVM IR strings, minimal DXBC containers via struct, and mocked probe_roots.validate_shader); dxil_retarget_probe and dxil_retarget_probe_hardware also ran against compiled root_probe, root_device_probe, offscreen_check, compute_root.cso, and CopyBlocksSM65.cso on WARP and hardware adapters.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6591700319 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1924). Originally posted by [Ammmae0x](https://github.com/Ammmae0x) on 2026-11-24T21:23:42Z. --- ## Change Align `not_checked()` dictionary keys with `decide()` in [`tools/xbox_intrinsic_gate.py`](tools/xbox_intrinsic_gate.py), accept an optional `argv=None` in `main()`, and add a unit and CLI contract test suite in [`tests/xbox_intrinsic_gate_check.py`](tests/xbox_intrinsic_gate_check.py) registered in [`CMakeLists.txt`](CMakeLists.txt): - Add `"references": {}`, `"debug_only": []`, `"blocking_calls": []`, and `"blocking_references": []` to `not_checked(reason)` so callers see identical schema keys across `ALLOW`, `REJECT`, and `NOT_CHECKED`. - Update `main(argv=None)` to pass `argv` to `parser.parse_args(argv)`. - Add `tests/xbox_intrinsic_gate_check.py` covering `not_checked()` vs `decide()` key parity, `check-text` allow cases (ordinary, declared-only, debug-only, and stdin `-`), `check` subcommand with synthetic DXBC and mocked `probe_roots.validate_shader()`, `REJECT` cases for calls and all five executable reference forms (`alias`, `store`, `bitcast`, `global-initializer`, `call-operand`) even under an advisory `LOWERED` table, exit code `1` for `NOT_CHECKED`, exit code `2` without tracebacks on invalid CLI invocations or missing DXIL/files, and zero-submission enforcement in `gate_submission()`. - Register `xbox_intrinsic_gate_check` in `CMakeLists.txt`. ## Verification Verified on rebased branch `shader/xbox-intrinsic-gate-cli-and-contract` (on top of `upstream/main` `9881fef0`): - `cmake --preset dev -DINTAKE_PYTHON=...` -> `Configuring done (0.3s)`, `Total Tests: 1205` (`#1173..1176`: `dxil_retarget_probe`, `dxil_retarget_probe_hardware`, `dxil_retarget_controls`, `xbox_intrinsic_gate_check`) - `cmake --preset release -DINTAKE_PYTHON=...` -> `Configuring done (0.3s)`, `Total Tests: 1205` (`#1173..1176`) - `ctest --preset dev --no-tests=error -R "^(xbox_intrinsic_gate_check|dxil_retarget.*)$" -V` -> `4/4` passed (`dxil_retarget_probe`, `dxil_retarget_probe_hardware`, `dxil_retarget_controls`, `xbox_intrinsic_gate_check`) - `ctest --preset release --no-tests=error -R "^(xbox_intrinsic_gate_check|dxil_retarget.*)$" -V` -> `4/4` passed (`Total Test time (real) = 9.21 sec`; `xbox_intrinsic_gate_check` `Ran 7 tests in 2.854s`) - `python -B tests/xbox_intrinsic_gate_check.py -v` -> `Ran 7 tests in 2.852s`, `OK` - `python -B tests/dxil_retarget_check.py` -> `pure-python dxil_retarget controls: ok` - `python -B tests/form_coverage_check.py` -> `form coverage checks passed` - `python -B tests/docs_links_check.py` -> `Checked 18 Markdown files and 386 links.` - `python -B tests/bidi_controls_check.py` -> `Checked 1351 tracked source, script and build/CI files: no bidirectional controls.` ## Evidence and follow-up All fixtures in `tests/xbox_intrinsic_gate_check.py` are constructed synthetically in memory (LLVM IR strings, minimal DXBC containers via `struct`, and mocked `probe_roots.validate_shader`); `dxil_retarget_probe` and `dxil_retarget_probe_hardware` also ran against compiled `root_probe`, `root_device_probe`, `offscreen_check`, `compute_root.cso`, and `CopyBlocksSM65.cso` on WARP and hardware adapters. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [ ] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. AI-assisted.
upstream-sync closed this pull request 2026-11-24 22:00:52 +00:00
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!1917
No description provided.