D3D12.X: retain live render targets for frame dumps #1285

Closed
Filip722 wants to merge 1 commit from upstream-pr/1295 into main
Filip722 commented 2026-11-24 14:24:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Filip722 on 2026-11-24T14:24:46Z.


Frame tracing can select an old render-target address after the last RTV descriptor has released that resource. An intermediate readback can then inspect the old address.

What is in it

  • Select the most frequently bound single-sampled target from the live RTV registry and clone its resource reference before unlocking.
  • Clone watched and followed resources while their owning locks are held.
  • Add a synthetic regression for a recently replaced RTV and document the intermediate target selection.

Tested

  • Intel Core 7 240H, RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08), Bazzite 44 Testing, Proton Experimental 11.0-20261112. Windows MSVC release cross-build using Rust 1.98.1.
  • The old selection failed the focused mock regression by choosing the untracked resource. The patched regression passed and checked that the returned target owns a reference. Both resources were still live in the fixture.
  • Two focused frame-dump CPU tests passed under Proton Wine in a namespace without GPU devices.
  • Built the whole workspace via cargo xwin build --locked --release --workspace --target x86_64-pc-windows-msvc. Cross-built the test binaries with cargo xwin test --locked --release --workspace --target x86_64-pc-windows-msvc --no-run and ran each under Proton with --test-threads=4.
  • Main reported 746 passed, 5 failed, and 41 ignored. The patch reported 747 passed, 5 failed, and 41 ignored. Each passing count includes 4 skipped bodies. Two need native wave64, and two need the D3D12 SDK debug layer.
  • Both runs failed the same tests covering Opus voice lifetime, XMA2 voice lifetime, test-title launch, persistent-storage free space, and predication kickoff.

Regression run

Unmodified scripts/smoke.ps1 through the local Proton runner, 25 seconds each. The Wine runs report zero process commit. #1097 tracks that telemetry.

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 5060 Laptop GPU
title: package
seconds: 25
exit: 0x0
frames shown: 442 (PresentX 442)
presents per 2 s (last 3): 55 43 51
device removals: 0
crashes: 0
peak commit: 0 MB
xcl-smoke v1
commit: 177e6e8133a7f743aa36dbd3cc659a6fe4198cf6
gpu: NVIDIA GeForce RTX 5060 Laptop GPU
title: package
seconds: 25
exit: 0x0
frames shown: 408 (PresentX 408)
presents per 2 s (last 3): 30 5 60
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

Native Windows, AMD, and intermediate readback during world rendering. The startup smoke did not enable frame tracing.

AI use

OpenAI Codex with GPT-6.2-Sol high prepared the change and regression, ran the comparisons, and drafted the PR.

<!-- greyfinch-sync:ivall/xcl:issue:5474010051 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1295). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-24T14:24:46Z. --- Frame tracing can select an old render-target address after the last RTV descriptor has released that resource. An intermediate readback can then inspect the old address. **What is in it** - Select the most frequently bound single-sampled target from the live RTV registry and clone its resource reference before unlocking. - Clone watched and followed resources while their owning locks are held. - Add a synthetic regression for a recently replaced RTV and document the intermediate target selection. **Tested** - Intel Core 7 240H, RTX 5060 Laptop GPU (8 GB, NVIDIA 615.78.08), Bazzite 44 Testing, Proton Experimental 11.0-20261112. Windows MSVC release cross-build using Rust 1.98.1. - The old selection failed the focused mock regression by choosing the untracked resource. The patched regression passed and checked that the returned target owns a reference. Both resources were still live in the fixture. - Two focused frame-dump CPU tests passed under Proton Wine in a namespace without GPU devices. - Built the whole workspace via `cargo xwin build --locked --release --workspace --target x86_64-pc-windows-msvc`. Cross-built the test binaries with `cargo xwin test --locked --release --workspace --target x86_64-pc-windows-msvc --no-run` and ran each under Proton with `--test-threads=4`. - Main reported 746 passed, 5 failed, and 41 ignored. The patch reported 747 passed, 5 failed, and 41 ignored. Each passing count includes 4 skipped bodies. Two need native wave64, and two need the D3D12 SDK debug layer. - Both runs failed the same tests covering Opus voice lifetime, XMA2 voice lifetime, test-title launch, persistent-storage free space, and predication kickoff. **Regression run** Unmodified `scripts/smoke.ps1` through the local Proton runner, 25 seconds each. The Wine runs report zero process commit. #1097 tracks that telemetry. ``` xcl-smoke v1 commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56 gpu: NVIDIA GeForce RTX 5060 Laptop GPU title: package seconds: 25 exit: 0x0 frames shown: 442 (PresentX 442) presents per 2 s (last 3): 55 43 51 device removals: 0 crashes: 0 peak commit: 0 MB ``` ``` xcl-smoke v1 commit: 177e6e8133a7f743aa36dbd3cc659a6fe4198cf6 gpu: NVIDIA GeForce RTX 5060 Laptop GPU title: package seconds: 25 exit: 0x0 frames shown: 408 (PresentX 408) presents per 2 s (last 3): 30 5 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` **Not tested** Native Windows, AMD, and intermediate readback during world rendering. The startup smoke did not enable frame tracing. **AI use** OpenAI Codex with GPT-6.2-Sol high prepared the change and regression, ran the comparisons, and drafted the PR.
DavidM1911 commented 2026-11-24 15:05:56 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T14:33:31Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib lib present: 7 passed; new frame_dump test passes, 0 failed.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7134572125 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1295#issuecomment-7134572125). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T14:33:31Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - cargo test -p xcl --lib lib present: 7 passed; new frame_dump test passes, 0 failed. Thanks!
futurepro62 commented 2026-11-24 15:06:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:39:56Z.


