shader: test the mesh86 root SRV load count #2314

Merged
sydney-0o merged 1 commit from upstream-pr/2322 into main 2026-11-25 12:21:38 +00:00
sydney-0o commented 2026-11-25 12:16:28 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by sydney-0o on 2026-11-25T12:16:28Z.


Follow-up to merged PR #2303 and tedin7's review finding.

#2303 lets a cached slot 86 mesh draw consume one leased XMem DWORD through a root SRV. The cache publisher only emits the version 2 proof marker when the DXIL has exactly one raw 32-bit load at byte offset zero from t0 space0. The previous cases exercised shifted, dynamic and wide loads. The review identified a gap in coverage for two instructions that each match the allowed load form and use the same SRV handle.

This test feeds the verifier a synthetic DXIL dump with one load, then appends the same load with a distinct SSA result. It checks that the first dump returns a four-byte extent and the second is rejected by the load-count guard. Feeding the dump directly preserves both instructions independently of DXC optimization. The no-argument test runs in Linux Python CI, and the existing DXC-backed CTest entry runs both the dump check and the cache publication cases.

Refs #1914, #870.

Validation

Tested local commit a10f5fe8 on Windows with Python 3.12.14 and Windows SDK 10.0.26100.0 DXC. Its Git tree is identical to this PR head.

python -B tools/run_checks_parallel.py --jobs 3 tests/startup_mesh86_srv_proof_check.py tests/docs_links_check.py tests/bidi_controls_check.py
$dxc = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/dxc.exe'
New-Item -ItemType Directory -Force out | Out-Null
python -B tests/startup_mesh86_srv_proof_check.py $dxc out
git diff --check

All three Python checks passed. The DXC-backed check passed the dump assertions, the positive cache publication and the existing refusal cases. The diff check was clean. Replacing the load-count guard in memory with if False: made the new test fail with accepted two DWORD loads from the verified SRV handle.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6604270524 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2322). Originally posted by [sydney-0o](https://github.com/sydney-0o) on 2026-11-25T12:16:28Z. --- Follow-up to merged PR #2303 and [tedin7's review finding](https://github.com/R0Y00/Xbox2Windows/pull/2303#pullrequestreview-6056558356). #2303 lets a cached slot 86 mesh draw consume one leased XMem DWORD through a root SRV. The cache publisher only emits the version 2 proof marker when the DXIL has exactly one raw 32-bit load at byte offset zero from `t0 space0`. The previous cases exercised shifted, dynamic and wide loads. The review identified a gap in coverage for two instructions that each match the allowed load form and use the same SRV handle. This test feeds the verifier a synthetic DXIL dump with one load, then appends the same load with a distinct SSA result. It checks that the first dump returns a four-byte extent and the second is rejected by the load-count guard. Feeding the dump directly preserves both instructions independently of DXC optimization. The no-argument test runs in Linux Python CI, and the existing DXC-backed CTest entry runs both the dump check and the cache publication cases. Refs #1914, #870. ### Validation Tested local commit `a10f5fe8` on Windows with Python 3.12.14 and Windows SDK 10.0.26100.0 DXC. Its Git tree is identical to this PR head. ```powershell python -B tools/run_checks_parallel.py --jobs 3 tests/startup_mesh86_srv_proof_check.py tests/docs_links_check.py tests/bidi_controls_check.py $dxc = 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/dxc.exe' New-Item -ItemType Directory -Force out | Out-Null python -B tests/startup_mesh86_srv_proof_check.py $dxc out git diff --check ``` All three Python checks passed. The DXC-backed check passed the dump assertions, the positive cache publication and the existing refusal cases. The diff check was clean. Replacing the load-count guard in memory with `if False:` made the new test fail with `accepted two DWORD loads from the verified SRV handle`.
upstream-sync closed this pull request 2026-11-25 13:00:47 +00:00
tedin7 commented 2026-11-25 13:00:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:19:19Z.

Review: COMMENTED


Review of head 595113add0780190af2df843d0e5813495cf9342.

No P1, no P2.

What I checked

  • tests/startup_mesh86_srv_proof_check.py: new check_load_count() feeds prove_mesh_root_srv a synthetic dump. One load returns 4. A second identical load with the same handle raises the exact expected one DWORD load from the verified SRV handle error. This matches the guard at tools/startup/mesh86_cache.py:114 (loads != handles).
  • The __main__ block now runs the dump check first and the DXC part only when arguments are given. The CTest entry in CMakeLists.txt:1355 still passes DXC and the work dir, so it runs both.
  • .github/workflows/windows.yml adds the script to the no-argument list. docs/experiments.md documents the command.
  • Scope is tests, CI list and docs only. No product code changed, so no Windows run was needed.

Commands run locally (worktree at the head above)

  • python3 -B tests/startup_mesh86_srv_proof_check.py -> accepted one DWORD load and rejected two loads from the same SRV handle
  • python3 tests/docs_links_check.py -> self-test passed, 18 files, 450 links
  • python3 tests/bidi_controls_check.py -> 1611 files, no bidirectional controls
  • git diff --check origin/main...HEAD -> clean
  • Mutation: changed loads != handles to not loads in tools/startup/mesh86_cache.py. The new test failed with accepted two DWORD loads from the verified SRV handle. Reverted afterwards.

State: mergeable. At review time the Windows and Linux CI jobs were still pending, and the fixture job had passed.

Nit (not blocking): the test only covers two loads with the same handle. A case with a different handle would also be rejected by the same condition, but it is not asserted here.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6057475261 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2322#pullrequestreview-6057475261). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T12:19:19Z. **Review:** COMMENTED --- Review of head `595113add0780190af2df843d0e5813495cf9342`. No P1, no P2. What I checked - `tests/startup_mesh86_srv_proof_check.py`: new `check_load_count()` feeds `prove_mesh_root_srv` a synthetic dump. One load returns 4. A second identical load with the same handle raises the exact `expected one DWORD load from the verified SRV handle` error. This matches the guard at `tools/startup/mesh86_cache.py:114` (`loads != handles`). - The `__main__` block now runs the dump check first and the DXC part only when arguments are given. The CTest entry in `CMakeLists.txt:1355` still passes DXC and the work dir, so it runs both. - `.github/workflows/windows.yml` adds the script to the no-argument list. `docs/experiments.md` documents the command. - Scope is tests, CI list and docs only. No product code changed, so no Windows run was needed. Commands run locally (worktree at the head above) - `python3 -B tests/startup_mesh86_srv_proof_check.py` -> `accepted one DWORD load and rejected two loads from the same SRV handle` - `python3 tests/docs_links_check.py` -> self-test passed, 18 files, 450 links - `python3 tests/bidi_controls_check.py` -> 1611 files, no bidirectional controls - `git diff --check origin/main...HEAD` -> clean - Mutation: changed `loads != handles` to `not loads` in `tools/startup/mesh86_cache.py`. The new test failed with `accepted two DWORD loads from the verified SRV handle`. Reverted afterwards. State: mergeable. At review time the Windows and Linux CI jobs were still pending, and the fixture job had passed. Nit (not blocking): the test only covers two loads with the same handle. A case with a different handle would also be rejected by the same condition, but it is not asserted here. AI-assisted; commands listed were executed locally.
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!2314
No description provided.