d3d12: keep live SRVs intact during resource retirement #2679

Manually merged
github merged 3 commits from gh-pr/2679/head into gh-pr/2679/base 2026-11-27 01:14:10 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-26 01:47 UTC · original
R0Y00:codex/preserve-live-srv-retirement → main · +109 −236 · 4 files · 3 commits · merged 2026-11-26 03:21 UTC

Refs #2379. Corrects the opt-in descriptor rewrite introduced by #2579 and preserves the same-slot rebind behavior covered by #2468.

A live slot-18 view and each tracked descriptor copy hold the resource until explicit overwrite or heap teardown. The normal release path still waits for recording and queue holds. X2W_D3D12_RELEASE_RETIRED_VIEWS=1 now logs that the rewrite is disabled and enables the existing read-only retirement breakdown when base retirement and budgets are enabled.

The Windows Release fixture binds the original and copied descriptors after the last guest Release, including after the release fences and with a gated submission. It verifies nonzero GPU readback, overwrites the descriptors explicitly, checks retirement after discard or queue completion, and checks the recorded copy against its original texels. Coverage includes the legacy setting on and off plus a base-retirement-off control.

  • Windows 11 26200.9974, Microsoft WARP 10.0.26100.9818 and GeForce RTX 4060 Laptop GPU 32.0.16.1656. The fixture runs GPU cases with and without the available debug layer.
  • cmake --build --preset release --target startup_resource_retire_views startup_resource_retire startup_resource_retire_title startup_resource_retire_reasons
  • ctest --preset release --no-tests=error -j 1 -R '^startup_resource_retire(_|$)' -V passed 26/26. No skips.
  • The same new executable against the prior auto-clearing shim refuses the legacy-on WARP arm with “T1 retired before its slot was overwritten.” The candidate passes that arm.
  • python -B tests/docs_links_check.py checked 512 links.

The 20 GiB A/B in #2379 exercised the earlier experiment and remains a memory-pressure measurement. This change covers the checked descriptor and recording lifetimes. Independent code review is welcome.

**@⁠R0Y00** on GitHub · 2026-11-26 01:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2679) `R0Y00:codex/preserve-live-srv-retirement` → `main` · +109 −236 · 4 files · 3 commits · merged 2026-11-26 03:21 UTC Refs #2379. Corrects the opt-in descriptor rewrite introduced by #2579 and preserves the same-slot rebind behavior covered by #2468. A live slot-18 view and each tracked descriptor copy hold the resource until explicit overwrite or heap teardown. The normal release path still waits for recording and queue holds. X2W_D3D12_RELEASE_RETIRED_VIEWS=1 now logs that the rewrite is disabled and enables the existing read-only retirement breakdown when base retirement and budgets are enabled. The Windows Release fixture binds the original and copied descriptors after the last guest Release, including after the release fences and with a gated submission. It verifies nonzero GPU readback, overwrites the descriptors explicitly, checks retirement after discard or queue completion, and checks the recorded copy against its original texels. Coverage includes the legacy setting on and off plus a base-retirement-off control. - Windows 11 26200.9974, Microsoft WARP 10.0.26100.9818 and GeForce RTX 4060 Laptop GPU 32.0.16.1656. The fixture runs GPU cases with and without the available debug layer. - `cmake --build --preset release --target startup_resource_retire_views startup_resource_retire startup_resource_retire_title startup_resource_retire_reasons` - `ctest --preset release --no-tests=error -j 1 -R '^startup_resource_retire(_|$)' -V` passed 26/26. No skips. - The same new executable against the prior auto-clearing shim refuses the legacy-on WARP arm with “T1 retired before its slot was overwritten.” The candidate passes that arm. - `python -B tests/docs_links_check.py` checked 512 links. The 20 GiB A/B in #2379 exercised the earlier experiment and remains a memory-pressure measurement. This change covers the checked descriptor and recording lifetimes. Independent code review is welcome.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:14:07 +00:00
github manually merged commit 3140649ef7 into gh-pr/2679/base 2026-11-27 01:14:10 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-26 02:05 UTC · original

