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

Open
github-bot wants to merge 1 commit from github-bot/gh-1295 into main AGit
Owner

@⁠Filip722 on GitHub · 2026-11-24 14:24 UTC · original
Filip722:fix/frame-dump-live-rt → main · +98 −12 · 2 files · 1 commits · open

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.

**@⁠Filip722** on GitHub · 2026-11-24 14:24 UTC · [original](https://github.com/xcl-dev/xcl/pull/1295) `Filip722:fix/frame-dump-live-rt` → `main` · +98 −12 · 2 files · 1 commits · open 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.
Historical render-target counts can outlive their RTV references. Select a target only while an RTV still owns it and clone the reference before releasing the lock. The synthetic regression selects the untracked address with the old scan and passes with the live selection.

Assisted-by: OpenAI Codex (GPT-6.2-Sol high)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:49:51 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 14:33 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-24 14:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/1295#issuecomment-7134572125) 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!
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-24 14:39 UTC · original

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.
**@⁠futurepro62** on GitHub · 2026-11-24 14:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/1295#issuecomment-7134746216) 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.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 16:02 UTC · original

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!

**@⁠DavidM1911** on GitHub · 2026-11-24 16:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1295#issuecomment-7137011993) 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!
Author
Owner

@⁠xpatfussy69x on GitHub · 2026-11-25 11:56 UTC · original

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.
**@⁠xpatfussy69x** on GitHub · 2026-11-25 11:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/1295#issuecomment-7161719659) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1295/head:github-bot/gh-1295'
git switch 'github-bot/gh-1295'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1295'
git switch 'github-bot/gh-1295'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1295'
git switch 'github-bot/gh-1295'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1295'
git switch 'main'
git merge --squash 'github-bot/gh-1295'
git switch 'main'
git merge --ff-only 'github-bot/gh-1295'
git switch 'main'
git merge 'github-bot/gh-1295'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.