GPU: add AVX2 changed_runs, persistent wide_each pool, and async heap_buffers offload #95
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/95"
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 Biewlhenrique on 2026-11-26T18:20:07Z.
Exact, non-visual CPU/memory optimizations ported from our
VIctory-lnxfork ontoDexNom/VIctory(64bd58f5), preservingBufferPassincremental tracking,device_removeddiagnostics, Ray Tracing, and SparseTexture handling intact.Tested PC
32.0.16.2140)rustc 1.98.1 (48a229cea 2026-09-01)Changes
heap_bufferspass offload (VICTORY_HEAP_PASS_ASIDE=0runs inline for A/B comparison):SHADER_HEAPSincrates/victory-gpu/src/descriptor.rstoRwLockand addswith_heap.host::asideworker andHostList::{refreshes_coming, finish_coming}incrates/victory-gpu/src/host.rssoheap_buffer_passresolves buffer views off recording threads and splicesStep::Refreshsteps onHostList::close.changed_runs+ persistentwide_eachhelper (crates/victory-gpu/src/shadow.rs):_mm256_cmpeq_epi8) path forchanged_runs, keepingchanged_runs_scalaras fallback.wide_eachbacked by the persistentworkers()thread pool to avoid per-call thread creation overhead.Verification on this
DexNom/VIctorybranch (166ad43)cargo xtask policy→asset policy: 210 files okcargo test -p victory-gpu -- --test-threads=1→222 passed; 0 failed; 4 ignored(includinghost::aside::tests::what_is_found_is_waited_for_and_a_panic_lets_the_list_go_on,shadow::merge_tests::changed_runs_avx2_matches_scalar, andshadow::merge_tests::wide_each_preserves_order_and_sums_chunks)Before / After Benchmark Evidence (on our
VIctory-lnxdiagnostics build)draws >= 500)LAST10heap buffersfps18d,n=27, inlineheap_buffers)fps19d,n=29,VICTORY_HEAP_PASS_ASIDE=1)Representative log lines (heavy ~5k-draw scene)
Before (
fps18d):After (
fps19d):Imported from DexNom/VIctory. Originally posted by andrewDoing on 2026-11-26T22:43:40Z.
At the exact PR head tested:
At
166ad43, the extracted AVX2 changed-runs function matched scalar across 135,520 synthetic alignment, length and run-boundary cases. On 1 MiB buffers, scalar/AVX2 medians were 0.044/0.029 ms unchanged, 0.053/0.034 ms with 64 dirty bytes per 4 KiB, and 0.273/0.067 ms all changed. One static review concern: the new genericwide_eachappears unused outside its test, and its borrowed raw-pointer safety relies onwidealways joining; a caller-run job can unwind before the completion counter is decremented. I did not trigger unsafe behavior, and did not assess asynchronous heap offload.Verification was AI-assisted with GPT-6.2 Astra.
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.