tests: cover paired XMem refusals and lease retirement #2367

Merged
sydney-0o merged 3 commits from upstream-pr/2375 into main 2026-11-25 18:37:24 +00:00
sydney-0o commented 2026-11-25 14:15:16 +00:00 (Migrated from github.com)

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


Refs #870, #1759, and #1914. Follow-up to the paired slot-86 mesh path merged in #2377, as requested in the maintainer's review.

The ordered cached-mesh fixture now checks three additional cases.

  • Submit the SRV writer while its gate is closed and keep the recorded argument writer unsubmitted. The DIRECT consumer completes with a clear target while the SRV writer remains gated.
  • Remap the root SRV page after recording and before submission while preserving the argument mapping. The target stays clear. Restoring the original mapping restores all eight red pixels.
  • Hold a submitted DIRECT consumer behind a gate and unmap both guest pages. Neither physical page is reusable while the consumer is pending. The consumer still paints all eight red pixels. Both original pages become reusable after its fence.

The ordered WARP fixture is selected by the Windows PR smoke preset.

Validation on current main

Local Release commit cd9041f7, based on 7092683a, has the same tree as this PR head. Windows 10 build 19045.6456, app-local WARP 1.0.22.0 and Agility SDK 1.620.2 with the D3D12 debug layer enabled. The GTX 1080 Ti (32.0.15.8278) reported capability skips for mesh tests.

$warp and $agility point to the x64 runtime directories. $python and $dxc point to the test interpreter and the Windows SDK 10.0.26100.0 DXC.

.\tools\dev.ps1
cmake --preset release -B out/build/mesh-agility "-DOFFSCREEN_WARP_DIR=$warp" "-DOFFSCREEN_AGILITY_620_DIR=$agility" "-DINTAKE_PYTHON=$python" "-DDXC_EXECUTABLE=$dxc"
cmake --build out/build/mesh-agility --target startup_indirect_draw_indexed xmem_shim --parallel 4
ctest --test-dir out/build/mesh-agility --no-tests=error -j1 -R '^(startup_mesh86_srv_proof|startup_indirect_(mesh_(xmem_arguments.*|lease_.*)|translated_refusal_census_.*))$' --output-on-failure
ctest --test-dir out/build/mesh-agility --no-tests=error -j1 -R '^startup_indirect_mesh_lease_warp_dual$' --repeat until-fail:5 -V

12 passed, 0 failed, 8 capability skips. The updated WARP test passed five consecutive runs with zero D3D12 debug warnings or errors. The Python mesh86 proof, docs link check, bidi check, and git diff --check passed.

Original validation

