GPU: the snapshot pool's limit can be raised with VICTORY_SNAPSHOT_POOL_MB #228
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/228"
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?
Imported from DexNom/VIctory. Originally posted by murillojndem on 2026-11-29T16:02:10Z.
The snapshot pool (
SnapshotPoolinshadow.rs) keeps at most 512 MiB of buffer capacity and 512 buffers. Each snapshot of a window outside buffers is a buffer of the whole 4 MiB window. When a dispatch's raw-address writes cannot be bounded, every visible window is declared written (memory::Writes::All), so with ray tracing on, one frame's snapshots need far more than the pool keeps.In a run on an RX 7900 XT with the ray-tracing builder running, the log shows:
Most snapshot buffers are allocated anew each frame and handed back to the system after the copy-back, so their pages are faulted in again every frame.
Change:
VICTORY_SNAPSHOT_POOL_MBsets the most bytes of buffer capacity the pool keeps at one time. The most buffers is one per MiB, at least 512.putto fields of the pool, so tests can set them.Measurement, synthetic and not from a title: a local benchmark took 256 buffers of 4 MiB a frame through the pool and copied 2 MiB into each, which is the run's proportions scaled down (512 MiB a frame, a pool an eighth of that). The benchmark is not part of this change.
The limit counts capacity held at one time, and each window's snapshot is a buffer of the whole 4 MiB, so the value that keeps a frame's snapshots is about 4 MiB per window alive. At the end of that run 1,896 windows were alive, which is about 7.6 GB. The default is left as it was; the variable is for runs that can spend the memory.
Tests:
the_pool_limits_come_from_megabytes_with_a_buffer_per_megabyte,a_larger_pool_keeps_every_window_of_a_frame,the_count_limit_holds_however_many_bytes_are_free.victory-gpu --lib: 222 passed, 0 failed, 4 ignored on WARP and on the RX 7900 XT (main: 219, 0, 4).cargo clippy -p victory-gpu --all-targets --locked -- -D warningsis clean with and without--all-features, andcargo xtask policypasses.Limits:
host.rs), which a large setting can bring about.VICTORY_WINDOW_KB) the count limit, one buffer per MiB, binds before the byte limit.shadow.rs; #20, #32 and #43 conflict with main already, without this change.Claude (Anthropic) wrote the change, the tests and the benchmark, and ran them on WARP and the RX 7900 XT under the adaptive GPU rules; an independent review checked the pool's paths.
Generated with Claude Code
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.