GPU: transition host copies of title memory between shader writes and reads #334
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!334
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/334/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?
@realhenners on GitHub · 2026-11-24 02:21 UTC · original
realhenners:fix/buffer-copy-states→main· +538 −32 · 3 files · 2 commits · closed without mergingRefs #199, #264 (NVIDIA: vertex buffer in
UNORDERED_ACCESSat a draw, barrier before-state mismatches, thenDXGI_ERROR_DEVICE_HUNGentering the world).Cause
Host copies of title buffers (
shadow.rs) are created inCOMMON(host.rs,shared_buffer) and never transitioned: they relied on implicit promotion. Promotion fromCOMMONlets a buffer be either written (UAV) or read in a list, not written and then read as vertices. The world's 174 MB heap (title buffer 0x19b10000+0xae00000in #199) is both.On top of that,
indirect.rsrecorded fixed barriers on the argument buffer:UNORDERED_ACCESS -> INDIRECT_ARGUMENTbefore everyExecuteIndirect, anddone()moved it back toUNORDERED_ACCESSafter. Because the arguments live in the same heap as the vertices, every indirect draw left the vertex data explicitly inUNORDERED_ACCESS. That matches both reports: the vertex buffer in UAV atDrawIndexedInstanced(#199, #264 id 538), and barriers whose before state was UAV while the buffer was inVERTEX_AND_CONSTANT_BUFFER(#264 id 527, 131 times).Change
BufferStates(host.rs): per list, the state of each host copy it uses: its first state and its current one. Reads (vertex, index, constant, shader resource, indirect arguments) useGENERIC_READ, shader writesUNORDERED_ACCESS, with a transition wherever the use changes.COMMONto its first state, andHostList::closemoves it back toCOMMON. State never leaks into the next list of the sameExecuteCommandLists.draw.rs: vertex and index buffers, root views, and buffer views in tables (readable: UAV views write, others read).indirect.rs: the clamp asks for the write state; the newindirect::executeasks for the read state and recordsExecuteIndirect. This replaces the fixedUAV <-> INDIRECT_ARGUMENTbarriers anddone().Shortcuts, also commented in the code: buffers read only through directly indexed heaps are not tracked. A single command that both writes a buffer through a UAV and reads it as vertices, indices or arguments leaves it in the read state, because D3D12 has no legal state for both.
Tests
host::tests::buffer_states_transition_between_writes_and_reads: the state logic (no GPU).host::tests::debug_layer_accepts_buffers_written_then_read_as_vertices: on the real host device with the D3D12 debug layer (run in a child process, since the layer is process-wide). Two lists submitted together use one shared buffer the way the world uses its heap: plain draw → argument clamp +ExecuteIndirect→ draw, then a list that starts with an indirect draw. It asserts the debug layer reports no errors. It skips without a debug layer or a GPU.main'sindirect.rsbarriers, the test fails with id 527 (barrier before stateUNORDERED_ACCESSvs the buffer's actualINDIRECT_ARGUMENT).COMMONdisabled, it also fails with id 527. The test therefore guards the cross-list handoff.cargo test --workspace,cargo test -p victory-gpu --features diagnostics,cargo build -p victory --features diagnosticsandcargo xtask policypass. Clippy onvictory-gpuadds no warnings.Not tested / limits
VICTORY_D3D12_DEBUG=1on their NVIDIA cards.UNORDERED_ACCESS. So the test cannot show #199's id 538 message disappearing, only the barrier consistency (527) and the state logic.DEVICE_HUNGis unproven. A transition from UAV to a read state also makes the shader writes visible to the input assembler, so stale or garbage vertex data is a plausible way to a hang, but #199's comment from an RTX 5080 run hung in a compute dispatch instead (closer to #97).AI use: Claude Code (Claude Opus 5.5) found the cause, wrote the change and tests, ran them on the GPU above, and drafted this description.
🤖 Generated with Claude Code
@EduAzevedo on GitHub · 2026-11-24 02:33 UTC · original
Tested
af2aecfon NVIDIA GeForce RTX 2070 SUPER (Turing), driver 610.88, Windows 11 (10.0.26200), native D3D12: the state errors are gone; the world hang is not.cargo test -p victory-gpu: 45 passed, includingbuffer_states_transition_between_writes_and_readsanddebug_layer_accepts_buffers_written_then_read_as_verticeson this card.VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1, empty cache, boot → first mission's intro, counts from the full log file:maind2a4bae(3 runs)IASetVertexBufferson a title buffer inUNORDERED_ACCESSUNORDERED_ACCESS)The errors left in the run are the known ones: 114× Wave64 compute refused (#54), the 1,310,720 > 1,000,000 shader-visible heap (#16), and the two texture formats of #55.
The world still ends in
DXGI_ERROR_DEVICE_HUNG, about 4 minutes after start. DRED: one list stopped at command 175 of 413 on aDispatchMesh(op 42), every other unfinished list at command 0, as onmain(#71). So on Turing this PR fixes the resource-state validation but is not the cause of the hang.AI-assisted.
@noxite-four-life on GitHub · 2026-11-24 02:58 UTC · original
Tested on a real RTX 5070 Laptop GPU with a GTA VI dump (the game run you asked for). With this PR applied (on
main+ #205),VICTORY_D3D12_DEBUG=1reports 0 of the barrier/state errors this PR targets — the id 527/538before state/RESOURCE_BARRIER UNORDERED_ACCESSmismatches are gone, and the title reaches the opening cutscene.It doesn't get the world rendering on its own — a device-removal still happens later from other causes (compute PSOs refused for Wave64 on this 32-lane card, since fixed by #189; plus remaining untranslated geometry shaders). But the buffer-state transitions this PR adds are clean on NVIDIA, so the barrier side is resolved. Thanks for the fix.
@r4tedx on GitHub · 2026-11-24 03:11 UTC · original
Review note. I built this on
main(d2a4bae) and rancargo test -p victory-gpuon an RTX 5070: passes. (The debug-layer test printed "skipped" here; the layer is not installed on this machine, so I could not run it.) Of the open PRs for the vertex-buffer-in-UAV-state errors of #199 / #264, this one looks like the one to give testers; #367 does the same job and the two conflict.One case where a write loses to a read within a single command.
bindhandles tables before root views, andbuffer_staterecords and transitions to whatever was asked last:readable(a table UAV):list.buffer_state(&shadow.buffer, BUFFER_WRITE)root_view(a root SRV of the same host copy):list.buffer_state(&shadow.buffer, BUFFER_READ)So a dispatch that writes a host copy through a table UAV and also reads it through a root SRV gets a WRITE to READ barrier just before it runs, and writes the copy while it is in GENERIC_READ. The next read needs no transition either, so nothing separates those writes from a later vertex or index read of the same copy, which is the situation this PR exists to prevent. With one 174 MiB heap backing most of the title's buffers, one copy being both read and written by the same dispatch seems likely.
Would letting the write state win within one command (or a combined state for copies used both ways) work here?
From synthetic tests and reading only; I have no copy of the title.
@justlovett0 on GitHub · 2026-11-24 03:35 UTC · original
Tested on the #348 machine, stacked with #175 (Agility) + #346 (rectangles): the world-entry GPU hang persists here, and the dominant gap on this NVIDIA card looks like the wave64 compute refusals (#71), not buffer states.
Setup: Windows 10 21H2 19044.7846, RTX 3080 10 GB (32.0.15.9649), Ryzen 9 7900X, 32 GB. This PR's head
af2aecf+ #175 + #346 (one conflict inindirect.rs, resolved as described on #346). Release, v1.0.2.1, no input.host pipeline refused (0x80070057)– all compute, matching #71's 77–78 (theWaveSize(64)programs on a 32-lane host).DXGI_ERROR_DEVICE_HUNGafter a submission of 33 lists (~99 s in) – same pattern as without this PR (32 lists).So on this machine the state tracking alone does not prevent the hang; with #233 stacked (wave64 split) the refusals drop to 1 and the failure changes shape (a crash in
nvgpucomp64.dllwhile creating large split compute pipelines, then a hang on a 7-list mesh-heavy submission) – details on #233. No regression attributable to this PR was observed in the menus/loading; the draw/dispatch counts differ between runs partly because the world entry timing differs.Integration note: #346 also reworks
indirect.rs; the resolution I used givesclamp_uavthe buffer parameter forbuffer_state(..., BUFFER_WRITE)and replacesbound's fixed transition withbuffer_state(..., BUFFER_READ).AI use: Qwen Code (underlying model name not disclosed by the tool) built and ran the stack and drafted this comment at the user's request; counts are from the run log.
@miniongk on GitHub · 2026-11-24 03:43 UTC · original
Combination check on RTX 5080 / driver 621.24 / Windows 11 26300, local Xbox Series 1.0.2.1:
a5ba4a4(#320) merged cleanly withaf2aecf(this PR), with no source edits.cargo test --workspaceexited successfully.DXGI_ERROR_DEVICE_HUNG, with DRED implicating indirect execution and mesh dispatch.So the buffer transition work and the console-flow work together do not resolve #97 on this setup. This is a negative compatibility result, not a failure of either targeted test suite. Only aggregate counts and error classes shared. AI-assisted (Kimi Code).
@Mesrine67 on GitHub · 2026-11-24 03:48 UTC · original
Tested commit
af2aecfon Windows 11 build 26300 with an AMD Radeon RX 6750 XT (driver 32.0.21045.29003), using the default D3D12 adapter.cargo test --locked -p victory-gpu -- --test-threads=1: 45 passed, 0 failed, 1 benchmark ignored. The debug-layer child testhost::tests::debug_layer_accepts_buffers_written_then_read_as_verticesran (no skip message) and passed; the state-machine unit test also passed.This confirms the PR's synthetic state-transition scenario on this AMD system. It does not test the GTA VI executable or the same-command case where a single host copy is referenced through both read and UAV descriptors.
@QemmHD on GitHub · 2026-11-24 05:11 UTC · original
Tested
af2aecfonmaind2a4bae, native Windows 11, RTX 4070 SUPER, driver 621.24.cargo test --workspace --locked: 266 passed, 0 failed, 4 ignored; no new clippy warnings. The state test passes; the debug-layer test printsno D3D12 debug layer; skipped(Graphics Tools not installed here).readable(draw.rs:1085/1087) andbuffer_state(host.rs:1349) keep the last state asked for. With one host copy per title heap, a table that reads one sub-range through an SRV and writes another through a UAV of the same copy runs its UAV writes in GENERIC_READ whenever the SRV is listed last. Collecting the command's states and letting the write state win would make it order-independent. Conflicts with #479.No game data used.
AI-assisted (Claude Code, Claude Opus 5.5).
Discord: bigpeppa.
@r4tedx on GitHub · 2026-11-24 05:55 UTC · original
A pointer for readers of the report above, since its last paragraph mentions #233: what happened with #233 stacked was narrowed down on that PR afterwards. The one compute pipeline the driver refused there (
c4183d3cbee28e8e,E_OUTOFMEMORY) comes from a module that failsdxil.dllvalidation, in a classmainemits too (computeimage_samplelowered todx.op.sample, #201; #180 fixes it), and newer drivers (616.92, 621.x) create that pipeline. The other hashes in that report are not programs #233 translates. That the first-chance exception innvgpucomp64.dlland the refusal are linked is likely but not proven. Details: #233Nothing here is about #334 itself. AI-assisted (Claude Code).
@colehammond65 on GitHub · 2026-11-24 06:25 UTC · original · edited 2026-11-24 06:27 UTC
RTX 4080 / Windows 10 A/B: the world hang remains; debug-layer state errors could not be measured
Environment
diagprofile withdiagnosticsmain+ PR #175 at19aec59af2aecf+ PR #175, merge9c2d98bImportant limitation
This Windows build reports
Feature name GraphicsTools is unknown. The app-local Agility SDK loads correctly, butD3D12GetDebugInterfacestill returns0x887A002D. The PR's debug-layer child test also printsno D3D12 debug layer; skipped.So this run cannot confirm whether error IDs 527/538 disappeared. It can confirm whether the device removal remains. DRED was enabled; GPU timing and GPU-based validation were not.
Method
Two runs per variant, each with a new empty cache, the same profile/data directory, and the same scripted Enter schedule from 8 through 47 seconds. Run order was baseline, #334, #334, baseline. Each run stopped on process exit or at an eight-minute timeout.
Results
0x887A00050x887A00050x887A00060x887A0006EXECUTE_INDIRECT(op 5) orDISPATCH_MESH(op 42)DISPATCH_MESH(op 42) orEXECUTE_INDIRECT(op 5)The survival and frame-time ranges overlap. Two runs per variant are not enough to claim a performance improvement or regression.
All four runs reached the world and then lost the device. None reported a page fault or a freed allocation. Commit headroom stayed above 7 GiB, so these particular failures were not commit exhaustion.
The largest shader-translation gaps were the same in both variants: lane masks read as data, selects on untracked masks, addresses in non-root SGPRs, and structured buffers of unknown stride.
Source-only verification
victory-shadersuite crashes on this host; the same suite passes serially.Conclusion
PR #334 did not prevent the RTX 4080 world-load device removal in this test. The failure still lands in indirect execution or mesh dispatch, without a page fault. The targeted D3D12 state-error removal remains unverified here because the debug layer cannot be installed on this Windows build.
A debug-layer-equipped tester is still needed to confirm the 527/538 result. No game files, paths, screenshots, shader dumps, or proprietary data are included in this report. AI-assisted testing and reporting; I ran the tests.
@walterwallaceson on GitHub · 2026-11-24 06:47 UTC · original
Tested af2aecf on Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14, Ryzen 5 5600X, diagnostics build (
--profile diag --features diagnostics),VICTORY_D3D12_DEBUG=1,VICTORY_D3D12_DRED=1. Stacked on #175, #233 + #320 + #439 (f653ea4), #55, #89 and #336, all merged cleanly; the only change between the two runs is this PR.UNORDERED_ACCESS(IASetVertexBuffers, the 0xae00000-byte title buffer)ResourceBarrierbefore-state mismatches0x887A0006; the debug layer's last error is the vertex buffer oneDXGI_ERROR_DEVICE_HUNG, no debug-layer error before itSo on this machine it clears both message kinds from #264, and the removal moves later and loses its debug-layer error, but the world still hangs. In both runs the draw DRED stops on reads user data whose heap slots are null (
u8,u9, andu10in the second run), after the dynamic descriptor slots ran out ~8 s into the world load, so the remaining hang looks like the #392 / #483 class rather than buffer states. One run each.With #493 + #483 added on top of this, the device is no longer removed at all in ~5.5 min in the world (details on #493).
cargo test --workspace:victory-gpu50 passed; otherwise only the known Windows 10 failures.No game data in this report.
AI-assisted (Claude Code); everything above was run on my machine.
@erLCoder on GitHub · 2026-11-24 06:26 UTC · original · edited 2026-11-24 06:48 UTC
Tested af2aecf6c130e6c931b9ca58a15718530c16c3ba on Windows 10 Enterprise 22H2, GTX 1660 Ti (Turing), NVIDIA 581.42, Rust 1.98.1.
cargo test --offline --locked -p victory-gpu --features diagnostics --lib host::tests -- --nocapture --test-threads=1passed 4/4. The state-transition unit test passed, and the debug-layer child test ran direct and indirect draws without reporting D3D12 errors or a skip.The check above was synthetic.
Follow-up, game run on the same PC. Tested one Series X run with #334 (
af2aecf), #89 (081afbd), #152 (18b2716), and #439 (e6936e3, including #233/#320), plus Agility SDK 1.620.2 and local logging. DRED was enabled; the D3D12 debug layer was off for this game run. The scene HUD appeared on a black background around eight minutes in. The process ended at about 8m37s withDXGI_ERROR_DEVICE_HUNG(0x887A0006). DRED recorded 25 submitted lists and stopped at command 2554 of 3634 (op 42,DispatchMesh) in one list. Just before removal, DirectStorage had finished 66,425 reads with no errors or pending reads. The previous synthetic barrier test passed; this stacked run does not isolate #334 or identify the cause of device removal.AI-assisted report.
@Hiiva on GitHub · 2026-11-24 10:14 UTC · original
Validated af2aecf with the D3D12 debug layer and GBV on Microsoft's WARP adapter (vendor 0x1414, software flag 0x2). The sequential buffer-state scenario passes, including submitting the two recorded lists in reverse order and resetting/reusing one list.
There is a hole in the current regression test: Host::execute calls log_messages(), which clears the information queue before the test reads it. I changed the test to collect errors through ID3D12InfoQueue1 callbacks so execution cannot erase the evidence. With the closing return-to-COMMON temporarily disabled, this test reliably fails with id 527 (COMMON before-state versus GENERIC_READ). Restoring the transition makes it pass. The test also keeps errors reported while recording.
Integration with #493 needs a BUFFER_READ state call in root_srv_table's shadow.refresh branch, because bounded root SRVs bypass root_view(). The source and test changes are at
github.com/Hiiva/VIctory@0c2a559. Diagnostics all-target clippy passes with warnings denied.This checks sequential writes and reads. Simultaneous SRV/UAV uses of one backing resource still need a separate solution; the alias work does not change that. No title-run success claim from this synthetic test.
@andrewpozdnakov7-jpg on GitHub · 2026-11-24 10:46 UTC · original
I checked the buffer UAV clear follow-up from #771 against this PR. The texture-clear commit
d359499merges cleanly withaf2aecf.With
d359499alone, neither guest clear changes its buffer. With the patch below, both guest entry points clear only the three elements selected by a typed UAV (FirstElement = 2,NumElements = 3). TheR32_UINTbuffer reads[1, 2, 41, 41, 41, 6]and theR32_FLOATbuffer reads[1, 2, 0.5, 0.5, 0.5, 6]after submission.I also copied the integer buffer to native readback before and after the guest clear in the same list. The first copy saw the original values and the second saw the clear. Removing the call to this PR's
buffer_state(..., BUFFER_WRITE)makes the regression fail at the state assertion, where the buffer remains inGENERIC_READ.The follow-up reuses the native descriptor construction and the existing shadow refresh/copy-back path. The patch applies after combining
d359499andaf2aecf.A 2-by-2 texture UAV control also read back all four expected texels. The diagnostics suite passed 55 tests, with the focused WARP test run separately. Library Clippy passed with warnings denied.
AI-assisted. Verified on WARP with synthetic data. The SDK debug layer was unavailable on this machine.
Incremental production patch
@fuzeofficlal on GitHub · 2026-11-24 10:49 UTC · original
I checked Hiiva's bounded-root read transition on a combined
af2aecf(#334) +c48b240(#493) stack. The synthetic command list went through VIctory's actualroot_srv_tablebinding on RTX 5090 and WARP. A first read returned 41, then a separate UAV dispatch wrote 89 and a second read through the same cached descriptor slot returned 89. A null view returned zero and left the separately tracked buffer in its write state. Both adapters reported zero D3D12 errors, and both diagnostics suites passed 55 tests with one benchmark ignored.Source follow-up
277c20dretains the read transition from Hiiva's integration, including on cache hits, and applies it only when the table has a backing buffer. The probe covers sequential dispatches and the null-view control.@dcastell1 on GitHub · 2026-11-24 11:34 UTC · original
Verified as part of the world-stack several testers are using, on NVIDIA GeForce RTX 5090, driver 621.24, Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build:
So on Blackwell the stack builds and the workspace is green with it applied; #413 is the one that does not apply to current main (it is marked conflicting). What I cannot answer from here is the G-buffer effect — this box has no retail package, so the frame counts have to come from a machine that runs the title.
AI-assisted (opencode): applied the stack to a built tree, ran the suite, reverted it.
@Hiiva on GitHub · 2026-11-24 11:38 UTC · original
Two additional buffer-coherence regressions are fixed in my integration of this PR.
Synthetic red/green evidence on WARP and RTX 4080:
Source commits:
All fixtures use synthetic shaders and buffers. No title assets or captured shaders are included.
@realhenners on GitHub · 2026-11-24 12:41 UTC · original
Thanks, everyone, for the runs and the review.
Results so far, as I read them: with this PR, the debug-layer errors it targets drop to 0 in real title runs on NVIDIA (EduAzevedo, RTX 2070 SUPER: 52–157 vertex-buffer-in-UAV and 74–216 before-state mismatches per run on
main; walterwallaceson, RTX 3070: 27 and 43). The world hang remains, and the runs point elsewhere: Wave64 compute refused on 32-lane hosts (#71, #189/#233) and dynamic descriptor slots running out (#392/#483/#493, #747). So this PR fixes the resource states, not the hang, as the description said.Pushed
c99e429, rebased ontoffe310e:BufferStatesnow counts commands (State::bindand the argument clamp each start one) and remembers which command last asked to write each copy. A read requested in that same command leaves the copy inUNORDERED_ACCESS, whichever view is bound first. The next command's read transitions it as before, so the writes are still separated from later vertex and index reads. New unit test:buffer_states_keep_a_command_writing. One known limit is in the code comment: if a single command writes a copy and also reads it as vertices, indices or arguments, it reads them in the write state, because D3D12 has no state that is both.Host::execute(Hiiva). Rather than switching to callbacks, the child process unsetsVICTORY_D3D12_DEBUG, so the host never takes over the message queue. With the closing return toCOMMONdisabled, the test now fails with id 527 in a diagnostics build withVICTORY_D3D12_DEBUG=1set (checked on an RTX 4070 Ti), and it passes with the transition restored.cargo test --workspacepasses onffe310eplus this branch. Clippy onvictory-gpu(with and withoutdiagnostics) is clean, and so iscargo xtask policy.On #493: bounded root SRVs that bypass
root_viewwill need the samebuffer_state(..., BUFFER_READ)call, as Hiiva noted. Whichever PR lands second should add it.AI use: Claude Code (Claude Opus 5.5) made the changes and drafted this reply; the tests ran on my machine.
@MichaelSmithAI on GitHub · 2026-11-24 15:02 UTC · original
We checked the current #334 changes on a staged build that also has root-view bounds and indirect rectangle handling. On an RTX 4090 with Wine/vkd3d-proton 3.2, two command lists used the same backing buffer for vertex data and clamped indirect arguments. The second list cleared the target before drawing its indirect triangle, so an old image could not satisfy the check. Readback showed a red pixel inside the triangle and a black pixel outside it.
All 11 focused controls passed. The broader GPU suite had 89 passes, one ignored test and the previously observed Wine empty-pipeline-library failure. This is local rendering evidence for the combination. The native tester results above cover debug-layer warning suppression. Whether the change affects the RTX 3060 endpoint in #1001 still needs a comparison on that setup.
@bunbeans2-arch on GitHub · 2026-11-24 19:32 UTC · original
Tested
c99e429on an AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32015.7029, Windows 11 Pro build 22631. Native D3D12, diagnostics build,VICTORY_D3D12_DEBUG=1. A retail title ran 300 s each time: boot, then a story save loading into the game world. As far as I can see, this is the first in-title run on AMD in this thread; the AMD report above is the synthetic test.ResourceBarrierbefore stateUNORDERED_ACCESSmismatchIASetVertexBufferson a resource inUNORDERED_ACCESSA second run with this PR, on a build one translator change older, also logged 0 debug-layer errors in 300 s. A 600 s run with this PR and the debug layer off logged no device removal.
Caveat: this is not a single-variable A/B. Both builds sit on a local stack of other open translator PRs, and the run with this PR also has one more local translator change: 1835 shaders translated against 1682. More translated shaders should mean more buffer uses, not fewer, so I read the drop to 0 as this PR's doing.
AI-assisted (Claude); the runs were on my machine.
@Bladureau on GitHub · 2026-11-24 19:58 UTC · original
Tested
c99e429in the title on an RTX 4060 Laptop (8 GB, 32-lane waves), with the D3D12 debug layer on. The state errors are gone.Setup: Windows 11 Pro 26300, NVIDIA GeForce RTX 4060 Laptop GPU 8 GB (driver 617.14), i7-13650HX, 32 GB. Title exe BLAKE3
b99f876b74d4a77f…(1.0.2.1). I merged this PR ontomainffe310eand #578 (fb7facd), both cleanly. #578 is there so the run is not cut short by the wave64 hang, which ends every world run on this card within 38–217 s onmain. Diag build,VICTORY_D3D12_DEBUG=1,VICTORY_D3D12_DRED=1. I played into the first mission's intro by hand.mainffe310e(2 runs, debug layer on)main+ #578 + this PRUNORDERED_ACCESS)ALLOW_UNORDERED_ACCESS, in every run)cargo test -p victory-gpu -- --test-threads=1gives 56 passed. That includesdebug_layer_accepts_buffers_written_then_read_as_vertices, which ran here with the debug layer and was not skipped.I had opened #1507 and #1527 for the same two errors. This PR covers more (shader writes, table views) and has a test, so I am closing mine in favour of it.
@HocotateGuy15 on GitHub · 2026-11-24 20:19 UTC · original
Retested on RTX 3070 / driver 610.88 / Windows 10 19045.7846 with the D3D12 debug layer and DRED enabled. I applied the GPU changes from #334 at
c99e429to the #175 Agility SDK build at19aec59(one bind-signature conflict resolved to preserve the older function signature). GPU unit tests: 46 passed, 1 ignored.The baseline diagnostics log had 105 entries containing "specified by transition barrier does not". The patched run had zero. The cutscene still ran at about 1 FPS (1,732 ms/frame reported) and exited with DXGI_ERROR_DEVICE_HUNG after an 11-list submission. One incomplete DRED breadcrumb reached 708/856. There were 121 D3D12 id 622 entries for compute shaders requesting 64 lanes on the 32-lane device.
This verifies that the patch cleared the observed barrier errors on this setup. The cutscene hang remains open. Related baseline: #1096. AI-assisted test setup and log analysis.
@Marvisak on GitHub · 2026-11-25 00:15 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/host.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
@Venom2054 on GitHub · 2026-11-25 11:06 UTC · original
Follow-up on the same-command limitation in
c99e429: I reproduced UAV/indirect argument aliasing with a synthetic GPU test and prepared the focused patch below.RTX 5070 Ti 16 GB, NVIDIA 621.01, i7-14700, 32 GB RAM, Windows 11 Pro 26200. Native D3D12.
When the command being prepared declares a UAV write to the argument or count allocation, the patch copies the bounded argument bytes and optional count on the GPU into a separate DEFAULT-heap buffer. The source transitions through the existing tracker and is restored to UAV before execution. One buffer per host list is reused between commands and grown when needed; earlier allocations remain held by the tracker. Commands without that overlap retain the direct path. This preserves the write-wins rule.
Synthetic validation:
c99e429plus the attached patch: 58 GPU tests passed, 0 failed, 1 ignored on WARP with the debug layer; the aliasing test also passes on hardware. GPU Clippy passes with and without diagnostics, including all targets and-D warnings.Title evidence on my combined local stack: a 366.3-second debug-layer run, manually stopped, logged 0 ID 527 and 0 ID 538, with no logged device removal/hang. The new argument-copy path activated. An earlier adaptation of #334 without this follow-up logged 1718 ID 538 indirect-argument errors in 145.0 seconds. My preceding build without #334 logged 1508 ID 527 and 1158 ID 538 vertex-buffer errors in 345.7 seconds. These are combined-stack observations, not a controlled single-variable A/B or performance benchmark.
The new title run still has major visual corruption and poor frame times, 228 shader-translation refusal events, and other debug messages (four ID 645 capability probes and one ID 1419 sampler/root-signature issue). This is not a complete rendering or stability fix. The parent PR's untracked directly indexed views and same-command UAV/vertex/index sharing remain outside this patch.
Integration details for newer main: keep root UAVs tracked as writes, preserve the current clamp implementation, and adapt
capture::read_indirectto the same tracker instead of fixed before-state barriers. In my current-main integration, capture receives the actual copied argument/count resources. The attached patch targets exactlyc99e429, not a rebase onto current main; it contains only this follow-up and its synthetic tests. The larger local integration passes 757 workspace tests (0 failed, 11 ignored), 171 GPU tests with the debug layer (0 failed, 3 ignored), Clippy, build and asset policy.Patch against
c99e429(synthetic fixtures only)Prepared and validated with OpenAI Codex. No game assets, captured shaders, screenshots, raw logs or private paths are included. Feel free to incorporate the fix and tests into this PR.
mi
@realhenners on GitHub · 2026-11-25 23:18 UTC · original
Closing this in favour of
315cea1onmain, which fixes the same two errors from #199 / #264 by a different route: the clamp now writes into the list's own argument buffer, so the title's 174 MB heap is never explicitly moved toUNORDERED_ACCESS, and title copies stay inCOMMON, promoted by each use and ordered by UAV barriers. Rebasing this PR's per-list tracker on top would cut across that design.Thanks to everyone who tested it in the title. Across NVIDIA and AMD runs it took ids 527/538 to 0, which helped pin down the cause.
If a driver or GPU-based validation ever objects to the promotion shortcut noted in
indirect.rs(a buffer written through a UAV and then read by the input assembler in the same submission), the tracker here (state per list, a prelude fromCOMMON, back toCOMMONbefore close, writes winning within a command) is the "per-list tracked buffer states" that note mentions, and I'm happy to bring it back on top of currentmain. The old head stays on my fork atc99e429.Pull request closed