239e727c integrates main through #2649 and resolves the overlap in the retired-view helper. An explicit refused SRV still follows #2649’s null behavior. Retirement leaves a live slot untouched. Windows Release passed 31/31 without skips on WARP and RTX 4060 Laptop, including the resource-retirement, view-dimension, and existing diagnostics cases. Review and CI should use the updated head.

**@⁠R0Y00** on GitHub · 2026-11-26 02:05 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2679#issuecomment-7180451453) `239e727c` integrates main through #2649 and resolves the overlap in the retired-view helper. An explicit refused SRV still follows #2649’s null behavior. Retirement leaves a live slot untouched. Windows Release passed 31/31 without skips on WARP and RTX 4060 Laptop, including the resource-retirement, view-dimension, and existing diagnostics cases. Review and CI should use the updated head.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 03:16 UTC · original · reviewed

Review of head 3140649e (comment only).

What I checked

  • The change removes the opt-in rewrite that replaced live slot-18 descriptors with null SRVs during retirement (retire_null_ready_views, retire_null_srv_desc, retire_views_stuck). Nothing else references them (git grep over src, tests, docs is clean).
  • X2W_D3D12_RELEASE_RETIRED_VIEWS=1 now only logs that it no longer clears descriptors and keeps the read-only budget breakdown. The normal release path and its queue/recording holds are untouched.
  • tests/startup_resource_retire_views.cpp binds the original and copied descriptors after the last release, reads back GPU texels, overwrites explicitly, then checks retirement. CMake covers legacy-on, legacy-off and a base-retirement-off control (startup_resource_retire_views_noretire_*), warp and hardware.
  • This is a correctness fix of descriptor lifetime, with no claim to advance game startup. #2379 stays a measurement issue.
  • Sibling tests startup_resource_retire, _title, _reasons are in the Win2025 selection.

Commands run (Linux)

  • git diff --check origin/main...HEAD: clean
  • python3 tests/docs_links_check.py: 523 links ok
  • python3 tests/bidi_controls_check.py: ok

Win2025 WARP receipt follows separately.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 03:16 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2679#pullrequestreview-6068083903) · **reviewed** Review of head `3140649e` (comment only). **What I checked** - The change removes the opt-in rewrite that replaced live slot-18 descriptors with null SRVs during retirement (`retire_null_ready_views`, `retire_null_srv_desc`, `retire_views_stuck`). Nothing else references them (`git grep` over src, tests, docs is clean). - `X2W_D3D12_RELEASE_RETIRED_VIEWS=1` now only logs that it no longer clears descriptors and keeps the read-only budget breakdown. The normal release path and its queue/recording holds are untouched. - `tests/startup_resource_retire_views.cpp` binds the original and copied descriptors after the last release, reads back GPU texels, overwrites explicitly, then checks retirement. CMake covers legacy-on, legacy-off and a base-retirement-off control (`startup_resource_retire_views_noretire_*`), warp and hardware. - This is a correctness fix of descriptor lifetime, with no claim to advance game startup. #2379 stays a measurement issue. - Sibling tests `startup_resource_retire`, `_title`, `_reasons` are in the Win2025 selection. **Commands run (Linux)** - `git diff --check origin/main...HEAD`: clean - `python3 tests/docs_links_check.py`: 523 links ok - `python3 tests/bidi_controls_check.py`: ok Win2025 WARP receipt follows separately. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 03:21 UTC · original

