Reserve configurable card-buffer room for late large allocations #1168
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!1168
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1168"
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?
@BradRoland on GitHub · 2026-11-25 22:33 UTC · original
BradRoland:codex/card-buffer-large-headroom→main· +279 −26 · 3 files · 1 commits · openWhen the minimum card-buffer size is set below 1 MiB, many small copies can fill the budget before large shader-written buffers appear. The RTX 4080 run in #1163 reported 17 large buffers in shared memory and 122.6 MB per frame of CPU shader-write comparisons at a 1 GiB cap.
This adds
VICTORY_CARD_BUFFERS_HEADROOM_MB(default0). With a sub-1 MiB minimum, small title buffers can consume card memory until their next 64 KiB-rounded allocation would spend that headroom. Title buffers at least 1 MiB long can use the whole cap. The reservation uses the combined live and in-progress total. A failed first allocation or a released copy returns its charge. The setting is documented besideVICTORY_CARD_BUFFERS_MIN_KB.A D3D12 WARP replay fills an 8 MiB budget with small buffers, then dispatches a shader against a late 2 MiB buffer. At zero headroom the large buffer used shared memory. The CPU snapshotted 2,097,152 bytes and compared 2,097,152 bytes. With 2 MiB reserved the large buffer stayed on the card and both counts fell to zero. Both runs charged exactly 8 MiB, returned
42to title memory, and released the full charge. Additional tests cover concurrent allocations, the one-byte-under-1-MiB boundary, and a synthetic sequence with large buffers allocated both early and late.The full Windows workspace passed 606 tests with thirteen ignored, including 204 diagnostics graphics tests. Reproduce the WARP replay with
cargo test --locked -p victory-gpu --features diagnostics late_large_buffer_keeps_its_headroom_and_shader_writes -- --nocapture. Gameplay FPS and the black-screen report in #1163 still need a matched title run. The change is AI-assisted and the fixtures are synthetic.@HAL9000RELOADED on GitHub · 2026-11-25 23:25 UTC · original
First Radeon run of
ccc06ed: RX 7900 XTX (RDNA3), driver 32.0.32015.7029, Windows 10 22H2 (19045), Agility SDK 1.620 (#402). Base:3151ccf(maind827419+ #402).victory-gpu: 186 passed, 1 failed.concurrent_reservations_charge_only_admitted_bytesandheadroom_protects_late_large_copies_after_an_early_large_allocationpass on the card.warp_budget_saturates_without_wraparound_and_preserves_draw_fields, the WARP test that #849 fixes, unrelated to this PR.--features diagnostics:late_large_buffer_keeps_its_headroom_and_shader_writespasses on the card too.@Proudnoob4 on GitHub · 2026-11-25 23:17 UTC · original · edited 2026-11-25 23:26 UTC
AI-assisted (Claude Opus 5.5 in OpenCode), measured on my own machine. This replaces two overlapping AI-written reports I posted here earlier; on re-auditing the logs, some of their numbers were single samples or misattributed, and one said there were no visual artifacts, which was wrong.
Setup: RTX 4080 16 GB, Windows 10 22H2, Series X build, diagnostics release, prison-cell scene (~4,800 draws/frame). Three single 360 s runs, so this is a bundle comparison, not an isolated A/B:
Marvisak/VIctory#2825native f16#1168+#1147+#1164(VICTORY_CARD_PIECE_KB=16) +#1171+#1172+ a local commit (skip cleancard_dirtycopies; chunk wide compare dispatches to ≤ 65,535 groups)all other lists), 2nd-half mediancardmeter, 256-frame mean, steadycardmeterunchanged). Which of C's additions gave the 8 ms is not isolated.For this PR: built and ran cleanly in C with
VICTORY_CARD_BUFFERS_MIN_KB=64 VICTORY_CARD_BUFFERS_MB=1536: 10,322 card buffers (1,681 MB) made over the run, no crash. Nothing here isolates this PR's headroom. An earlier note gave "3,513 MB free"; that was PC RAM, not video memory.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.