perf: opt-in AVX2 changed-run detection #1233

Open
github-bot wants to merge 2 commits from github-bot/gh-1233 into main AGit
Owner

@⁠spk-c on GitHub · 2026-11-26 00:59 UTC · original
spk-c:submit/avx2-changed-runs → main · +131 −7 · 1 files · 2 commits · open

Summary

Opt-in VICTORY_CHANGED_RUNS_AVX2=1 with runtime feature detection and SSE2 fallback; preserves the existing changed-run mode selection. Includes unaligned and short-input parity test and an ignored manual release microbenchmark. Related open PR #1178 adds AVX2 to other shadow/merge helpers; this focuses on the changed-run scanner, and any interaction should be reviewed. No end-to-end FPS claim.

Validation

All CI steps passed for this isolated change against the corrected test baseline in the fork: https://github.com/spk-c/victory-fork/actions/runs/45731796714.

This submission is a single commit rebased onto upstream a183ea2; exact-revision upstream CI is pending. Upstream's pre-existing CI failures are addressed separately in #1228. Draft pending baseline and upstream review. AI-assisted.

Independent validation

UwUCammie's parity and microbenchmark report on Ryzen 7 9700X / Wine 11.22 / znver5: unaligned and short-input cases passed; 16 MiB median SSE2 to AVX2 times (µs): equal 1594→1260, sparse 6092→4738, dense 39525→45255, all changed 1114→868. Four first-room pairs on 9700X/RX 7900 XT in an integration build gave 9.05 vs 9.10 FPS overall; differences +0.07, +0.00, +0.08, +0.06 FPS. These are independent integration results, not proof of a universal speedup or exact-head gameplay validation. Dense-case regression supports retaining opt-in.

Refresh against upstream 52ac4ec

New head db46f83d4b8fb37b46d5fbbd7aa40edcdd0fdd08; the AVX2/SSE2 parity test for unaligned and short inputs passed. No new performance benchmark. Clean isolated workspace Cargo Check and strict all-feature Clippy passed. Original commits are preserved. PR-only diff check passed. Full upstream CI approval and source-size policy fix #1357 remain pending.

**@⁠spk-c** on GitHub · 2026-11-26 00:59 UTC · [original](https://github.com/fxceless/victory-fork/pull/1233) `spk-c:submit/avx2-changed-runs` → `main` · +131 −7 · 1 files · 2 commits · open ## Summary Opt-in `VICTORY_CHANGED_RUNS_AVX2=1` with runtime feature detection and SSE2 fallback; preserves the existing changed-run mode selection. Includes unaligned and short-input parity test and an ignored manual release microbenchmark. Related open PR #1178 adds AVX2 to other shadow/merge helpers; this focuses on the changed-run scanner, and any interaction should be reviewed. No end-to-end FPS claim. ## Validation All CI steps passed for this isolated change against the corrected test baseline in the fork: https://github.com/spk-c/victory-fork/actions/runs/45731796714. This submission is a single commit rebased onto upstream a183ea2; exact-revision upstream CI is pending. Upstream's pre-existing CI failures are addressed separately in #1228. Draft pending baseline and upstream review. AI-assisted. ## Independent validation [UwUCammie's parity and microbenchmark report](https://git.gtahub.st/github/fxceless--victory-fork/pulls/1233) on Ryzen 7 9700X / Wine 11.22 / znver5: unaligned and short-input cases passed; 16 MiB median SSE2 to AVX2 times (µs): equal 1594→1260, sparse 6092→4738, dense 39525→45255, all changed 1114→868. [Four first-room pairs](https://git.gtahub.st/github/fxceless--victory-fork/pulls/1233) on 9700X/RX 7900 XT in an integration build gave 9.05 vs 9.10 FPS overall; differences +0.07, +0.00, +0.08, +0.06 FPS. These are independent integration results, not proof of a universal speedup or exact-head gameplay validation. Dense-case regression supports retaining opt-in. ## Refresh against upstream 52ac4ec New head `db46f83d4b8fb37b46d5fbbd7aa40edcdd0fdd08`; the AVX2/SSE2 parity test for unaligned and short inputs passed. No new performance benchmark. Clean isolated workspace Cargo Check and strict all-feature Clippy passed. Original commits are preserved. PR-only diff check passed. Full upstream CI approval and source-size policy fix #1357 remain pending.
Isolated contribution based on a183ea2. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:00:04 +00:00
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-26 01:13 UTC · original

Ran the parity test and the release microbenchmark on a Ryzen 7 9700X under Wine 11.22, with -C target-cpu=znver5. The unaligned and short-input cases passed. For the 16 MiB inputs, median SSE2 → AVX2 time was 1,594 → 1,260 µs for equal bytes, 6,092 → 4,738 µs for sparse changes, 39,525 → 45,255 µs for dense changes, and 1,114 → 868 µs for all bytes changed. These are synthetic timings. The dense case is a reason to keep the switch available when measuring gameplay. Tested integration

**@⁠UwUCammie** on GitHub · 2026-11-26 01:13 UTC · [original](https://github.com/fxceless/victory-fork/pull/1233#issuecomment-7179559240) Ran the parity test and the release microbenchmark on a Ryzen 7 9700X under Wine 11.22, with `-C target-cpu=znver5`. The unaligned and short-input cases passed. For the 16 MiB inputs, median SSE2 → AVX2 time was 1,594 → 1,260 µs for equal bytes, 6,092 → 4,738 µs for sparse changes, 39,525 → 45,255 µs for dense changes, and 1,114 → 868 µs for all bytes changed. These are synthetic timings. The dense case is a reason to keep the switch available when measuring gameplay. [Tested integration](https://github.com/UwUCammie/victory-amd/tree/9f3a143)
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-26 01:31 UTC · original

I ran four first-room pairs on the 9700X / RX 7900 XT with this change in the gather-and-worker build. SSE2 gave 700 presents in 77.39 s (9.05 FPS). AVX2 gave 720 in 79.13 s (9.10 FPS). The four on-minus-off differences were +0.07, +0.00, +0.08 and +0.06 FPS. The AVX2 counter saw 929 MiB while enabled and zero while disabled.

The character and courtyard were visible at both checks. The sparse CPU fixture is quicker on this machine, but the first-room gain was small. Build, route and measurements

**@⁠UwUCammie** on GitHub · 2026-11-26 01:31 UTC · [original](https://github.com/fxceless/victory-fork/pull/1233#issuecomment-7179863577) I ran four first-room pairs on the 9700X / RX 7900 XT with this change in the gather-and-worker build. SSE2 gave 700 presents in 77.39 s (9.05 FPS). AVX2 gave 720 in 79.13 s (9.10 FPS). The four on-minus-off differences were +0.07, +0.00, +0.08 and +0.06 FPS. The AVX2 counter saw 929 MiB while enabled and zero while disabled. The character and courtyard were visible at both checks. The sparse CPU fixture is quicker on this machine, but the first-room gain was small. [Build, route and measurements](https://github.com/UwUCammie/victory-amd/blob/24bc001/benchmarks/README.md#avx2-changed-run-scan)
AI-assisted: keep original tested commit in history; local all-feature check, strict Clippy and focused synthetic tests passed. Upstream asset-policy baseline remains open (#1357).
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1233/head:github-bot/gh-1233'
git switch 'github-bot/gh-1233'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1233'
git switch 'github-bot/gh-1233'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1233'
git switch 'github-bot/gh-1233'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1233'
git switch 'main'
git merge --squash 'github-bot/gh-1233'
git switch 'main'
git merge --ff-only 'github-bot/gh-1233'
git switch 'main'
git merge 'github-bot/gh-1233'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.