The original head ddac900 remains in the branch history. Its Windows CI run passed. The maintainer independently ran all six paired cases on WARP and RTX 4060 Laptop, confirming both remap refusals and the retirement of both pages after the DIRECT fence.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6606509474 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2375). Originally posted by [sydney-0o](https://github.com/sydney-0o) on 2026-11-25T14:15:16Z. --- Refs #870, #1759, and #1914. Follow-up to the paired slot-86 mesh path merged in #2377, as requested in [the maintainer's review](https://github.com/R0Y00/Xbox2Windows/pull/2375#issuecomment-7165848297). The ordered cached-mesh fixture now checks three additional cases. - Submit the SRV writer while its gate is closed and keep the recorded argument writer unsubmitted. The DIRECT consumer completes with a clear target while the SRV writer remains gated. - Remap the root SRV page after recording and before submission while preserving the argument mapping. The target stays clear. Restoring the original mapping restores all eight red pixels. - Hold a submitted DIRECT consumer behind a gate and unmap both guest pages. Neither physical page is reusable while the consumer is pending. The consumer still paints all eight red pixels. Both original pages become reusable after its fence. The ordered WARP fixture is selected by the Windows PR smoke preset. ### Validation on current main Local Release commit `cd9041f7`, based on `7092683a`, has the same tree as this PR head. Windows 10 build 19045.6456, app-local WARP 1.0.22.0 and Agility SDK 1.620.2 with the D3D12 debug layer enabled. The GTX 1080 Ti (32.0.15.8278) reported capability skips for mesh tests. `$warp` and `$agility` point to the x64 runtime directories. `$python` and `$dxc` point to the test interpreter and the Windows SDK 10.0.26100.0 DXC. ```powershell .\tools\dev.ps1 cmake --preset release -B out/build/mesh-agility "-DOFFSCREEN_WARP_DIR=$warp" "-DOFFSCREEN_AGILITY_620_DIR=$agility" "-DINTAKE_PYTHON=$python" "-DDXC_EXECUTABLE=$dxc" cmake --build out/build/mesh-agility --target startup_indirect_draw_indexed xmem_shim --parallel 4 ctest --test-dir out/build/mesh-agility --no-tests=error -j1 -R '^(startup_mesh86_srv_proof|startup_indirect_(mesh_(xmem_arguments.*|lease_.*)|translated_refusal_census_.*))$' --output-on-failure ctest --test-dir out/build/mesh-agility --no-tests=error -j1 -R '^startup_indirect_mesh_lease_warp_dual$' --repeat until-fail:5 -V ``` 12 passed, 0 failed, 8 capability skips. The updated WARP test passed five consecutive runs with zero D3D12 debug warnings or errors. The Python mesh86 proof, docs link check, bidi check, and `git diff --check` passed. ### Original validation The original head `ddac900` remains in the branch history. Its [Windows CI run](https://github.com/R0Y00/Xbox2Windows/actions/runs/45632057359) passed. The maintainer independently ran all six paired cases on WARP and RTX 4060 Laptop, confirming both remap refusals and the retirement of both pages after the DIRECT fence.
R0Y00 commented 2026-11-25 15:02:01 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T14:48:35Z.


I independently ran the six paired mesh cases on WARP and RTX 4060 Laptop. Both backends saw the separate root and argument remap refusals and both pages became reusable after the DIRECT fence. The overlapping production path landed in #2377 (afd02a24), including the initializer-only GPU argument control. Please keep your root-page remap, unsubmitted argument writer and post-submit unmap of both ranges as a focused fixture follow-up to that baseline. Keeping them on your branch preserves authorship and the original Windows evidence.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7165848297 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2375#issuecomment-7165848297). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T14:48:35Z. --- I independently ran the six paired mesh cases on WARP and RTX 4060 Laptop. Both backends saw the separate root and argument remap refusals and both pages became reusable after the DIRECT fence. The overlapping production path landed in #2377 (`afd02a24`), including the initializer-only GPU argument control. Please keep your root-page remap, unsubmitted argument writer and post-submit unmap of both ranges as a focused fixture follow-up to that baseline. Keeping them on your branch preserves authorship and the original Windows evidence.
upstream-sync changed title from [PR #2375] gpu: wait for both leased XMem ranges in cached mesh dispatches to [PR #2375] tests: cover paired XMem refusals and lease retirement 2026-11-25 16:05:10 +00:00
tedin7 commented 2026-11-25 17:01:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:20:38Z.

Review: COMMENTED


Review of head 8d9df11b (tests: tests/startup_indirect_mesh_lease.inl, CMakePresets.json, docs/experiments.md).

What I checked:

  • This is the focused fixture follow-up the maintainer asked for after #2377. It extends the existing dual mode of check_mesh_dual_xmem and does not touch production code.
  • New cases are real D3D12 WARP readbacks: (1) the recorded but unsubmitted argument writer is refused while the SRV writer's gate stays closed (fence value still 0); (2) remapping the root SRV page and the argument page, one at a time, leaves the target clear, and restoring the mapping gives all red again; (3) with a gated DIRECT consumer, unmapping both guest pages leaves neither physical page reusable until the fence, and both become reusable after it.
  • The control modes (dual-skip-srv, dual-skip-argument, dual-init-only) keep their previous path because the new code only runs for ordered_case.
  • The CMakePresets.json change only adds startup_indirect_mesh_lease_warp_dual to the PR smoke filter. That name matches the test registered in CMakeLists.txt (startup_indirect_mesh_lease_${backend}_${mode}).
  • No open or merged PR duplicates this slice (searched XMem refusal and lease; #2280, #2332 and #2322 are the production and SRV-count work it builds on).

No blocking findings. Next: update with main, CI, Win2025 WARP dev+release.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6061043656 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2375#pullrequestreview-6061043656). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:20:38Z. **Review:** COMMENTED --- Review of head 8d9df11b (tests: `tests/startup_indirect_mesh_lease.inl`, `CMakePresets.json`, `docs/experiments.md`). What I checked: - This is the focused fixture follow-up the maintainer asked for after #2377. It extends the existing `dual` mode of `check_mesh_dual_xmem` and does not touch production code. - New cases are real D3D12 WARP readbacks: (1) the recorded but unsubmitted argument writer is refused while the SRV writer's gate stays closed (fence value still 0); (2) remapping the root SRV page and the argument page, one at a time, leaves the target clear, and restoring the mapping gives all red again; (3) with a gated DIRECT consumer, unmapping both guest pages leaves neither physical page reusable until the fence, and both become reusable after it. - The control modes (`dual-skip-srv`, `dual-skip-argument`, `dual-init-only`) keep their previous path because the new code only runs for `ordered_case`. - The `CMakePresets.json` change only adds `startup_indirect_mesh_lease_warp_dual` to the PR smoke filter. That name matches the test registered in `CMakeLists.txt` (`startup_indirect_mesh_lease_${backend}_${mode}`). - No open or merged PR duplicates this slice (searched XMem refusal and lease; #2280, #2332 and #2322 are the production and SRV-count work it builds on). No blocking findings. Next: update with main, CI, Win2025 WARP dev+release. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 17:01:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T16:21:16Z.


Win2025 WARP receipt for head 8d9df11b after updating with main.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 8d9df11bb570bc0d26aca7a86393e71b77229de4:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target startup_indirect_draw_indexed -- -j 2): 5.80s (configure 2.63s)
    • Test (ctest --preset dev -R 'startup_indirect_mesh_lease_warp' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (1.81s: startup_indirect_mesh_lease_warp_ordered_control 1.01s, startup_indirect_mesh_lease_warp_dual-skip-srv 1.03s, startup_indirect_mesh_lease_warp_dual-init-only 1.13s, startup_indirect_mesh_lease_warp_dual 1.21s, startup_indirect_mesh_lease_warp_skip-wait 0.56s, startup_indirect_mesh_lease_warp_dual-skip-argument 0.61s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target startup_indirect_draw_indexed -- -j 2): 8.79s (configure 2.04s)
    • Test (ctest --preset release -R 'startup_indirect_mesh_lease_warp' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (1.40s: startup_indirect_mesh_lease_warp_ordered_control 0.71s, startup_indirect_mesh_lease_warp_dual-skip-argument 0.72s, startup_indirect_mesh_lease_warp_dual-init-only 0.79s, startup_indirect_mesh_lease_warp_dual 0.87s, startup_indirect_mesh_lease_warp_skip-wait 0.51s, startup_indirect_mesh_lease_warp_dual-skip-srv 0.56s)
  • sccache: 0/11 hits; wall 31.3s

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7167831788 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2375#issuecomment-7167831788). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T16:21:16Z. --- Win2025 WARP receipt for head 8d9df11b after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `8d9df11bb570bc0d26aca7a86393e71b77229de4`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target startup_indirect_draw_indexed -- -j 2`): `5.80s` (configure `2.63s`) - Test (`ctest --preset dev -R 'startup_indirect_mesh_lease_warp' --parallel 4 --no-tests=error --output-on-failure`): **6/6 passed** (`1.81s`: `startup_indirect_mesh_lease_warp_ordered_control` `1.01s`, `startup_indirect_mesh_lease_warp_dual-skip-srv` `1.03s`, `startup_indirect_mesh_lease_warp_dual-init-only` `1.13s`, `startup_indirect_mesh_lease_warp_dual` `1.21s`, `startup_indirect_mesh_lease_warp_skip-wait` `0.56s`, `startup_indirect_mesh_lease_warp_dual-skip-argument` `0.61s`) - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target startup_indirect_draw_indexed -- -j 2`): `8.79s` (configure `2.04s`) - Test (`ctest --preset release -R 'startup_indirect_mesh_lease_warp' --parallel 4 --no-tests=error --output-on-failure`): **6/6 passed** (`1.40s`: `startup_indirect_mesh_lease_warp_ordered_control` `0.71s`, `startup_indirect_mesh_lease_warp_dual-skip-argument` `0.72s`, `startup_indirect_mesh_lease_warp_dual-init-only` `0.79s`, `startup_indirect_mesh_lease_warp_dual` `0.87s`, `startup_indirect_mesh_lease_warp_skip-wait` `0.51s`, `startup_indirect_mesh_lease_warp_dual-skip-srv` `0.56s`) - `sccache`: 0/11 hits; wall `31.3s` AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 19:03:33 +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!2367
No description provided.