Fix descriptor heap lifetime and identity tracking #179

Closed
github-bot wants to merge 0 commits from github-bot/gh-179 into main AGit
Owner

@⁠nativ69 on GitHub · 2026-11-30 20:15 UTC · original
nativ69:fix/descriptor-heap-lifetime → main · +0 −64 · 1 files · 52 commits · closed without merging

Summary

  • Retain descriptor heaps and their backing resources through command-list execution and retirement.
  • Prevent stale descriptor writes, texture flips and cache reuse after heap address recycling.
  • Correct registry lock ordering across descriptor mirroring paths.
  • Preserve descriptor batching, split-sender behavior and dynamic slot retirement.
  • Clean up heap-scoped flip state and GPU-range diagnostics.

Adapted from edsuuu/VI-BR-PORT#48, specifically the correctness changes in 567a081 and 1b83f60.

The Weak::upgrade optimization is intentionally excluded pending profiling.

Validation

  • 14 targeted regression tests passed.
  • GPU readback verifies exact split-sender descriptor contents.
  • Fence-gated submission verifies descriptor-backed resource retention until reset.
  • Targeted Clippy and git diff --check passed.

Existing formatting drift and unrelated Clippy warnings remain unchanged.

Gameplay performance has not been evaluated.

**@⁠nativ69** on GitHub · 2026-11-30 20:15 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/179) `nativ69:fix/descriptor-heap-lifetime` → `main` · +0 −64 · 1 files · 52 commits · closed without merging ## Summary - Retain descriptor heaps and their backing resources through command-list execution and retirement. - Prevent stale descriptor writes, texture flips and cache reuse after heap address recycling. - Correct registry lock ordering across descriptor mirroring paths. - Preserve descriptor batching, split-sender behavior and dynamic slot retirement. - Clean up heap-scoped flip state and GPU-range diagnostics. Adapted from edsuuu/VI-BR-PORT#48, specifically the correctness changes in `567a081` and `1b83f60`. The `Weak::upgrade` optimization is intentionally excluded pending profiling. ## Validation - 14 targeted regression tests passed. - GPU readback verifies exact split-sender descriptor contents. - Fence-gated submission verifies descriptor-backed resource retention until reset. - Targeted Clippy and `git diff --check` passed. Existing formatting drift and unrelated Clippy warnings remain unchanged. Gameplay performance has not been evaluated.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 20:20:08 +00:00
Author
Owner

@⁠mgrein on GitHub · 2026-11-30 23:30 UTC · original

I tried this PR in game (a new retail game, open world, idle camera) and hit long stalls with it, so I'm reporting the numbers in case they help.

Setup: RTX 4070 12 GB, Ryzen 5 5600X, 32 GB RAM, Windows 11. Series X profile at 1440p, DLSS Quality, no frame generation, with VICTORY_SUBMIT_SPLIT=1, VICTORY_ASK_FIRST=1 and VICTORY_OFF_LINE=1. The base was main plus a few of my own open PRs (#83, #89, #93, #109, #116, #138, #182). Each run is 7.5 minutes; the log has one frame-times line a second.

build frame median lines with frames over 200 ms
base 44.6 ms 0
base + #179 + #125 + #108 + #201 48.0 ms 69 (one stretch of ~75 s, frames 470–570 ms)
base + #125 + #108 + #201 (no #179) 47.0 ms 10

During the stretch:

  • the list threads' translating (VICTORY_THIN line) went to 630–690 ms a frame summed over the threads, against ~150–250 ms otherwise;
  • the card was idle ~84 % of the frame, almost all of it "while the title had not submitted".

So translation itself slowed down roughly 3×, not the submitting side.

I haven't profiled where inside translation the time goes. Retaining heaps and resources through execution, or the new lock ordering in the mirroring paths, would be my first guesses, given that the stall shows up as list-thread time. The PR merged cleanly and cargo test -p victory-gpu --lib passed (495 tests); no device removal or errors were logged, only the slowdown.

🤖 Generated with Claude Code

**@⁠mgrein** on GitHub · 2026-11-30 23:30 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/179#issuecomment-7295206319) I tried this PR in game (a new retail game, open world, idle camera) and hit long stalls with it, so I'm reporting the numbers in case they help. **Setup:** RTX 4070 12 GB, Ryzen 5 5600X, 32 GB RAM, Windows 11. Series X profile at 1440p, DLSS Quality, no frame generation, with `VICTORY_SUBMIT_SPLIT=1`, `VICTORY_ASK_FIRST=1` and `VICTORY_OFF_LINE=1`. The base was main plus a few of my own open PRs (#83, #89, #93, #109, #116, #138, #182). Each run is 7.5 minutes; the log has one frame-times line a second. | build | frame median | lines with frames over 200 ms | |---|---|---| | base | 44.6 ms | 0 | | base + #179 + #125 + #108 + #201 | 48.0 ms | **69** (one stretch of ~75 s, frames 470–570 ms) | | base + #125 + #108 + #201 (no #179) | 47.0 ms | 10 | During the stretch: - the list threads' translating (`VICTORY_THIN` line) went to 630–690 ms a frame summed over the threads, against ~150–250 ms otherwise; - the card was idle ~84 % of the frame, almost all of it "while the title had not submitted". So translation itself slowed down roughly 3×, not the submitting side. I haven't profiled where inside translation the time goes. Retaining heaps and resources through execution, or the new lock ordering in the mirroring paths, would be my first guesses, given that the stall shows up as list-thread time. The PR merged cleanly and `cargo test -p victory-gpu --lib` passed (495 tests); no device removal or errors were logged, only the slowdown. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-bot closed this pull request 2026-12-01 01:10:22 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:34 UTC · original

Thank you. Stale descriptor writes after a heap's address is used again are a real class of fault, and the regression tests are welcome.

Closing in this form for three reasons:

  • it fails the lint gate (constant_slot and constant_slots are never used, an unneeded return, an if that can be collapsed);
  • it adds reference counting and map lookups to the per-draw descriptor path and, as the description says, frame time was not measured;
  • it is 1,200 lines in one step.

What would let us take it: lint clean on the current main, frame times before and after at one place (the 5-second fps line is enough), and if possible the lifetime fix (heaps and their resources kept through execution) split from the identity and cache-key changes.

Main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), so a follow-up has to start from the current main, or this branch be rebased onto it.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:34 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/179#issuecomment-7297662444) Thank you. Stale descriptor writes after a heap's address is used again are a real class of fault, and the regression tests are welcome. Closing in this form for three reasons: - it fails the lint gate (`constant_slot` and `constant_slots` are never used, an unneeded `return`, an `if` that can be collapsed); - it adds reference counting and map lookups to the per-draw descriptor path and, as the description says, frame time was not measured; - it is 1,200 lines in one step. What would let us take it: lint clean on the current main, frame times before and after at one place (the 5-second fps line is enough), and if possible the lifetime fix (heaps and their resources kept through execution) split from the identity and cache-key changes. Main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), so a follow-up has to start from the current main, or this branch be rebased onto it.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.