Heap pass: every buffer slot looked at once in N passes, a share at a time, not all in every Nth pass (VICTORY_HEAP_RESCAN_SPREAD=1, off by default) #1138
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1138
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1138"
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?
@exotiquee on GitHub · 2026-11-25 21:23 UTC · original
exotiquee:pr/heap-rescan-spread→main· +160 −11 · 3 files · 2 commits · openBranch
pr/heap-rescan-spreadonmainc36971b, two commits:VICTORY_HEAP_RESCAN_FRAMES(N, default 16 as before). This is a minimal prerequisite, after VItoriaBr 5a84eb4 (uiliannn), which uses 64 there. With the switch unset nothing changes. The heap-pass line names the interval.VICTORY_HEAP_RESCAN_SPREAD=1.What it does
The pass over the heap's buffer views (
State::heap_buffers) looks at the slots written since the last pass. Every 16th pass it looks at every buffer slot, because a view of a released resource goes stale without a write. We measured that full pass at 96.7 ms of one recording thread, every 16th frame.Spread, pass
plooks at:slot % N == p % N;Each slot is still looked at again as often as before (once in N passes). Entries of slots that left the set still go within N passes. No frame takes the whole look.
Not spread, the old branch is kept as it was (
pass_slots).Switch
VICTORY_HEAP_RESCAN_SPREAD=1, off by default.VICTORY_HEAP_RESCAN_FRAMES=N(default 16) sets N for both modes.How it was tested
cargo +1.98.1 test --locked -j 4 -p victory-gpu(WARP and RTX 5080 tests run automatically): 185 passed, 0 failed, 5 ignored. With--features diagnostics: 202 passed, 0 failed, 6 ignored (three clean runs of each).New test
draw::rescan_tests::every_buffer_slot_is_looked_at_once_in_n_passes, for N = 1, 16 and 64:Known flaky tests (also on plain
main):indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields(a WARP race);frame::tests::waits_end_on_ticks_and_count_frames(timing).The first run after the rebase onto
c36971b, while the machine was busy, also failedwatch::tests::a_view_mapped_beside_a_guarded_one_makes_it_check_again, the frame test andinplace::tests::warp_a_title_buffer_in_place_shows_its_bytes_at_its_offset. None of them is in code this PR touches. The next three runs of both suites were clean.What we measured (RTX 5080, Ryzen 7 9800X3D)
Risks
🤖 Generated with Claude Code
@Proudnoob4 on GitHub · 2026-11-25 22:16 UTC · original
AI-assisted testing (Gemini in OpenCode); measured locally on my own machine.
RTX 4080 / Windows 10 bundled test report (
d76af4b)Setup: Windows 10 Pro 22H2 (Agility SDK 1.620.2), i5-13600K, 32 GB RAM, RTX 4080 16 GB (driver 621.01), Series X profile, diagnostics release build (
9c184b3+#1138+ bundled perf PRs),VICTORY_HEAP_RESCAN_SPREAD=1(defaultVICTORY_HEAP_RESCAN_FRAMES=16).9c184b3with zero conflicts.every buffer slot every 16 passes, VICTORY_HEAP_RESCAN_FRAMES, a share in each pass (VICTORY_HEAP_RESCAN_SPREAD=1)), scanning ~20.5k–22.4k buffer slots/frame cleanly with0crashes,0device removals, and crisp world frames (frame-4096.png).fxnext_turbo, 330 s, 27 world lines): 8.50 fps median, 9.20 p90, 9.30 max,usual frame 113 ms,pass over textures 0.3 ms. (Isolated on/off A/B of#1138alone is unmeasured in this run.)View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.