GPU: a buffer view left null for lack of a host copy is made again after each submission #3529
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!3529
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3529"
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?
@Luislariosss on GitHub · 2026-11-27 14:33 UTC · original
Luislariosss:feat/buffer-view-retry→main· +258 −8 · 5 files · 2 commits · openA buffer SRV or UAV whose host copy did not exist when the title first wrote its record is left null today, and the shader that reads it reads zero with no miss ever counted — the record is never revisited, so the null stays for as long as the title keeps it.
descriptor::make_readhas handled exactly this for texture views since it landed; this extends the same contract to buffer views.A view left null for lack of a copy is now noted (
descriptor::make_refused) and retried once at the end of every submission (Host::execute), whereshadow::findcreates the copy of the registered buffer (or a loose window for unregistered memory) and the view is remade from the same record. The regression test drives a refused view end to end: null and noted after a failed make, made after the submission's retry.Notes for review:
mirrorthat fails fast, but a backoff like the staging one could bound it if thousands of such records ever showed up.remakereturns "done" whenmirrorreturnsNone(the record is no longer a view of ours); if a reviewer sees a transientmirrorfailure mode other than that, the note should be cleared there.The first commit adds the instrumentation this was diagnosed with: large declared buffers logged at INFO (
register), the distinct missed pages per frame next to the per-list sums, and the page-table rewrite line stays at DEBUG. On a run where the world's GPU-driven reads miss ~46k unique pages a frame, that instrumentation is what showed which addresses never gain a copy.The world reads gigabytes a frame at addresses no view names; the page table's misses say so, but not whether the working set is dense or has a hot subset, nor whether a large buffer the shaders read is one the title declared (a copy find can make) or memory with no resource (XMEM). - shadow: a title buffer of 16 MiB or more logs "title buffer declared" when registered, with the "large buffer copied to the host" line of find telling registered buffers never read through views from XMEM. - memory: the page-table rewrite ("title memory page table") logs at INFO. - memory: the frame line carries missed_pages_unique next to the per-list sum of missed pages: distinct 64 KiB pages a frame. No behaviour change: logs and a diagnostic count only.@oni-swr on GitHub · 2026-11-27 15:06 UTC · original
Independent CPU/WARP verification of #3529 (no physical GPU, no game files)
Environment: Windows 11 build 26200, WARP software adapter (
VICTORY_WARP=1,VICTORY_D3D12_WARP=1), dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100.0, x64), cargo-j 4, separate target dir.SHAs: head
14dd3b8fd2ea19733b232177dc1904258a7f6875; merge base on main63bcca43c6a00a758510398fa43096ce7e4f7df0(unchanged since the claim; nobody else had posted a check on the PR or #1633 after 15:01Z). The PR touches onlyvictory-gpu.cargo test -p victory-gpu --lib63bcca414dd3b8The new
descriptor::host::tests::a_refused_buffer_view_is_noted_and_made_at_the_next_retrywas also run on its own and passes.cargo clippy -p victory-gpu --all-targets -- -D warningson head is clean. Caveat: the test returns early ifhost()isNone; I did not separately confirm it took the WARP path rather than the early return.Diff read: no blocking findings. Notes, most relevant first:
make_refused_nowholds theSHADER_HEAPSlock acrossremake->mirror->prepare->shadow::find, which can allocate a whole title-buffer copy or a 4 MiB loose window.make_readdeliberately does its expensive work outside that lock because title threads writing views wait on it (its comment cites 1-6 s a frame). Suggest collecting the noted handles under the lock and remaking after dropping it, or at least moving thefindout.remakecallsmirror(.., for_draw = true). If the noted record has since become a placed texture view (the title overwrote the slot, or the heap was freed and another sits at that range),lateris false and the texture is made eagerly, bypassing the lazy path the placed-texture shortcut exists for. A buffer-only check before remaking would avoid it.find, an address outside every registered buffer falls toloose(), which succeeds for any address, so a refusal should mostly mean the allocation failed orexactreturnedNone. Each submission then repeats the failing allocation per noted record, under the lock from (1). The backoff the PR description mentions seems worth adding. I could not measure this without the title.make_at(dynamic slots) discards the no-copy flag, so those are never retried.pause_refused/REFUSEDare process-global, so the test relies on the pause flag to keep other tests' submissions away.AI use: this check was done with Claude Code (Claude Sonnet 5.5).
@futurepro62 on GitHub · 2026-11-27 20:11 UTC · original
NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head
14dd3b8(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.a_refused_buffer_view_is_noted_and_made_at_the_next_retry.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.