Win2025 WARP receipt for head 3140649e after updating with main.

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

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_resource_retire_views -- -j 2): 96.67s (configure 4.77s)
    • Test (ctest --preset dev -R 'startup_resource_retire' --parallel 2 --no-tests=error --output-on-failure): 20/26 passed (2.17s: startup_resource_retire_warp_debug1 0.04s, startup_resource_retire_warp_debug0 0.32s, startup_resource_retire_off_warp 0.28s, startup_resource_retire_hardware_debug1 0.04s, startup_resource_retire_hardware_debug0 0.15s, startup_resource_retire_off_hardware 0.13s, startup_resource_retire_reasons_warp 0.26s, startup_resource_retire_reasons_off_warp 0.27s, startup_resource_retire_reasons_no_retire_warp 0.09s, startup_resource_retire_reasons_hardware 0.10s, startup_resource_retire_reasons_off_hardware 0.08s, startup_resource_retire_reasons_no_retire_hardware 0.07s, startup_resource_retire_title_warp_debug1 0.03s, startup_resource_retire_title_off_warp 0.14s, startup_resource_retire_title_warp_debug0 0.25s, startup_resource_retire_title_hardware_debug1 0.04s, startup_resource_retire_title_hardware_debug0 0.13s, startup_resource_retire_title_off_hardware 0.12s, startup_resource_retire_views_warp_debug1 0.04s, startup_resource_retire_views_warp_debug0 0.36s, startup_resource_retire_views_keep_warp 0.28s, startup_resource_retire_views_noretire_warp 0.12s, startup_resource_retire_views_hardware_debug0 0.13s, startup_resource_retire_views_hardware_debug1 0.04s, startup_resource_retire_views_keep_hardware 0.11s, startup_resource_retire_views_noretire_hardware 0.12s); skipped (capability, not a pass): startup_resource_retire_warp_debug1, startup_resource_retire_hardware_debug1, startup_resource_retire_title_warp_debug1, startup_resource_retire_title_hardware_debug1, startup_resource_retire_views_warp_debug1, startup_resource_retire_views_hardware_debug1
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_resource_retire_views -- -j 2): 148.81s (configure 3.93s)
    • Test (ctest --preset release -R 'startup_resource_retire' --parallel 2 --no-tests=error --output-on-failure): 20/26 passed (2.68s: startup_resource_retire_warp_debug1 0.03s, startup_resource_retire_off_warp 0.33s, startup_resource_retire_warp_debug0 0.40s, startup_resource_retire_hardware_debug1 0.04s, startup_resource_retire_hardware_debug0 0.13s, startup_resource_retire_off_hardware 0.14s, startup_resource_retire_reasons_warp 0.29s, startup_resource_retire_reasons_no_retire_warp 0.12s, startup_resource_retire_reasons_off_warp 0.44s, startup_resource_retire_reasons_hardware 0.11s, startup_resource_retire_reasons_off_hardware 0.09s, startup_resource_retire_reasons_no_retire_hardware 0.10s, startup_resource_retire_title_warp_debug1 0.04s, startup_resource_retire_title_off_warp 0.22s, startup_resource_retire_title_warp_debug0 0.35s, startup_resource_retire_title_hardware_debug1 0.04s, startup_resource_retire_title_hardware_debug0 0.18s, startup_resource_retire_title_off_hardware 0.11s, startup_resource_retire_views_warp_debug1 0.04s, startup_resource_retire_views_keep_warp 0.38s, startup_resource_retire_views_warp_debug0 0.44s, startup_resource_retire_views_noretire_warp 0.13s, startup_resource_retire_views_hardware_debug0 0.16s, startup_resource_retire_views_hardware_debug1 0.04s, startup_resource_retire_views_noretire_hardware 0.13s, startup_resource_retire_views_keep_hardware 0.20s); skipped (capability, not a pass): startup_resource_retire_warp_debug1, startup_resource_retire_hardware_debug1, startup_resource_retire_title_warp_debug1, startup_resource_retire_title_hardware_debug1, startup_resource_retire_views_warp_debug1, startup_resource_retire_views_hardware_debug1
  • sccache: 93/136 hits; wall 266.7s

