Diagnostics: the device-removed report reaches the log when the removal is first seen outside fail(), or by two threads at once #3740
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3740"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by eleboucher on 2026-11-30T05:47:32Z.
With
VICTORY_D3D12_DREDon, the device-removed report (log_removal_context: reason, breadcrumbs, page fault, the trail) often never reached the log.warn!path printed nothing. The first call to see a removal is often a resource creation (no upload buffer … 0x887A0005), a map failure or a wait that only warns, and onlyfail()asked for the report. Nowremoved_seen(&Error)asks for it fromresidency::allocation_error(upload, pool blocks, alias heap chunks, host textures), the read-back/shared/mapped/UAV buffer sites, the two submission-wait error arms and the two timestamp read-back maps.AtomicBool: when two threads saw the loss together, the second skipped the report and went on tofail()/exit while the first was still writing it. It is now astd::sync::Once, so the second caller waits. The device's own data (removed reason, DRED) is written before the context, which takes locks.Tested on an RTX 4070 Ti SUPER with a build that reproduces a removal (#3706's hardware path, ~2 min in). Before: three runs, no report at all. After: the report is in the log (
device removed: …,device-removed data; …,when the host device went: …). Diagnostics builds only; nothing changes withoutVICTORY_D3D12_DRED.cargo xwin check/clippywith and withoutvictory-gpu/diagnostics: no new warnings.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-30T06:13:21Z.
Review: APPROVED
Tested locally merged onto
main(41adb551).crates/victory-gpu/src/host.rsandresidency.rs.cargo test -p victory-gpu --lib host::host_fence_completion_rejects_removed_devicepassed in both default and--features diagnosticsbuilds with 0 new warnings.Clean concurrency-safe device-removed diagnostic reporting outside
fail(). LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by eleboucher on 2026-11-30T06:22:56Z.
The red
checkisfunction unwind_copy is never usedinvictory-loader, which is on main already (this diff touches onlyvictory-gpu's host.rs and residency.rs); #2048 clears it.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by eleboucher on 2026-11-30T14:58:21Z.
Merged main (
c71899d9). One conflict in host.rs: main replaced the host-submission wait withwait_host_fence, whose error paths go throughfail(), which already callslog_removal_context(), so main's code is kept there and the report still reaches the log on that path. The rest of the PR (Onceinlog_removal_context,removed_seen()at the allocation/map/wait errors) applies unchanged on main's code.cargo xwin check -p victory-gpupasses with and without diagnostics; clippy shows only two dead-code warnings that plain main has too (fixed in #2048). Note: main's victory-gpu tests do not compile at the moment (card_passcalled with 5 arguments in the card-compare test); #2048 fixes that too.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:49:11Z.
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.
Pull request closed