perf(gpu): use runtime-dispatched AVX2 non-temporal stores for large snapshot copies #552
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!552
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-552"
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?
@Glory-star on GitHub · 2026-11-28 00:40 UTC · original
pr/perf-avx2-snapshot-copy→main· +62 −1 · 1 files · 1 commits · closed without mergingProblem
take_snapshots()copies large write-watched buffer snapshots on worker threads usingstd::ptr::copy_nonoverlapping. For large ranges (>= 64 KiB), regular stores allocate destination cache lines (read-for-ownership DRAM traffic) and evict hot CPU state from L2/L3 cache.Fix
copy_snapshot_avx2(#[target_feature(enable = "avx2")]gated bystd::arch::is_x86_feature_detected!("avx2")) using 4x unrolled_mm256_loadu_si256+_mm256_stream_si256(VMOVNTDQ) with 32-byte destination alignment and_mm_sfence()for copies >= 64 KiB.x86_64-pc-windows-msvcrelease builds (no-C target-cpu=nativerequired) and falls back tocopy_nonoverlappingon non-AVX2 CPUs or copies < 64 KiB.Verification
snapshotstime in thepreparing per framebreakdown dropped from ~28.6 msspikes to0.0–0.3 msacross 20-minute gameplay sessions (0errors).cargo check -p victory-gpuwithoutRUSTFLAGS(generic x86-64 target).@Machad3x on GitHub · 2026-11-28 01:56 UTC · original
Tested in a batch on an RTX 3080 Ti + Ryzen 7 5700X, 1440p, DLSS Quality, title ray tracing on (VICTORY_BVH_BUILDER=1), 240 s runs into the prison cell scene. Batch: #552, #550, #548, #547, #544.
Result without #550: alive for the whole run, 67-70 ms/frame, no shader or pipeline refused, picture unchanged. No problem found in this PR.
Pull request closed