Skip to content

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

Open
Filip722 wants to merge 1 commit into
xcl-dev:mainfrom
Filip722:fix/frame-dump-live-rt
Open

Filip722 wants to merge 1 commit into
xcl-dev:mainfrom
Filip722:fix/frame-dump-live-rt

Conversation

@Filip722

Copy link
Copy Markdown

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)
@DavidM1911

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants