fix: let VIctory scratch chunks replace older idle buffers #329
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!329
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-329"
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?
@mauroalvare on GitHub · 2026-11-26 03:35 UTC · original
mauroalvare:codex/victory-scratch-pool-lru→main· +200 −44 · 2 files · 1 commits · openChange
The command-list scratch pool in VIctory is enabled by default. It takes chunks by exact size, but once its 128 MiB idle pool filled with 4 MiB chunks, it also rejected every returned 256 KiB chunk. A shift to smaller lists could repeatedly allocate upload buffers even while most of the pool sat idle.
Keep recently returned chunks by evicting the oldest idle chunks as needed. The pool enforces its byte cap and releases evicted resources outside its mutex. Only chunks returned by a completed or discarded list enter the pool.
Verification
Windows x64 MSVC debug builds on the RTX 5070 Ti with driver 621.40. Baseline
c4c93bdc413191a9dc909998d2d53080a3f0c880carries the test and its module registration.Run from
third_party/victory.The fixture fills the pool with 32 large chunks, then submits six rounds of eight lists requesting 256 KiB each. Three fresh-process A/B pairs reproduced the base allocation assertion failing and the fix passing.
baseline-test.exe --test-threads=1fixed-test.exe --test-threads=1cargo test --locked --offline -j 2 -p victory-loader --test load_probecargo xtask policycargo test --release --manifest-path rust/Cargo.toml --locked --offline -j 1python -m pytest -rapython -m ruff check --select W605,F,E9 PrototypeScarlett tests toolsgit diff --checkThe full
victory-gpuruns used the captured Cargo test binaries. Three assertions reproduced on both builds.descriptor::host::tests::spans_say_the_next_start_and_the_lowest_level_viewedgotNonewhere it expectedSome(1).indirect::tests::warp_card_fetch_copies_flagged_pieces_to_their_slotsgot0where it expected1in the first result slot on WARP.indirect::tests::warp_card_patch_writes_the_masked_bytes_and_no_othersreported the first differing offsets at 0 through 7 on WARP.Oracle and test data
The test writes generated byte patterns into ranges allocated by
HostList::scratch, copies them to a read-back resource, and verifies every byte after submission completes. It resets the lists between rounds to exercise the real return path. D3D12 resource lifetime and fencesCodex provided AI assistance with the investigation, implementation, and validation.
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.