Six debug-layer cases skip (no debug layer on the VM); the other 20 pass in dev and release.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 03:21 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2679#issuecomment-7181639414) Win2025 WARP receipt for head 3140649e after updating with main. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit `3140649ef7128701ca6e8bebf99d007062749ac9`: - **Debug (`--preset dev`)**: - Build (`cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_resource_retire_views -- -j 2`): `96.67s` (configure `4.77s`) - Test (`ctest --preset dev -R 'startup_resource_retire' --parallel 2 --no-tests=error --output-on-failure`): **20/26 passed** (`2.17s`: `startup_resource_retire_warp_debug1` `0.04s`, `startup_resource_retire_warp_debug0` `0.32s`, `startup_resource_retire_off_warp` `0.28s`, `startup_resource_retire_hardware_debug1` `0.04s`, `startup_resource_retire_hardware_debug0` `0.15s`, `startup_resource_retire_off_hardware` `0.13s`, `startup_resource_retire_reasons_warp` `0.26s`, `startup_resource_retire_reasons_off_warp` `0.27s`, `startup_resource_retire_reasons_no_retire_warp` `0.09s`, `startup_resource_retire_reasons_hardware` `0.10s`, `startup_resource_retire_reasons_off_hardware` `0.08s`, `startup_resource_retire_reasons_no_retire_hardware` `0.07s`, `startup_resource_retire_title_warp_debug1` `0.03s`, `startup_resource_retire_title_off_warp` `0.14s`, `startup_resource_retire_title_warp_debug0` `0.25s`, `startup_resource_retire_title_hardware_debug1` `0.04s`, `startup_resource_retire_title_hardware_debug0` `0.13s`, `startup_resource_retire_title_off_hardware` `0.12s`, `startup_resource_retire_views_warp_debug1` `0.04s`, `startup_resource_retire_views_warp_debug0` `0.36s`, `startup_resource_retire_views_keep_warp` `0.28s`, `startup_resource_retire_views_noretire_warp` `0.12s`, `startup_resource_retire_views_hardware_debug0` `0.13s`, `startup_resource_retire_views_hardware_debug1` `0.04s`, `startup_resource_retire_views_keep_hardware` `0.11s`, `startup_resource_retire_views_noretire_hardware` `0.12s`); skipped (capability, not a pass): `startup_resource_retire_warp_debug1`, `startup_resource_retire_hardware_debug1`, `startup_resource_retire_title_warp_debug1`, `startup_resource_retire_title_hardware_debug1`, `startup_resource_retire_views_warp_debug1`, `startup_resource_retire_views_hardware_debug1` - **Release `/O2` (`--preset release`)**: - Build (`cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_resource_retire_views -- -j 2`): `148.81s` (configure `3.93s`) - Test (`ctest --preset release -R 'startup_resource_retire' --parallel 2 --no-tests=error --output-on-failure`): **20/26 passed** (`2.68s`: `startup_resource_retire_warp_debug1` `0.03s`, `startup_resource_retire_off_warp` `0.33s`, `startup_resource_retire_warp_debug0` `0.40s`, `startup_resource_retire_hardware_debug1` `0.04s`, `startup_resource_retire_hardware_debug0` `0.13s`, `startup_resource_retire_off_hardware` `0.14s`, `startup_resource_retire_reasons_warp` `0.29s`, `startup_resource_retire_reasons_no_retire_warp` `0.12s`, `startup_resource_retire_reasons_off_warp` `0.44s`, `startup_resource_retire_reasons_hardware` `0.11s`, `startup_resource_retire_reasons_off_hardware` `0.09s`, `startup_resource_retire_reasons_no_retire_hardware` `0.10s`, `startup_resource_retire_title_warp_debug1` `0.04s`, `startup_resource_retire_title_off_warp` `0.22s`, `startup_resource_retire_title_warp_debug0` `0.35s`, `startup_resource_retire_title_hardware_debug1` `0.04s`, `startup_resource_retire_title_hardware_debug0` `0.18s`, `startup_resource_retire_title_off_hardware` `0.11s`, `startup_resource_retire_views_warp_debug1` `0.04s`, `startup_resource_retire_views_keep_warp` `0.38s`, `startup_resource_retire_views_warp_debug0` `0.44s`, `startup_resource_retire_views_noretire_warp` `0.13s`, `startup_resource_retire_views_hardware_debug0` `0.16s`, `startup_resource_retire_views_hardware_debug1` `0.04s`, `startup_resource_retire_views_noretire_hardware` `0.13s`, `startup_resource_retire_views_keep_hardware` `0.20s`); skipped (capability, not a pass): `startup_resource_retire_warp_debug1`, `startup_resource_retire_hardware_debug1`, `startup_resource_retire_title_warp_debug1`, `startup_resource_retire_title_hardware_debug1`, `startup_resource_retire_views_warp_debug1`, `startup_resource_retire_views_hardware_debug1` - `sccache`: 93/136 hits; wall `266.7s` Six debug-layer cases skip (no debug layer on the VM); the other 20 pass in dev and release. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.