shader: test the mesh86 root SRV load count #2322

Manually merged
github merged 1 commit from gh-pr/2322/head into gh-pr/2322/base 2026-11-27 00:15:58 +00:00
Owner

@⁠sydney-0o on GitHub · 2026-11-25 12:16 UTC · original
sydney-0o:codex/mesh86-srv-load-count → main · +32 −2 · 3 files · 1 commits · merged 2026-11-25 12:21 UTC

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.

**@⁠sydney-0o** on GitHub · 2026-11-25 12:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2322) `sydney-0o:codex/mesh86-srv-load-count` → `main` · +32 −2 · 3 files · 1 commits · merged 2026-11-25 12:21 UTC Follow-up to merged PR #2303 and [tedin7's review finding](https://git.gtahub.st/github/R0Y00--Xbox2Windows/pulls/2303). #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`.
Cover the same-handle duplicate-load case identified in review of R0Y00/Xbox2Windows#2303.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:15:56 +00:00
github manually merged commit 595113add0 into gh-pr/2322/base 2026-11-27 00:15:58 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 12:19 UTC · original · reviewed

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.

**@⁠tedin7** on GitHub · 2026-11-25 12:19 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2322#pullrequestreview-6057475261) · **reviewed** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.