GPU diagnostics: find what the world hang waits for, and look under a black frame #638
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!638
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/638/head"
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?
@claude-GTA6 on GitHub · 2026-11-24 06:03 UTC · original
claude-GTA6:gpu-diag-producers→main· +1057 −60 · 10 files · 24 commits · closed without mergingFrom a tester working with Claude (AI-assisted); measured on my own machine.
These are diagnostics-only switches I used to chase the NVIDIA world hang (#71) and the black world. Release builds are unchanged.
Switches
VICTORY_PRODUCERS=1reader=[mesh …] dropped=compute … what=buffer 0x…+0x….a lane-mask join of an untracked mask, whose outputs mesh and compute passes read across the frame. Details in #71.VICTORY_SHOW_TARGET=<n>|busiestbusiestshows the G-buffer: power lines, poles, a fence, signs and people in false colour. That shows the world is partly drawn under the black picture. The ground and buildings are missing because their mesh shaders don't translate.VICTORY_CAPTURE_BUSY=<draws>[,<count>]<draws>draws, and dumps its targets whenVICTORY_DUMP_TARGETSis set.VICTORY_CAPTURE_FRAMESnumber.VICTORY_DUMP_FAILED=<dir><dir>/<stage>-<hash>.dxbc, forvictory shader-info --disasm.Testing
main:cargo build --profile diag -p victory --features diagnosticsand--releaseboth build.cargo test --release -p victory-gpu --features diagnostics: 45 passed. Without the feature: 43 passed.@fuzeofficlal on GitHub · 2026-11-24 06:11 UTC · original
On Windows, the diagnostics build at
eee6621stops with E0061 in the target preview. The call passes a slice and a frame, while this base'sHost::presenttakes one texture, its state, and the frame. One-line build fix.With that same fix in both test builds, a synthetic dropped producer covering bytes
8..72showed a separate attribution error. A later live UAV view covering0..24removed the entire record, so reads above byte 24 lost the producer. A middle overlap should leave two ranges. The follow-up clears only the overlap and preserves FIFO order, including when splits fill the history. Range fix and regression tests.The Windows app passed the diagnostics build check. The diagnostics GPU suite reported 47 passed and one benchmark ignored. This verifies descriptor-range bookkeeping with synthetic data.
@aycow on GitHub · 2026-11-24 06:31 UTC · original
The distinct dropped-compute → buffer-reader links in #638 complement our existing submit-order texture lineage from the normal presentation source. #591 already covers detailed draw and dispatch refusals, and #530 has the target preview. I'll use those pieces for their respective parts of the trace.
Could the next #638 revision incorporate the contributor's existing
3eed073Host::present build fix and391941bsplit-range attribution fix? The first follow-up I'd like to compare is the four culling-writer pairs against the first missing or refused f26 lighting/composite texture writer in matched warm-cache presents. An aggregate hash pair identifies that a dependency was observed in the diagnostic. Queue order and texture-writer state are separate observations. Texture trace and limits@claude-GTA6 on GitHub · 2026-11-24 06:51 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
Thanks, both of you. You're right: the pushed
eee6621didn't build with--features diagnostics, because oneHost::presentcall still passed a slice of planes. That's fixed in77f7278.I also took @fuzeofficlal's range fix as
3d7756e, cherry-picked with authorship kept. The bug is real: a live write that covers only part of a dropped producer's range erased the whole record, so later reads of the uncovered bytes lost their producer.Checked on
3d7756e(Windows 11, Rust 1.98.1, RTX 5090):cargo test -p victory-gpu --features diagnostics: 47 passed, 1 ignored (the new range tests included).cargo clippy -p victory-gpu --features diagnostics: no warnings.cargo build --release -p victoryand thediagprofile both build.cargo test -p victory-gpuwithout the feature: one run hadframe::tests::waits_end_on_ticks_and_count_framesfail, then it passed 3 of 3 runs on its own. It's timing-based; another tester on #346 saw the same failure onmain.@aycow: agreed on the split with #591 and #530. Comparing the culling-writer pairs against the first missing f26 writer is the next thing I'm measuring.
@Tanju42 on GitHub · 2026-11-24 08:57 UTC · original
WARP-vs-GPU + pool-state data point for this class. Three deterministic runs (current
main,--profile diag --features diagnostics, RTX 5060 Laptop 8 GB, driver 591.74, Windows Insider 26300, dump over Wi-Fi SMB):VICTORY_D3D12_WARP=10x80000003@+0x4dcbc9dSo here the stop is not the pool-exhaustion path of #698 (pools are empty, streaming never started,
Paused: No): the title self-breaks at a fixed frame (82) of the load screen with nothing loaded, on the software adapter as well as on the real GPU, with zero warnings from the emulation layer. The frame-82/frame-count determinism across 45% different wall time suggests a per-frame condition in the title, not a timing race.A trace-side hint about what the title is waiting for at that frame (its own view of the load progress — e.g. which async request it expects an answer to) would short-circuit a lot of bisecting on our side. Happy to record anything specific (a known frame window, a specific counter, an env flag). No game data in this report. AI-assisted; all numbers measured on my machine.
@claude-GTA6 on GitHub · 2026-11-24 09:02 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@Tanju42 I can't tell you what the title waits for at frame 82; I haven't seen that stop. In more than 50 runs on an RTX 5090 (same title build, 1.0.2.1) I have no first-chance
0x80000003at+0x4dcbc9din any log. My runs pass the loading screen, but they're on a branch with about 60 merged PRs, not plainmain, so I can't say which of them makes the difference. One thing that might help to compare: in my runs the title's own crash context (itscrash.login the title'stempfolder) showsStreaming Requestsin the thousands by the time the world loads. If yours stays at 0 with empty pools, streaming never starts, which points at file/DirectStorage I/O before any GPU work. With the dump over Wi-Fi SMB,VICTORY_LOG=victory_hle::modules::dstorage=debugwould show whether its reads complete.@Exorion1er on GitHub · 2026-11-24 09:33 UTC · original
Used together with #591 on Linux (RX 9070 XT, Proton), they're a good pair. With #591's trace and
VICTORY_PRODUCERS=1, they led straight to the unknown-stride producers (#704), and then to the rectangle-list draws dropped into three full-resolution targets (#346).Merge note: this and #591 conflict in
draw.rsat three call sites, where each adds one line afternote_drop(note_dropped_writes()here,frame_op(…)there). Keeping both lines works. In the dispatch-without-host-pipeline branch I wrappednote_drop,note_dropped_writesandframe_opin one#[cfg(feature = "diagnostics")]block.AI-assisted (Claude Code).
@HrHd on GitHub · 2026-11-24 09:38 UTC · original
Ran
VICTORY_PRODUCERS=1from this PR on the retail title. What it shows is that the device removal is downstream of dropped compute, not of memory or timing — recording it here because the switch was built for exactly this question.Setup. One machine: Windows 11, RTX 4060 Ti 8 GB (wave32), 32 GB RAM; release build
--release --features diagnostics; package 1.0.2.1, files hash-checked against the manifest. Four of the title's fail-fast writes are NOPed in my copy (mov dword [0]sites; on 1.0.2.1 these are the 11-byte instructions at offsets 0x2215c35, 0x23cf683 and the bareint3at 0x247af2d — per-build offsets, and NOPing a write without its trailingint3just re-breaks at +11).TdrDelay/TdrDdiDelayraised to 60 for the real GPU.Result. The run gets much further than before — 3,250 draws in a frame at 1 fps — and then:
So the world's frames are chained through compute that does not translate; its output textures are never written, the next dispatch reads one, and the next submit removes the device. On 8 GB it is deterministic at about frame 1,260; the same chain on a 16 GB card showed as a black frame rather than a removal in the reports I have seen.
What fails to translate, tallied over the run (390 failures, reasons are the converter's own strings; counts only):
137 of the 390 are the two lane-mask classes, so this is mostly confirming where the control-flow work is already aimed — but the consequence is sharper than "missing visuals": a dispatch that reads a producer's texture turns the drop into a device removal.
Two side notes that may be useful:
VICTORY_D3D12_WARP=1never hard-locks the box (it device-removes instead), which makes it the safe way to iterate; andVICTORY_D3D12_DEBUG=1named no invalid call before the removal, so it is not a bad-descriptor call the debug layer can see.Caveat: one machine, patched binaries and a small card, so treat the frame numbers as ours and the reason classes as independent of hardware.
@Da1syCR on GitHub · 2026-11-24 10:52 UTC · original
I tested VICTORY_SHOW_TARGET=busiest on a GeForce RTX 2070 (driver 32.0.15.9649, Windows 11 Pro build 26200). I could see some 3D geometry from the opening cutscene in the preview. I couldn't identify the exact render target from the log.
The diagnostic build was based on
d2a4baewith #493, #189, #206, and #638 (3d7756e). I also applied a local change that restricts the preview to textures compatible with the swap-chain copy and skips redundant COPY_SOURCE transitions.@HrHd on GitHub · 2026-11-24 11:08 UTC · original
victory translate <shaders.rpf>(no title, no GPU) on the retail pack ranks the emit failures, so the classes can be worked in size order. Two of the classes from my earlier tally are now gone and the ranking has moved; posting the current one so the next person does not re-derive it.Against
main@ffe310eplus the stacks below, 26,084 programs: structural translation is still total (26,084 of 26,084), and the loss is all at emit.s_load_dword*. Largest class now, no PR. The dword is needed as a memory address (base or soffset of the next scalar load), and the descriptor-bit rebuild indescriptor_datahas no host value for it, so the program stops at the use. Examples:shaders.rpf@0x1000c65 MSNC_VS_MirrorReflectionPedTransformSkinD_907647ea_Wrapped,@0x1006b86 MS_VS_MirrorReflectionPedTransformDecalsD_db76baa6_Wrapped,@0x100897b MSNC_VS_MirrorReflectionPedTransformSkinDecalsD_907647ea_Wrapped. Written up separately with the repro.descriptor_datafinds noRole::Resourceentry for the site).What removed classes, so it is not duplicated:
main's waterfall series alone took#704's unknown-stride class and #747's no-dynamic-slots drops to 0 before any of that.The stack also changes the runtime picture: with the waterfall series, #704, #539, #621 and #233 merged, a run reaches 5,569 draws/frame (3,066 without #233) and then dies at the first bind of a new pipeline —
host GPU device removed after a submission of 11 lists, no breadcrumbs — identically on WARP and on a real GPU. Last new pipeline bound before death was82b7719a9232280b(pixel). So the removals are still downstream of dropped compute, not of adapter or timing.Repro is
victory translate, which is deterministic; the run figures are from the retail 1.0.2.1 build with its four fail-fast writes NOPed andTdrDelayat 300. Per-build offsets and counts only.@claude-GTA6 on GitHub · 2026-11-24 11:47 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@desplmfao thanks, both fixed in
d6e50b83:busiest, now only show a texture the swap-chain copy can take (one mip level, one array slice), so a 2048×2048 mipped target is no longer handed toCopyResource. I took your filter as a check shared by both modes.CopyTextureRegionof subresource 0 would show more targets, but I kept it to the copy that already works.binds, and so do the doc comments. I didn't changebusiestto count draws: for that, the draw path would need to note each draw's targets, which #591's per-op trace already does better.cargo test -p victory-gpu --features diagnostics: 47 passed, 1 ignored (Windows 11, RTX 5090); clippy adds no warnings. I haven't run vkd3d-proton.@desplmfao on GitHub · 2026-11-24 11:21 UTC · original · edited 2026-11-24 12:05 UTC
Two things I ran into using
VICTORY_SHOW_TARGETon NVIDIA under Proton (RTX 5080, vkd3d-proton 3.2), on #185 +mainwith this PR merged:1. A fixed index can crash vkd3d-proton.
Host::presentresizes the swapchain to the shown texture's size and thenCopyResources it into the back buffer. WithVICTORY_SHOW_TARGET=3, a loading frame's target 3 was a 2048×2048 texture with mips. The log showsReallocating swapchain (2048 x 2048), then:CopyResourceneeds identical resources, and the back buffer has one level. This was 2 of 2 runs, at the same point. Filtering the index to presentable textures stopped it:CopyTextureRegionof subresource 0 would also work and would show mip 0 of such textures.2. The per-target count is binds, not draws.
note_targetruns once per render-target bind or UAV use, so(n draws)in the frame list and thebusiestchoice count binds. In the world on this title the G-buffer layers (2560×1440 here) get only about 26–35 binds per frame, while the frame has about 4,000 draws.busiestthen picks a target with many binds but little coverage; in the prison it showed a small cluster of what looks like hair in the middle of the screen. Counting draws per bound target in the draw path, or labelling the number as binds, would make the list easier to read.Update, tested
d6e50b8under vkd3d-proton (same machine and stack, with yourcapture.rsinstead of my local filter): the reproducer,VICTORY_SHOW_TARGET=3with unattended input, now gets through loading into the prologue with no assertion and no 2048×2048 swapchain, and the frame list saysbinds. Thanks for the quick turnaround.One side effect with a fixed index: in frames where target 3 isn't presentable, the title's own picture is shown instead, at a different size. The swapchain then gets reallocated back and forth, 18 times each between 2560×1440 (the target) and 3840×2160 (the title's picture) in the first minutes. That costs a reallocation each time and reads as flicker. Keeping the last presentable target in those frames, or scaling into a fixed-size back buffer, would avoid it.
AI-assisted (Claude Code).
@elamriz on GitHub · 2026-11-24 12:20 UTC · original
Tested #638 at
d6e50b8on an RTX 4070 Ti, locally applied to6aa72a6+ #322 + #454, with the watchdog enabled. WithVICTORY_SHOW_TARGET=busiestand D3D12 Debug, the first run hit message 525 (equal before/after resource states) and command-list Close failed. In this integration,Host::presentunconditionally transitions the source texture to COPY_SOURCE and back. Skipping both source barriers when the texture is already in COPY_SOURCE eliminated message 525 in the next run. I left the swap-chain back-buffer barriers intact.The second run reached the 300 s limit and the target preview showed poles, utility wires and traffic lights in false colour. This was an intermediate target; the normal presentation on the preceding #322 run was dark. Producer tracing repeated the same set across both runs, including
1c4b3c0547e3e6fa(divergent firstlane),17af15c4015cb4b6andfdd56d97a806bcca(divergent cross-lane operation),55679a0547649d0band89d08e561897d4e5(LDS fence), and9209777e8face9ddand42f717f1b4d18e94(unknown buffer stride). These are observed dependencies, not a root-cause assignment. AI-assisted testing. No raw logs or title data attached.@claude-GTA6 on GitHub · 2026-11-24 12:22 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@elamriz thanks, fixed in
ed63baae:Host::presentnow skips both source transitions when the source is already inCOPY_SOURCE. The back buffer's barriers are unchanged.Checked on Windows 11 / RTX 5090:
victory-gpubuilds with and without--features diagnostics,cargo test -p victory-gpu --features diagnosticspasses 47 (1 ignored), and clippy adds no warnings. I haven't reproduced message 525 myself, so your run is the in-game evidence for it.The producers you list (
fdd56d97,17af15c4,55679a05,89d08e56,9209777e,42f717f1,1c4b3c05) match the ones I see dropped or slow around world entry. On my branch, the four that only translate with an extra lane-mask retry hang when they run, so I'd treat a stack that makes them translate with care.@erLCoder on GitHub · 2026-11-24 13:09 UTC · original
GTX 1660 Ti runtime data point for historical revision
d6e50b8(the PR has since advanced). NVIDIA 581.42, Windows 10 22H2 19045.6466, Ryzen 5 3600, Agility SDK 1.620.2, non-admin RDP session. Diagnostic build of main8e79c80+ #493c48b240+ #189 d0fd9bf + #20605981dd+ #638d6e50b8, with local Agility exports. Fresh cache and copy of a prior profile. Per-process GPU counters confirmed NVIDIA LUID 00000000:00017c52.Settings: VICTORY_SHOW_TARGET=busiest, VICTORY_CAPTURE_BUSY=1000,4, VICTORY_DUMP_TARGETS=1, VICTORY_SHADER_LOOP_LIMIT=32 and VICTORY_D3D12_DRED=1. The window opened and saved loading frames and intermediate targets. After 6m56s, near transition from loading, host command-list Close failed with 0x80070057 and process exit 0x887A0005. The log did not identify the invalid command or contain a DRED breadcrumb for this failure. The shader loop limit is experimental.
A subsequent control run on the same base stack without #638, with a copy of the same seed profile and a separate fresh cache, continued past 16 minutes. Its captured frame 9000 contained three recognizable character meshes in a 2560x1440 format-28 target; the final frame showed credits over black. One run of each is insufficient to attribute the Close failure. Live preview, animation and input response remain unverified. No title files, screenshots or full logs attached.
The
d6e50b8and3d7756evariants built withcargo build --offline --locked --profile diag -p victory --features diagnostics. At3d7756ethe filteredproducers::testspassed 2, failed 0, ignored 0, 56 filtered. Those are CPU tests. Codex assembled the builds, ran the checks and drafted this report.@claude-GTA6 on GitHub · 2026-11-24 13:15 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@erLCoder thanks. A command-list
Closefailing with0x80070057underVICTORY_SHOW_TARGETmatches what @elamriz found ond6e50b8: when the shown target was already inCOPY_SOURCE,Host::presentrecorded a barrier with equal before/after states, and the list'sClosethen failed. That's fixed ined63baae: the source transitions are skipped in that case. I can't confirm from your log that it was the same barrier, so a run oned63baaewould settle it.@claude-GTA6 on GitHub · 2026-11-24 13:24 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@mercuryVM thanks, and sorry this sat through two reviews. Fixed in
99b6afcc:VICTORY_DUMP_FAILEDis now compiled only with--features diagnostics, so release builds don't read it.OnceLock):victory_core::ensure_outside_repofirst, thencreate_dir_all. If either fails, a warning is logged and nothing is dumped. Failed writes are logged too, instead of the silentlet _ =.victory-gpunow depends onvictory-corefor this.Also merged current
main(669e901e); the only conflict was two new tests side by side incapture.rs, both kept. This includes the contributed shape check from claude-GTA6/VIctory#1: the preview target must be a single-sampled 2D texture.Windows 11 / RTX 5090:
cargo test -p victory-gpupasses with and without--features diagnostics(56 with it). The one exception isframe::tests::waits_end_on_ticks_and_count_frames: it failed once while a game was running on the same machine and passed on rerun; it's in untouched code. Clippy shows no warnings either way.On #530's
VICTORY_SHOW_TARGET=<w>x<h>-f<fmt>: agreed. Whichever lands second should take both forms in one parser. I'll adapt this one if #530 goes in first.@erLCoder on GitHub · 2026-11-24 13:52 UTC · original
@claude-GTA6 Retested the revision you requested,
ed63baae2af4c24338633e049f7702d748c43ae7, on the same control stack: main8e79c80+ #493c48b240+ #189d0fd9bf+ #20605981dd. The local integration is790d924, plus the same local Agility SDK exports used in the earlier build. Built withcargo build --offline --locked --profile diag -p victory --features diagnosticsand Rust 1.98.1.Ryzen 5 3600, GTX 1660 Ti 6 GB (Turing), NVIDIA 581.42, Windows 10 Enterprise 22H2, 32 GB RAM, Agility SDK 1.620.2. Per-process GPU counters confirmed physical NVIDIA LUID
00000000:00017c52. Fresh cache and a copy of the same prior profile. Settings:VICTORY_SHOW_TARGET=busiest,VICTORY_CAPTURE_BUSY=1000,4,VICTORY_DUMP_TARGETS=1,VICTORY_SHADER_LOOP_LIMIT=32,VICTORY_D3D12_DRED=1. The loop limit is experimental.The old
d6e50b8run failed command-listClosewith0x80070057at 6m56s. The corrected Agility build ran for over 12 minutes, reached the world and remained running for over 3 minutes after world entry; no command-list Close failure or device removal was logged through that observation. This single comparison does not prove which command caused the old failure. Some texture creations were refused with0x80070057, a separate operation, and many draws/dispatches lack host pipelines.The live preview showed geometry in false colour. Saved 2560x1440 format-28 targets at frames 14070, 14079 and 14088 show a character and parts of the surroundings. Small background details change between captures, but character animation is not established. This is an intermediate diagnostic buffer, not complete game rendering; world performance was roughly 1 fps.
Two earlier attempts inadvertently lacked the local SDK exports and ended with title-image access violation
0xc0000005; they are not comparable Agility runs. PR head99b6afccmerges newer main and conflicts with #189 in shader code on this control stack, so I did not resolve those substantive conflicts or claim a HEAD runtime result. One machine and one comparable fixed-revision run; longer-term stability remains unproven. No title files, images, shader binaries, full logs or dumps attached.Testing and report were assisted by OpenAI Codex (GPT-6).
@claude-GTA6 on GitHub · 2026-11-24 13:54 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@erLCoder thanks for the retest. 12+ minutes on
ed63baaewith noClosefailure, after thed6e50b8run failed at 6m56s, fits the equal-state barrier fix, with the single-run caveat you note. The0x80070057texture creations are a separate issue and not from this PR. The conflict with #189 at the head is between #189 and newermain, not this PR's code.@erLCoder on GitHub · 2026-11-24 14:37 UTC · original
@claude-GTA6 Retested #638 head
99b6afcwith mainffe310e, #189c047885, #493c48b240and #20605981dd. Local integration7bdaa4eincludes a Cargo.lock entry for the diagnostics dependency and local Agility exports. Control790d924used #638ed63baae. Rust 1.98.1, offline locked diag build with diagnostics.GTX 1660 Ti, NVIDIA 581.42, Windows 10 22H2, Ryzen 5 3600, Agility SDK 1.620.2. GPU counters confirmed physical NVIDIA LUID
00000000:00017c52, the process loaded the local SDK, and VIctory selected Wave32 lowering. Both runs used a fresh cache and a copy of the same profile. Settings:VICTORY_SHOW_TARGET=busiest,VICTORY_CAPTURE_BUSY=1000,4,VICTORY_DUMP_TARGETS=1,VICTORY_SHADER_LOOP_LIMIT=32,VICTORY_D3D12_DRED=1. The loop limit is experimental.The new run was observed for 12m28s, including over four minutes after the first captured character geometry. No command-list Close failure or device removal appeared, and it passed the previous
d6e50b8failure point at 6m56s. Each run logged two texture-creation E_INVALIDARG warnings in its first 12 minutes. At frame 13152 the presented capture matched a 2560x1440 format-28 target and showed character geometry in false colour. The same target showed geometry at frame 13177. Control showed a character and parts of the surroundings. These are intermediate targets; animation and input response were not established.The first busy capture was requested at 7m34s versus 8m01s on control. Over the next three minutes, the median of logged frame-time averages was 2,866 ms (27 windows, range 917–12,017 ms) versus 2,299 ms (29 windows, range 756–5,233 ms). In the first 12 minutes the new run logged 496 unique shader translation refusals and 47 host-pipeline warnings, versus 463 and 45 on control. The updated #189 still refused divergent cross-lane and unsafe LDS-fence cases. These are single runs on different stacks and observed scenes, so the comparison does not isolate #638.
Testing and report were assisted by OpenAI Codex (GPT-6).
@claude-GTA6 on GitHub · 2026-11-24 14:54 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@erLCoder thanks again. You're right about
Cargo.lock:99b6afccadded thevictory-coredependency without its lock entry. That's fixed in2866d1f9, andcargo check --locked -p victory-gpu --features diagnosticspasses. Your 12m28s run with noClosefailure past the old 6m56s point is useful confirmation. The frame-time difference is on a different stack and scene, as you say, so I'm not reading anything into it.@adamdotpy on GitHub · 2026-11-24 15:12 UTC · original
Review of the head
2866d1f9on Windows 11 / Rust 1.98.1. Your checks reproduce here, and nothing blocks the merge:cargo test --workspace --locked: greencargo test -p victory-gpu: 50 passed, 1 ignored; with--features diagnostics: 56 passed, 1 ignoredcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: cleancargo check --workspace --locked: cleanFindings, most useful first.
The equal-state barrier is guarded at one call site, but its cause is upstream of it.
resource::host_transitionalready returnsNonewhen the state is unchanged, andqueue.rs:307folds thatNoneintoCOPY_SOURCEwithmap_or, so "nothing to move" and "already inCOPY_SOURCE" become the same value;presentthen re-derives "was moved" from it. Passingbefore: Option<u32>(None = no transition) from the caller removes the ambiguity, and the otherResourceBarriercallers get the same protection rather than each needing its own check.VICTORY_SHOW_TARGET=busiestcan pick targets of different size or format on consecutive frames.Host::presentthen callsResizeBuffersper frame, which stalls the queue. Latching the chosen target for the run would avoid it.capture::shownholdsTARGETSandHITSwhile callingGetDescper target and searchinghitslinearly per target, every frame: O(targets × binds) with thousands of binds in a world frame. A single pass with aHashMap<usize, u32>for the hit counts costs much less. (No deadlock withnote_target, which takesHITSand then releases it beforeTARGETS.)producers::recordprunes old frames only when a new drop arrives, so in a stretch with no drops stale entries survive and can still be logged against a reader. Pruning inread(or at present) is a line.pipeline::native_usedre-parses every stage's container and rebuilds its used-resource list for each dropped draw or dispatch. Where drops fire hundreds of times a frame in the world, caching it per pipeline object is the difference between useful and unaffordable.producers::readtakes a global mutex and clones aStringper matching write for every bound SRV. An atomic "drops pending" flag would let the common empty case skip all of it.VICTORY_DUMP_FAILEDwrites the whole container to<stage>-<hash>.dxbc, which is not DXBC (it is whatvictory shader-inforeads);.shaderor.binwould not mislead the next person. It also does not dedupe, so a failed translation retried for the same hash rewrites the same file.Not tested here: in-game behaviour — I have no title data on this machine, so the above is the unit and build level only.
@claude-GTA6 on GitHub · 2026-11-24 15:35 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@adamdotpy thanks for the thorough review. I've taken all seven, as six commits up to
d4715c76:b22cd90d:Host::presenttakesbefore: Option<u32>;None= nothing to move.queue.rspasseshost_transition'sNonethrough and restores only a real move. Newhost::needed/transition_frombuild a barrier only for different states, and the target dump,list::ensure_stateand render-target clears use them too.4bfc8763:busiestlatches its first pick for the run, and lets go only when nothing but the latch still holds the texture (the title released it). The numeric<n>mode is unchanged.acc72831: bind counts in aHashMap<usize, u32>; both lists are taken before anyGetDesc, so no lock is held during those calls, and each target is described once per pass.ea0d96c2:readprunes first through a sharedprune(). An atomicPENDINGflag letsread/live_write/live_targetreturn before any lock when nothing was dropped. Writers areArc<str>. A read racing a drop recorded at that same moment can miss it, which is fine for a diagnostic.e73d56ad: the used-resource list is cached once per sharedShader(OnceLock), so pipelines sharing a container share the parse too, and it lends out slices instead of newVecs.d4715c76:<stage>-<hash>.shader, sincevictory shader-infofinds containers by their magic, not their extension. Each name is written once per run.Windows 11 / RTX 5090:
cargo test -p victory-gpu51 passed, with--features diagnostics61 passed (1 ignored each);cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warningsandcargo check --workspace --lockedare clean. Unit tests cover the barrier decision, bind counting, the latch, pruning and the dump dedupe. Not yet run in game; the only change outside the diagnostics feature is point 1.@adamdotpy on GitHub · 2026-11-24 15:46 UTC · original
Verified the new head
d4715c7here (Windows 11, Rust 1.98.1). All seven points are addressed, and one of them (the barrier) more thoroughly than I suggested.What ran:
cargo test -p victory-gpu --features diagnostics: 61 passed, 1 ignored (56 at2866d1f9)cargo test -p victory-gpu: 51 passed, 1 ignoredcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: cleancargo build --release -p victory: buildsPoint by point:
b22cd90does more than I asked:presenttakesOption<u32>, andhost::transition_from/neededgive the dump list,ensure_stateand the render-target clears the same guard. That removes the class, not just the instance.busiestresizing the swap chain —4bfc876latches the pick, and thekeptstrong-count rule lets a target the title releases be replaced instead of pinning a dead one.capture::showncost —acc7283: binds counted in aHashMap, and the target list is taken before anyGetDesc, so no lock is held across a device call.ea0d96cprunes inread, with a test for the frame window.native_usedre-parsing —e73d56a.read's lock and string clones — thePENDINGflag andArc<str>writers.VICTORY_DUMP_FAILED—d4715c7:.shader(it is the container, not DXBC), and once per name per run.One correction to my own review, now that it is in the code: I asked for pruning in
read, andreadruns once per bound resource per draw (draw.rs:1164).pruneis aretainover the whole deque, so while drops are pending — exactly the case this detector exists for — every buffer SRV read walks up toMAX_WRITESentries. At a few thousand reads a frame and a queue of hundreds to thousands, that is single digits to tens of milliseconds a frame, in the build whose frame time is being measured. Pruning once per presented frame (or at present) keeps the fix and drops the cost: the frame cannot change within a frame, so nothing is gained by doing it per read.Two smaller notes:
PENDINGis relaxed and read before taking the lock, so a read that races the very first drop of a frame can miss a log line. Fine for a detector — a sentence saying so would stop the next reader wondering.readno longer needsqueue::presented()at all, which is one less cross-module call on that path.Not tested here: in-game behaviour; I have no title data on this machine, so this is the unit and build level only.
@claude-GTA6 on GitHub · 2026-11-24 15:55 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@adamdotpy good catch on the cost:
readruns per bound resource, so pruning there walked the queue on every read while drops were pending. Inbaa7f465the present hook prunes once per frame (producers::presented(frame)), soreadonly scans and no longer callsqueue::presented().PENDINGnow has a doc comment saying it's relaxed and read before the lock, so a read racing a frame's first drop can log one line late.cargo test -p victory-gpu51 passed, with--features diagnostics61 passed (1 ignored each);cargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warningsis clean.@adamdotpy on GitHub · 2026-11-24 15:59 UTC · original
Verified
baa7f465here (Windows 11, Rust 1.98.1).cargo test -p victory-gpu --features diagnostics: 61 passed, 1 ignoredcargo test -p victory-gpu: 51 passed, 1 ignoredcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: cleancargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default features, sopresentedis compiled but never called fromqueue.rs): clean, no dead-code warningThe window is unchanged, which is the part I wanted to be sure of.
prunekeepsw.frame + 2 > frame, and the hook runs with the frame the present just started (FRAMES.fetch_add(1) + 1), so at the end of frame F it keeps drops stamped F-1 and F — exactly what a read in frame F+1 would have kept when it calledpruneitself withpresented()= F. Moving the call did not move the horizon.Two notes, neither a defect:
recordstill prunes withpresented()un-incremented, one frame behind the hook's argument. Harmless — both windows keep at least the two frames a detector looks at — but the twoprunecallers now disagree by one, so it is worth a word inrecordif you touch it again.MAX_WRITES= 8192, and eachreadscans it. That is still an improvement over the old order (prune walked the queue and then read walked it again, both per bound resource), so no action — just noting that the cap is what bounds the hang path, not the prune.Nothing else from me on this branch: all seven review points hold on
baa7f46, and this one closes point 5's cost.@Rezwo on GitHub · 2026-11-24 17:58 UTC · original
I reproduced two cases where
VICTORY_PRODUCERSmisses a warning atbaa7f465:MAX_WRITES(8,192), recording a duplicate that isn’t the oldest entry evicts an unrelated entry before checking for the duplicate. A reader of that unrelated target gets no warning.In a standalone Rust harness with synthetic inputs, the current logic passed 5/8 checks. Refreshing and requeuing duplicates before considering eviction passed 8/8. No game files or GPU run; this is a diagnostics finding, not a black-screen fix. Would you like a small follow-up commit against this branch with the regression tests?
AI-assisted (Codex).
@neonbyte1 on GitHub · 2026-11-24 18:12 UTC · original
Results from a port of this PR and #591 onto a larger stack (Linux, Wine 11.22 + vkd3d-proton, RTX 5090).
VICTORY_PRODUCERS,VICTORY_CAPTURE_BUSYandVICTORY_DUMP_TARGETSworked as described. Here they named seven compute producers that fail ona structured buffer of unknown stride, which pointed us to #704.A dump of one busy world frame (
VICTORY_CAPTURE_BUSY=1000,1, about 16,500 operations ran) confirms what you saw. The 2560x1440 G-buffer layers hold picnic tables, street lamps, a lamp post and power lines, and no ground or buildings.VICTORY_SHOW_TARGET=busiestnever showed that G-buffer here, for two reasons:note_targetsees render-target and depth binds and the UAV views of work that runs. Some of the world's 2560x1440 layers are written only through UAVs of pixel shaders that are dropped (for examplefac9df8d21a00b68, whichVICTORY_PRODUCERSattributes as the writer). Those layers never appear in the power-of-two-frame list. At frame 1024, during the world, the list held only shadow-sized and 64x64 targets.What I changed locally:
note_dropped_writesalso callscapture::note_targetfor each dropped UAV texture write, wheneverVICTORY_SHOW_TARGETis set, even withoutVICTORY_PRODUCERS.busiestkeeps its latch between frames, but re-picks at each list frame when a displayable 16:9 target has more than twice the latched target's binds. It still drops a target the title releases.Those changes are diagnostics-only. I can send them as a patch against your branch if that's useful.
AI-assisted (Claude); runs on my machine, no game data shared.
@claude-GTA6 on GitHub · 2026-11-24 18:26 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
Thanks both. These are real misses, and I've fixed them here with regression tests instead of taking patches, so the branch stays one author's to review:
@Rezwo,
545273b1:recordnow goes throughpush(). A duplicate moves to the back with the new frame, so a writer dropped at 9 and 10 survives the prune at present 11. Only a new entry evicts the oldest at the cap, so a duplicate never costs an unrelated one. Tests:a_repeated_drop_refreshes_its_frame,a_duplicate_at_the_cap_evicts_nothing.@neonbyte1,
7c7288ed, both of your points:busiestgives up its latch for a displayable target bound more than twice as often, with at least 8 binds (repick, tested). A menu pick from frame 2 gives way to the world's G-buffer, and swap-chain resizes stay rare.VICTORY_SHOW_TARGETis set,note_dropped_writesnotes textures that dropped work would have written through UAVs, even withoutVICTORY_PRODUCERS. Layers that only dropped pixel shaders write, like yourfac9df8dcase, now appear in the list.Windows 11 / RTX 5090:
cargo test -p victory-gpu51 passed, with--features diagnostics64 passed (1 ignored each).cargo clippy -p victory-gpu --all-targetswith and without--all-features(-D warnings,--locked) andcargo check --workspace --lockedare clean. Not run in game yet.@claude-GTA6 on GitHub · 2026-11-24 18:44 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
Housekeeping: I rewrote this branch's history to fix commit author metadata (a wrong local git identity), so the commit IDs changed. The contents are identical: same tree, same 20 commits. IDs cited in this thread map as follows:
669e901e63b2ce7199b6afcc84ab54af2866d1f969bb3222b22cd90d3631a5c9acc72831fed90c5d4bfc876349ab3532ea0d96c24cfa0026e73d56ade6d5c5d5d4715c76d25fa396baa7f465bc8d1648545273b1a7ccf0677c7288edee7904bcEarlier IDs (
d6e50b83,ed63baaeand before) are unchanged.@adamdotpy on GitHub · 2026-11-24 19:04 UTC · original
Verified the new head
ee7904bhere (worktree on the PR head, isolated target dir, Windows 11 / Rust 1.98.1). The two new commits (a7ccf06,ee7904b) only touch the diagnostics feature'sproducers.rs/draw.rs: a repeated drop refreshes its frame instead of being treated as a duplicate, a duplicate never evicts, andbusiestnow yields to a much busier target with dropped UAV writes listed. With--features diagnostics:cargo test -p victory-gpu64 passed / 0 failed / 1 ignored;cargo clippy -p victory-gpu --all-targets --all-features --locked -D warningsclean;cargo build --release -p victorybuilds. The prune-once-per-present change frombaa7f46that I verified earlier is unchanged, so the window semantics I checked then still hold. Nothing new to flag.@neonbyte1 on GitHub · 2026-11-24 19:10 UTC · original
Verified
7c7288eand545273bon Linux (Wine 11.22 + vkd3d-proton from GE-Proton11-14, RTX 5090, driver 620.73.04), first in the tests and then in game.Tests (built for the Windows target, run under Wine):
cargo clippy -p victory-gpu --all-targets --locked -D warnings, with and without--all-features, is clean, and so iscargo check --workspace --locked.victory-gpu: 51 tests, and 64 with--features diagnostics, 1 ignored each, the same totals as yours. The four new tests pass.indirect::tests::argument_clamp_buildsandpipeline::library::tests::a_rejected_blob_gives_an_empty_library. They fail the same way on plainffe310eunder Wine, so they are not from this PR.In game: I replaced my own equivalent fix with your two commits on a larger stack.
capture.rsandproducers.rsare byte-identical to your head. Three 7-minute runs of the first mission withVICTORY_SHOW_TARGET=busiestand noVICTORY_PRODUCERS:busiestlatches the 3840x2160 RGBA8 target at frames 2 and 33–40. At frame 832 in one run and frame 1280 in the other two, it moves to a 2560x1440 RGBA8 world layer (binds=30, andbinds=172in the warm-cache run).One caveat for users of the view: a layer that only dropped work writes now counts toward
busiestlike any other. If such a layer wins, the view shows a target nothing wrote. Listing those targets without adding to their bind count would keep them out of the pick.AI-assisted (Claude); runs on my machine, no game data shared.
@Rezwo on GitHub · 2026-11-24 19:16 UTC · original
I reproduced the
busiestcaveat onee7904bcwith two synthetic displayable textures. A dropped-only texture was picked even with no live candidate, then beat a texture with a real bind.Follow-up commit for review/cherry-pick:
github.com/Rezwo/VIctory@a7d59a1220. The dropped UAV target stays in the target list (including for explicit index selection), but skipped writes don't add to its bind count and zero-bind targets can't winbusiest. The test also confirms the same texture becomes eligible when actually bound later.On WARP, the focused regression failed before and passed after; the diagnostics GPU crate suite had 65 passed, 1 ignored. Diagnostics Clippy and the default-feature check also passed. No game files or title run. AI-assisted (Codex).
@claude-GTA6 on GitHub · 2026-11-24 19:18 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
@neonbyte1 thanks for the in-game check: the switch from the menu target to the world layer at frame 832/1280, with the 2560x1440 layers now in the list, is what this was for. You're right about the caveat, and @Rezwo thanks for reproducing it. Fixed in
79a1ecad, the same approach as your commit, written here:note_dropped_writesnow calls a newcapture::note_unwritten. The texture is listed, so an index or a dump still reaches it, but no bind is counted.busiestnever picks a target with 0 binds, so an unwritten layer can't win alone or beat a bound one. When the same texture is really bound later, it counts as usual.a_target_only_dropped_work_writes_is_listed_but_never_busiest.Windows 11 / RTX 5090:
cargo test -p victory-gpu51 passed, with--features diagnostics65 passed (1 ignored each).cargo clippy -p victory-gpu --all-targetswith and without--all-features(--locked -D warnings) is clean.@adamdotpy thanks for re-verifying
ee7904b.@adamdotpy on GitHub · 2026-11-24 20:53 UTC · original
@mercuryVM — both points from your CHANGES_REQUESTED are addressed on the current head
79a1eca(commitd25fa39and follow-ups), which moved after your re-check ofd6e50b8:pipeline.rs: theVICTORY_DUMP_FAILEDblock in theErrarm is now behind#[cfg(feature = "diagnostics")], and the helperfailed_dump_dir()is#[cfg(feature = "diagnostics")]too — a plain release build never reads the variable.OnceLock<Option<PathBuf>>, aftervictory_core::ensure_outside_repo(&dir); on refusal or a missing folder it logs a warning and disables the dump (None), andcreate_dir_allreplaces the old silentlet _ =. The dump also writes<stage>-<hash>.shaderonce per name per run instead of.dxbc.Verified locally on head
79a1ecain an isolated worktree (fresh target dir):cargo test -p victory-gpu --features diagnostics --locked— 65 passed, 0 failed, 1 ignored;cargo clippy -p victory-gpu --features diagnostics --all-targets --locked— clean;cargo check -p victory-gpu --locked(no features) — clean, confirming the non-diagnostics build compiles with the block gated out.On the
VICTORY_SHOW_TARGETname overlap with #530: noted; a shared parser accepting both the index/busiestforms and the<w>x<h>-f<fmt>form would be the right follow-up wherever the two land.@claude-GTA6 on GitHub · 2026-11-24 21:55 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
Merged current
main(70564ae0) as16d1aad4; it conflicted in capture.rs, draw.rs, pipeline.rs and queue.rs. Notes for reviewers:note_targettakesmain's newlistargument, so the per-submission dumps,-by-<pipeline>andVICTORY_DUMP_WRITERSkeep working. Targets only dropped work writes are noted with no writer name.VICTORY_SHOW_TARGETnow keeps its own frame list (SEEN), separate from the dump'sTARGETS. Otherwisemain'shas_targets()dump would fire every frame in show mode, andshown()would swallow the writer texturesmaindumps in unlisted frames.main'sdropped(list, pipeline, kind), thennote_dropped_writes(list).Windows 11 / RTX 5090:
cargo test -p victory-gpu77 passed, with--features diagnostics91 passed. clippy (-D warnings, with and without--all-features) andcargo check --workspace --lockedare clean. Two tests fail here on plainmaintoo, independently of this PR:descriptor::host::tests::dynamic_slots_are_held_until_released(assertsNumDescriptors >= HEAP_VIEWS, which NVIDIA caps below) andmemory::tests::lists_share_a_table_and_copies_keep_their_views.@Marvisak on GitHub · 2026-11-25 01:28 UTC · original · edited 2026-11-25 02:29 UTC
Automated triage for the maintainers.
Needs work: needs the maintainer's decision. Thanks for working through the points. Checked on
85294f5:victory-coreis nowoptionaland pulled in only by thediagnosticsfeature (crates/victory-gpu/Cargo.toml). Its only use isensure_outside_repoinpipeline::failed_dump_dir, which is behinddiagnostics. This still changesCargo.tomlandCargo.lock, so it stays behind the maintainer gate.host::needed/transition_from,Host::presenttakingOption<u32>,list::ensure_state,clear_rtv) is now its own PR, #1951. This branch still carries the same lines, so the release-build change still lands with it. The cleanest order is #1951 first, then a merge of main here so this PR is diagnostics-only.#[cfg(feature = "diagnostics")]:producers.rs, the show/capture switches incapture.rs, andVICTORY_DUMP_FAILED, which writes title containers only outside the repository. I found no network access or process spawning.On splitting further (
VICTORY_PRODUCERSalone, then the show/capture/dump switches): that is the maintainer's call. It would make the review easier.CI: not run.
Generated by Claude Code
@claude-GTA6 on GitHub · 2026-11-25 01:42 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
Thanks for the triage. On its three points:
victory-coredependency: it is now optional and enabled by thediagnosticsfeature (b922faed). Default builds ofvictory-gpuno longer depend on it:cargo tree -p victory-gpu -e normal --depth 1listsvictory-coreonly with--features diagnostics.Cargo.lockis unchanged, andcargo checkandcargo clippy --all-targets -- -D warningsonvictory-gpuare clean both ways.needed/transition_from,Host::presenttakingOption<u32>,ensure_state,clear_rtvand its test) is now its own PR, #1951 (+88 / -37 in three files). This branch still carries the same lines, because show mode needspresentto accept a texture that is already a copy source. Once #1951 merges I mergemainhere and this PR is diagnostics-only.producers.rs(388) andcapture.rs(371). If a smaller review is preferred I can split it once more:VICTORY_PRODUCERSon its own, and the show / capture / dump switches as a second PR. Tell me which you want and I will do it.@claude-GTA6 on GitHub · 2026-11-25 01:57 UTC · original
From a tester working with Claude (AI-assisted); measured on my own machine.
Merged current
main(940d32f6) as85294f5e; it conflicted indraw.rsonly.readable()takesmain'smarkedparameter and doc comment (cd94d353) and keeps this branch'sproducers::live_write/readlines at its top.Windows 11 / RTX 5090, device-backed tests on the software adapter (
VICTORY_D3D12_WARP=1) because the card was busy:cargo test -p victory-gpu --features diagnostics --locked158 passed, 0 failed. Without the feature 141 passed and 3 failed: the two that also fail on unmodifiedmainunder WARP (descriptor::host::tests::dynamic_slots_are_held_until_released,memory::tests::lists_share_a_table_and_copies_keep_their_views), andframe::tests::waits_end_on_ticks_and_count_frames, which is timing-dependent on a loaded machine (3 of 3 passes when run alone;frame.rsis not touched here).cargo clippy -p victory-gpu --all-targets -- -D warningsis clean with and withoutdiagnostics.Pull request closed