perf(gpu): add texture staging throttles, ripe-block guards, and post-upload slot visibility #3472
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!3472
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3472"
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?
@legayclightning22 on GitHub · 2026-11-27 04:24 UTC · original
legayclightning22:perf/texture-staging-budget-and-visibility→main· +363 −50 · 6 files · 1 commits · openSummary
Adds opt-in texture staging budget throttles (
VICTORY_TEXTURE_STAGE_MB,VICTORY_TEXTURE_STAGE_MS,VICTORY_TEXTURE_CATCHUP), ripe-block release guards (VICTORY_RIPE_BLOCKS), and post-upload slot visibility (VICTORY_SHOW_AFTER,VICTORY_SHOW_NEW_LATER) scaled to memory tier.Changes
<= 8 GiBVRAM /<= 16 GiBRAM systems while preservingDirtyRanges/snapshot_generationcoherency.Verification
cargo test --locked -p victory-gpu --libcargo clippy --locked -p victory-gpu --all-targets --all-features -- -D warningscargo xtask policy@oni-swr on GitHub · 2026-11-27 04:46 UTC · original
WARP test report (
victory-gpu,--features diagnostics --lib --locked --no-fail-fast -- --test-threads=1)OS: Windows 11 Pro 10.0.26200 (build 26200.9974), x64
Host adapter: WARP only (VICTORY_WARP=1 and VICTORY_D3D12_WARP=1; d3d10warp.dll 10.0.26100.9818); no physical GPU used.
victory-gpuonly honoursVICTORY_D3D12_WARPwith thediagnosticsfeature, so the run uses it; a test that prints its adapter reported "Microsoft Basic Render Driver".dxil.dll: Windows SDK 10.0.26100.0, version 1.8.2502.11 (via VICTORY_DXIL)
rustc/cargo: 1.98.1 (48a229cea 2026-09-01)
Base: main
63bcca43c6Head:
ed4812941e(fast-forwards onto main, no conflicts, 6 files)descriptor::host::tests::new_slots_wait_for_upload_unless_a_draw_brings_them_on,pool::tests::pieces_are_cut_from_blocks_older_than_the_lists_that_run,texture::tests::staging_limits_scale_for_small_memory_and_backlog,texture::tests::uploads_are_remembered_for_slot_visibility. They test the pure helpers. Nothing exercisesstaging_space, so the problem below is not caught.Review note (diff read, plus one throwaway probe):
VICTORY_TEXTURE_STAGE_MB/_MS) returns(u64::MAX, Duration::MAX)when neither is set, andslot_visibleis true wheneverVICTORY_SHOW_AFTERandVICTORY_SHOW_NEW_LATERare both off.VICTORY_TEXTURE_NO_WAITis off unless=1.texture::staging_space. The old loop moved to the next chunk and reset the cursor ((current, used) = (current + 1, 0)). The new loop searches every chunk with the one shared cursorc.usedand never resets it when a chunk is full. Onceused + size > CHUNKfor every existing chunk, the loop makes a new 32 MiB chunk, finds the cursor still too high, and makes another, with no end except the allocation failing. I checked this on the PR with a throwaway test (not committed, with an added cap so it could not run away): twostaging_space(20 << 20)calls in a row hit the cap at the sixth chunk instead of returning the second piece from a second chunk. It needs only one pass whose pieces add up to more than one chunk, which a texture pass does at the default settings. The cursor should be kept per chunk, or reset when the search moves on.small_memory()(a card of at most 8 GiB, or at most 16 GiB of RAM) lowers the kept staging buffers (64 to 16 MiB) and kept chunks (16 to 4), andVICTORY_RIPE_BLOCKSdefaults to 12. These change behaviour on such machines with nothing set, which the description does not say.bindless::uploadsstops at the limit afterrefresh_allhas already refreshed every texture in the pass;refreshhas already run on the skipped ones and may have recorded their new hash, so I did not confirm that they are uploaded on a later pass.AI-assisted (Claude). Aggregate counts only; no game files used.
@futurepro62 on GitHub · 2026-11-27 10:25 UTC · original
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
ed48129(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: 870 passed, 0 failed, 10 ignored.new_slots_wait_for_upload_unless_a_draw_brings_them_on,pieces_are_cut_from_blocks_older_than_the_lists_that_run,staging_limits_scale_for_small_memory_and_backlog,uploads_are_remembered_for_slot_visibility.--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
ed4812941etod3e557df93@legayclightning22 on GitHub · 2026-11-27 13:56 UTC · original
Thanks @oni-swr for catching the
staging_spacecursor issue! Pushedd3e557dfixingtexture::staging_space(crates/victory-gpu/src/texture.rs) so each chunk tracks its ownusedcursor rather than carrying a saturated offset across chunks, aligningbindlessbudget/hash checks (crates/victory-gpu/src/bindless.rs) so budget stops do not skip un-uploaded textures, and addingstaging_space_reuses_chunks_across_large_allocations. Re-verifiedvictory-gputests,clippy --all-targets --all-features -- -D warnings, andcargo xtask policy.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.