mirror of
https://github.com/4ld0-vito/victory-gta6.git
synced 2026-11-26 21:30:45 +01:00
[PR #2] Perf Phase 7: BlockRuns absent/protect coalescing, lazy HeapCache shrink, O(N) TextureQueue #1
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
4ld0/victory-gta6#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/4ld0-vito/victory-gta6/pull/2
Author: @4ld0-vito
Created: 11/24/2026
Status: 🔄 Open
Base:
work← Head:perf/phase-7-guards-heap📝 Commits (2)
0d0bc22Phase 7 perf: BlockRuns absent + coalesced protect + hot-block hysteresis, lazy HeapCache shrink, O(N) TextureQueue335192fPhase 7b perf: opt-in VICTORY_GUARD_HOT, batched card_before barriers, reuse merge scratch📊 Changes
5 files changed (+368 additions, -124 deletions)
View changed files
📝
crates/victory-gpu/src/descriptor/host.rs(+77 -22)📝
crates/victory-gpu/src/draw.rs(+39 -22)📝
crates/victory-gpu/src/host.rs(+38 -40)📝
crates/victory-gpu/src/shadow.rs(+14 -10)📝
crates/victory-gpu/src/watch.rs(+200 -30)📄 Description
Summary
Phase 7 CPU optimizations on
perf/phase-7-guards-heap(0d0bc22, branched fromwork):crates/victory-gpu/src/watch.rs:Guards::absent: BTreeSet<usize>with interval-mergingBlockRunsand per-frameabsent_checkedcaching (!cfg!(test) && frame > 0), plus clearing intitle_memory_remapped.VirtualQuery-guided span coalescing inprotect()when a multi-blockVirtualProtectfails across view boundaries/holes (recording only wholly uncommitted blocks intoabsent).VICTORY_GUARD_HOT, toggleable with=0) leaving blocks faulted >= 2x in one frame writable until the next frame.coalesced_protect_and_hot_block_hysteresis.crates/victory-gpu/src/draw.rs:refcounts,needs_shrink, andlast_rebuild_frametoHeapCacheinState::heap_buffersso slot changes only delete a shadow when refcount reaches 0 and defer shrink rebuilds to every 64 frames.crates/victory-gpu/src/descriptor/host.rs&draw.rs:TextureQueue::due+censusinto single-passTextureQueue::due_with_census, usingselect_nth_unstable_by(O(N) selection instead of O(N log N) full sort), and loweredheap_texturesbatch limit4096 -> 512.Verification & Benchmarks (Xbox Series X profile, RTX 4070 12 GB, 32 GB RAM)
cargo test -p victory-gpu: 115 passed, 0 failed, 1 ignoredcargo build --release: succeeded with 0 errorsspeed16_p7_1080p(210 s,VICTORY_DISPLAY_MODE=1920x1080,HEAP_TEX_MS=2):69.0 ms/frameat 580 draws,13.9 fpsat 568 draws) vs13.3 fpsinspeed14_p6_1080p.heap buffersimproved from16–47 ms(speed14) down to10.1–16.0 mson steady frames.VICTORY_GUARD_HOT=1: Leaving hot 64 KiB blocks writable across all ~63 submissions/frame caused copied MB to double from118–147 MB(speed14) to197–338 MB(copies 57–89 ms), offsetting the guard savings on heavy 3k–4.5k draw frames (4.1–7.3 fps, GPU busy68–69%).speed17_p7_720p(180 s,VICTORY_DISPLAY_MODE=1280x720,HEAP_TEX_MS=2):preparing72–129 ms,copies45–83 ms / 150–280 MB,copying back40–73 ms, GPU busy58–69%). Shows resolution is no longer the primary cap until CPUpreparing(~90–120 ms),copying back(~60–75 ms), and GPU barrier/clamp overhead drop substantially.Next (Phase 8 candidates)
VICTORY_GUARD_HOTdefault OFF (keep theBlockRunsabsent+ coalescedprotect()+HeapCache+TextureQueuewins without theVICTORY_GUARD_HOTcopy-MB inflation).diagbuild) and attack the true ~100 mspreparing+ ~70 mscopying back+ ~58–69% GPU pipeline/barrier stalls.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.