Repository navigation
Conversation
A host resource whose last CPU reference went away was released immediately,
while GPU work that may still read it could be queued. Two paths did that:
* HostHeap::keep assigned the slot's new resource over the old one, dropping
the previous ID3D12Resource during recording (make_at, make_null, mirror,
constant_at all go through it).
* shadow::unregister dropped a released title buffer's copy. Its comment
claimed "lists that still hold its copy keep it alive", but Deferred holds
texture ids and named host objects, never an Arc<Shadow>: a list reads a
copy by binding it, and an execute-indirect draw takes its arguments from
memory a shader wrote, so no list can name what it will read.
The console reads stale memory where the host page-faults, so on the host the
result is a removed device: "page fault at 0x...; inside freed [...]" with the
stopped command an ExecuteIndirect mesh list, as in Marvisak#557 and Marvisak#304.
Both paths now hand the resource to a queue drained by Host::execute once the
fence's event has been waited for, which is the only point where a resource is
provably past use. Nothing is released earlier than before, so this cannot
break a read; it only defers the free.
Tested with `cargo test -p victory-gpu`: 43 passed, 0 failed, 1 ignored. No
device is involved in those tests, and no title was run, so this is not
evidence that Marvisak#557 is fixed — it removes two frees that cannot be justified,
and the fault may still have another source.
AI-assisted (OpenCode).
|
Tested this branch (head So the merge looks right on its own merits (the two free paths are real; independent DRED naming agrees), but the world-entry fault survives it here, as predicted on #557 — the only build that ever avoided the signature was the never-free cap run (451 s, fault-free, to end credits): table and discussion in #557 (comment) . Current suspect on this rig: VA recycling after AI-assisted (Hermes Agent). |
|
Thanks for running it — that result is the one that decides how this PR should be read, and it argues against my premise rather than for it. If every submission is waited for ( That also makes your VA-recycling suspect the more interesting one: if the fault address is inside a freed texture whose object lifetime is already correct, the reuse of the VA range by a later allocation is what turns a stale reference into a fault, and no retention window or drain point can prevent it — which is exactly what the fence/retention table on #557 shows. Tracking list-lifetime (or never reusing a VA) would bound it; delaying release does not. Where that leaves this PR: reviewed as resource-lifetime hygiene, not as a fix for #557. The body already says the tests are no evidence about the title, but your run is the first measurement that contradicts the "freed while in flight" reading, so it belongs in the thread. If #609's retirement queue lands, this branch's contents are mostly subsumed by it — I would rather that be said than have both merged blind. Nothing to retest on my side until it changes; if you push another revision, I can rebuild and run AI-assisted. |
|
Test report from an RX 9070 XT (RDNA4), Ryzen 7 5700X3D, driver 32.0.32029.2010 (Adrenalin 26.11.2), Windows 11 build 26300. This PR merged locally (no conflicts, 50
So on What I measured on
Two things follow for this PR, as far as single runs can show:
Whatever is kept, every run that survives the freed-texture fault ends at the same place: a The diagnostic switches are local only and not part of any PR. No game data here: hashes, addresses, sizes and timings from VIctory's own log. AI-assisted (Claude Fable 5.2): runs launched and logs summarised by the model on my machine; times and DRED lines taken from the logs. |
|
Three data points from my RX 9070 XT / 32 GB box that bear on your last two paragraphs — single runs each, same caveats you stated. Plain No finite delay has removed the freed family on my box (all
Your "replaced slot resource until 2 more submissions completed" (5 min 40 s, no freed fault) is the opposite result — two single runs can't separate luck from machine difference there. What my ladder does say: the only policy that reliably dodged the family here is never freeing at all, and my earlier free-path layering also found the slot-rewrite site the only free point whose removal doubled survival (47 s → 122 s) — both consistent with your conclusion that Separately, in case it moots the delay designs: on my box #493's bounded root SRV views (stacked on #431) also removed the fault class entirely (~6.5 min, zero page faults, ending in a GPU timeout at ~1 fps instead) — posted on that PR. For completeness on the new endpoint: compute AI-assisted Hermes Agent. |
DenRakEiw
left a comment
There was a problem hiding this comment.
NVIDIA cross-vendor verification — tested merged cleanly onto main (ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC) with NVIDIA GeForce RTX 5090 (Blackwell) and WARP (VICTORY_D3D12_WARP=1):
cargo test -p victory-gpu(RTX 5090): 50 passed, 0 failed, 1 ignoredVICTORY_D3D12_WARP=1 cargo test -p victory-gpu(WARP): 50 passed, 0 failed, 1 ignoredcargo clippy -p victory-gpu --all-targets: 0 warningscargo xtask policy: ok
Clean, focused resource-retirement fix behind the queue; builds and passes cleanly on both Blackwell hardware and WARP. Approving.
AI-assisted (Gemini 4 Neon).
|
Tested on AMD (RDNA3), where Setup: AMD Radeon RX 7900 XTX 24 GB, driver 32.0.32029.2010; Ryzen 7 9800X3D, 32 GB; Windows 11 10.0.26300. Diag build of this PR's head
For comparison, on the same machine and with the same method:
AI use: Claude Code (Claude Opus 5.5) merged and built the commits, ran the title, summarised the log lines and wrote this comment. The numbers come from the runs above. |
|
Automated triage for the maintainers. Needs rebase. This PR does not merge cleanly into current The content has not been reviewed yet; it will be once the branch is rebased onto Generated by Claude Code |
Follow-up to what I read in #557 and #304: a host resource whose last CPU reference goes away is released immediately, while GPU work that may still read it can be queued.
HostHeap::keep(crates/victory-gpu/src/descriptor/host.rs:279)ID3D12Resourceduring recording;make_at,make_null,mirrorandconstant_atall go through itshadow::unregister(crates/victory-gpu/src/shadow.rs:391)Arc<Shadow>and with itShadow::bufferThe comment on
unregistersaid "lists that still hold its copy keep it alive", butDeferred(crates/victory-gpu/src/host.rs) holdscopies,uploads,kept(named host objects),refreshed,textures: HashSet<usize>(texture ids),writesandbudget_zeroed— noArc<Shadow>. A list reads a copy by binding it, so a draw with no bindings has nothing to hold; anExecuteIndirecttakes its arguments from memory a shader wrote, so no list can name what it will read.The console reads stale memory where the host page-faults. On the host that is a removed device:
page fault at 0x…; inside freed ["texture 1024x1024 …"], with the stopped command anExecuteIndirectkind 10 mesh list.Change
release_late(ID3D12Resource)(host.rs) queues a resource instead of dropping it;Host::executedrains the queue once the fence's event has been waited for, which is the only point where a resource is provably past use. Both paths above now hand their resource to it. Nothing is released earlier than before — the free is only deferred — so this cannot break a read.Tested
cargo test -p victory-gpuonmainof this fork: 43 passed, 0 failed, 1 ignored.Built with the
x86_64-pc-windows-gnutarget (rustc 1.98.1, llvm-mingw fromtools/), because this machine has no MSVC toolchain. No title was run and no game files were used, so this is not evidence that #557 is fixed — it removes two frees that cannot be justified by anything the host tracks, and the page fault may still have another source (a pooled snapshot buffer, or a free I have not found).Happy to shape it differently if the maintainer would rather keep the queue on
Hostinstead of a static, or drain it per list rather than per submission.AI-assisted (OpenCode).