Full-suite run on NVIDIA and AMD to go with the subset check above. Tested exact head 177e6e8 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: frame_dump_selects_only_live_rtv_resources.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7134746216 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1295#issuecomment-7134746216). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T14:39:56Z. --- Full-suite run on NVIDIA and AMD to go with the subset check above. Tested exact head `177e6e8` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `frame_dump_selects_only_live_rtv_resources`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-24 16:07:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T16:02:02Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7137011993 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1295#issuecomment-7137011993). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T16:02:02Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib -- --test-threads=1`: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified `main`.) Thanks!
xpatfussy69x commented 2026-11-25 12:06:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T11:56:59Z.


Test report for head 177e6e8 as pushed (not merged onto current main) – NVIDIA, wave32.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests on this adapter: 2 (no wave64)
  • this PR's test frame_dump_selects_only_live_rtv_resources ran and passed
  • no XCL_SAMPLE_* data set (game-data tests not run)

Not tested

  • an actual frame dump from a title (XCL_DUMP_FRAME or similar); AMD / native wave64; release build; the head merged onto current main

AI use

  • Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
<!-- greyfinch-sync:ivall/xcl:comment:7161719659 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1295#issuecomment-7161719659). Originally posted by [xpatfussy69x](https://github.com/xpatfussy69x) on 2026-11-25T11:56:59Z. --- Test report for head `177e6e8` as pushed (not merged onto current `main`) – NVIDIA, wave32. **Tested** - NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5 - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 752 passed, 0 failed, 41 ignored - SKIPPED GPU tests on this adapter: 2 (no wave64) - this PR's test `frame_dump_selects_only_live_rtv_resources` ran and passed - no `XCL_SAMPLE_*` data set (game-data tests not run) **Not tested** - an actual frame dump from a title (`XCL_DUMP_FRAME` or similar); AMD / native wave64; release build; the head merged onto current `main` **AI use** - Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
github-actions[bot] commented 2026-11-29 07:42:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:42:11Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252637029 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1295#issuecomment-7252637029). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:42:11Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 05:21:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:21:30Z.


Triage (#1607) – head 177e6e8

Main already has this fix: commit 960ed8b3 ("D3D12.X: the frame trace takes a render target only while a view holds it") changed busiest_rt to return an ID3D12Resource only when RTVS still names it (view_resource). That covers the watched target and the FOLLOWED ones too, which this PR still turns into resources from raw addresses.
The PR conflicts with main.
Recommendation: close (superseded by main commit 960ed8b).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301686334 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1295#issuecomment-7301686334). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:21:30Z. --- **Triage (#1607)** – head 177e6e8 Main already has this fix: commit 960ed8b3 ("D3D12.X: the frame trace takes a render target only while a view holds it") changed `busiest_rt` to return an `ID3D12Resource` only when `RTVS` still names it (`view_resource`). That covers the watched target and the `FOLLOWED` ones too, which this PR still turns into resources from raw addresses. The PR conflicts with main. Recommendation: close (superseded by main commit 960ed8b). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:44:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:44:22Z.


Closing as superseded: this change is already on main (960ed8b3). main 960ed8b3 busiest_rt returns a held ID3D12Resource only while an RTV names it (view_resource), followed targets use the same check; same fix as the PR (frame dump of dead RT); README sentence only remainder

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311575378 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1295#issuecomment-7311575378). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:44:22Z. --- Closing as superseded: this change is already on `main` (960ed8b3). main 960ed8b3 busiest_rt returns a held ID3D12Resource only while an RTV names it (view_resource), followed targets use the same check; same fix as the PR (frame dump of dead RT); README sentence only remainder Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

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
xcl-dev/xcl!1285
No description provided.