victory-simd: AVX2 kernels for changed_runs and the DSP convolution #4473
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!4473
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4472"
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?
@kewb on GitHub · 2026-11-30 20:46 UTC · original
kewb:avx2-acceleration→main· +2293 −873 · 48 files · 14 commits · closed without mergingWhat it changes
New crate
victory-simd: AVX2 kernels with a scalar reference beside each, chosen once at run time.shadow::changed_runs: byte scans 32 bytes per compare. Same runs as before.dsp::convolve: multiply-accumulate, FFT butterflies and output scaling on AVX. Bit-exact to the scalar code; FMA is opt-in.VICTORY_SIMD=auto|baseline|avx2,VICTORY_SIMD_MEMORY=0,VICTORY_SIMD_AUDIO=0,VICTORY_SIMD_FMA=1,VICTORY_SIMD_VERIFY=1(seedocs/simd.md).Shadow::rangedand copystatmbremoved,Fft::runtest-only, two lint fixes.#[ignore = "benchmark"]) for a convolution block and the byte scans.How it was tested
cargo clippyboth CI gates,-D warnings: clean.cargo test -p victory-simd: every kernel against its reference (all lengths to a few vectors, unaligned starts, special floats).cargo test -p victory-hle --lib convolve,cargo test -p victory-gpu --lib changed_runs: same output bit for bit on both kernel sets.VICTORY_SIMD_VERIFY=1(scalar code run beside every AVX2 call): AVX2 kernels active for memory and audio, and their output matched the scalar code exactly on every call.@IRennie74 on GitHub · 2026-11-30 22:38 UTC · original
Two notes:
#[allow(dead_code, ...)]onLowered::loop_capsincrates/victory-shader/src/emit/lower.rsis code, not a comment, so it changes the translator fingerprint (crates/victory-gpu/build.rshashesvictory-shader/srcwithout comments). Merging it re-translates every user's shader cache, plus several minutes of warming pipelines again. It is needed for the clippy gate, but it would be worth bundling it with the next real translator change, or saying so in the release notes. (Addingvictory-simdtoCargo.lockis fine: onlyvictory-shader's own lock entries are hashed.)changed_runsalready compared equal stretches 512 and 8 bytes at a time with slice==, which compiles to a vectorisedmemcmp, so most of the gain should be in the differing runs. On a Ryzen 5 5600X + RTX 3060 (Series S, DLSS Performance), merging the title's bytes under flights' writes costs 3-4 ms a frame on a submitting thread that is busy 44-54 ms of a 55-58 ms frame. A before/after of that stage in a game run would show whether the byte scans are a real part of it.@trustno1-coder on GitHub · 2026-12-01 18:41 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed