GPU: revalidate bound depth state through the list tracker #3572

Closed
github-bot wants to merge 1 commit from github-bot/gh-3572 into main AGit
Owner

@⁠spk-c on GitHub · 2026-11-30 01:16 UTC · original
spk-c:fix/revalidate-bound-depth-state → main · +5 −10 · 1 files · 1 commits · closed without merging

What it changes

The draw-local last_depth_state cache can be stale when a shader view, copy or internal pass changes the same host texture without changing the bound DSV. Revalidate through the command list's existing state tracker before each depth draw. The tracker already emits no transition when the state is unchanged.

This is an alternative to #3041, not intended to be merged on top of it. Unlike its twin-only epoch key, this also revalidates textures without a colour twin. Related investigation: #3354. This does not fix the RT device removal.

How it was tested

  • RTX 4090 24 GB, Ryzen 9 9950X3D, 64 GB RAM, driver 621.40, Series S (1280x720 depth target in logs), DLSS Quality, FG off, VICTORY_LOW_EARLY_MB=0, D3D12 debug and full DRED, warmed cache.
  • A/B on fbe3dc20 with identical local diagnostics changes on both sides; the only additional source change was this patch. RT off: 120 seconds of world time each.
RT off Before After
Depth-read state messages 144,068 0
All state messages (ID 538) 175,138 38,149
Mean rendered FPS 16.0 18.3

Different draw counts and debug overhead prevent treating the FPS difference as a general performance gain. Copy-source and root-SRV state errors remain. RT-on runs still encounter 0x887A0005; depth-read messages fell from 8,601 to zero before the crash.

  • Diagnostic build compiled; three of eight depth-filtered tests passed, one ignored, four blocked by the local Windows 10 test executable using SM 6.5 instead of the Agility SDK. A test-only runtime selection attempt also failed. Full cargo test passed: no. No shader changes.
  • The branch contains only the patch in draw.rs and is based on current upstream 41adb551. git diff --check passes. The runtime figures above are from the earlier controlled worktree, not a fresh run of this exact branch. Draft pending clean-head validation.

Checked for overlap

  • Searched open pull requests for the issue and the touched file. Related: #3041 (overlapping alternative), #2770 (depth write classification), #3487 (texture-state sanitisation), #3488 (command-list validation).
**@⁠spk-c** on GitHub · 2026-11-30 01:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3572) `spk-c:fix/revalidate-bound-depth-state` → `main` · +5 −10 · 1 files · 1 commits · closed without merging ## What it changes The draw-local `last_depth_state` cache can be stale when a shader view, copy or internal pass changes the same host texture without changing the bound DSV. Revalidate through the command list's existing state tracker before each depth draw. The tracker already emits no transition when the state is unchanged. This is an alternative to #3041, not intended to be merged on top of it. Unlike its twin-only epoch key, this also revalidates textures without a colour twin. Related investigation: #3354. This does **not** fix the RT device removal. ## How it was tested - RTX 4090 24 GB, Ryzen 9 9950X3D, 64 GB RAM, driver 621.40, Series S (1280x720 depth target in logs), DLSS Quality, FG off, `VICTORY_LOW_EARLY_MB=0`, D3D12 debug and full DRED, warmed cache. - A/B on `fbe3dc20` with identical local diagnostics changes on both sides; the only additional source change was this patch. RT off: 120 seconds of world time each. | RT off | Before | After | |---|---:|---:| | Depth-read state messages | 144,068 | 0 | | All state messages (ID 538) | 175,138 | 38,149 | | Mean rendered FPS | 16.0 | 18.3 | Different draw counts and debug overhead prevent treating the FPS difference as a general performance gain. Copy-source and root-SRV state errors remain. RT-on runs still encounter `0x887A0005`; depth-read messages fell from 8,601 to zero before the crash. - Diagnostic build compiled; three of eight depth-filtered tests passed, one ignored, four blocked by the local Windows 10 test executable using SM 6.5 instead of the Agility SDK. A test-only runtime selection attempt also failed. Full `cargo test` passed: **no**. No shader changes. - The branch contains only the patch in `draw.rs` and is based on current upstream `41adb551`. `git diff --check` passes. The runtime figures above are from the earlier controlled worktree, not a fresh run of this exact branch. Draft pending clean-head validation. ## Checked for overlap - [x] Searched open pull requests for the issue and the touched file. Related: #3041 (overlapping alternative), #2770 (depth write classification), #3487 (texture-state sanitisation), #3488 (command-list validation).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 01:20:05 +00:00
Author
Owner

@⁠spk-c on GitHub · 2026-11-30 09:45 UTC · original

Follow-up: exact PR head 47f4465b was built and run on my RTX 4090.

The RT-off run actually reached the world and continued for over 14 minutes without device removal. The original bench parser missed the newer frame-log wording (dropped ... draws or dispatches), so I corrected my local harness and reprocessed the first 120 seconds of the saved log. World detected after 36 s; 24 frame lines, mean 16.5 rendered FPS, median 16.8, 1% low 9.7. Across the entire RT-off log there were zero depth-read state errors, despite 267,431 other ID 538 messages (105,720 copy-source and 155,135 root-SRV messages among them). The RT-on run also had zero depth-read errors, but device removal still occurred within roughly 9 s of the first world frame line. The crash left no useful DRED breadcrumbs.

This confirms the depth-state fix on the actual PR commit, not just the earlier dirty test build. It does not demonstrate a general FPS improvement or fix the RT crash. The failed unit-test runtime setup and incomplete full CI validation remain caveats.

I also fixed a local log-sharing issue in the benchmark harness and started independent comparisons for narrow place barriers, in-place copies, relay, texture pool and buffer pool. The pool diagnostic uses inferred texture descriptor addresses and a copy footprint, so its warnings alone are not proof of actual GPU out-of-bounds access. No game assets or raw logs are included in this PR.

**@⁠spk-c** on GitHub · 2026-11-30 09:45 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3572#issuecomment-7274638877) Follow-up: exact PR head `47f4465b` was built and run on my RTX 4090. The RT-off run actually reached the world and continued for over 14 minutes without device removal. The original bench parser missed the newer frame-log wording (`dropped ... draws or dispatches`), so I corrected my local harness and reprocessed the first 120 seconds of the saved log. World detected after 36 s; 24 frame lines, mean 16.5 rendered FPS, median 16.8, 1% low 9.7. Across the entire RT-off log there were **zero depth-read state errors**, despite 267,431 other ID 538 messages (105,720 copy-source and 155,135 root-SRV messages among them). The RT-on run also had zero depth-read errors, but device removal still occurred within roughly 9 s of the first world frame line. The crash left no useful DRED breadcrumbs. This confirms the depth-state fix on the actual PR commit, not just the earlier dirty test build. It does not demonstrate a general FPS improvement or fix the RT crash. The failed unit-test runtime setup and incomplete full CI validation remain caveats. I also fixed a local log-sharing issue in the benchmark harness and started independent comparisons for narrow place barriers, in-place copies, relay, texture pool and buffer pool. The pool diagnostic uses inferred texture descriptor addresses and a copy footprint, so its warnings alone are not proof of actual GPU out-of-bounds access. No game assets or raw logs are included in this PR.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:51 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3572#issuecomment-7321670567) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
github-bot closed this pull request 2026-12-01 18:58:19 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3572
No description provided.