CLI: check for AVX2 before running a title (VICTORY_SKIP_CPU_CHECK=1 to bypass) #238
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!238
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/238/head"
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?
@dpalacios69 on GitHub · 2026-11-24 01:42 UTC · original
dpalacios69:feat/cpu-avx2-check→main· +73 −0 · 1 files · 1 commits · merged 2026-11-25 00:08 UTCvictory run --executeon a CPU without AVX2 currently starts the title and dies with0xc000001d(illegal instruction) at the title's first VEX instruction (seen here on a Xeon X5675, which has no AVX). The crash report does not say why. This adds a pre-flight check so the user gets a clear message before any title code runs. It does not touch the AMD-only instruction emulation (clzero, clwb, ...) in the loader.Change
apps/victory/src/run.rs(+73 lines, one file):--executeis passed (a plainrunwithout it is unaffected),run()checksis_x86_feature_detected!("avx2")and fails with: this CPU does not support AVX2, which Xbox Series titles require.VICTORY_SKIP_CPU_CHECK=1bypasses it, for people running under CPU emulation (e.g. Intel SDE). Only the exact value1bypasses.check_cpu_features_with) so it is tested without depending on the host CPU.Tests
4 new unit tests: AVX2 present passes; missing AVX2 fails with an error naming AVX2, Xbox Series and the env var (for unset,
"",0,true);=1bypasses; the real host check agrees with the detected feature.rustfmt --edition 2024 --check: clean.cargo clippy -p victory --tests(windows-msvc): 0 warnings.cargo xtask policy: ok.cargo test -p victory, cross-built forx86_64-pc-windows-msvcon Linux and run under Wine 11.21: 5 passed, 0 failed.Not tested
cfg(windows), like the rest ofrun.No game data used. AI-assisted (Claude Code).
@MisaXz on GitHub · 2026-11-24 02:27 UTC · original
Test report on real Windows with an AVX2 CPU (the description's runs were under Wine on a CPU without AVX2).
Tested
397005f(based2a4bae):cargo test --workspace --no-fail-fast: 268 passed, 0 failed, 4 ignored.cargo test -p victory: 5 passed, 0 failed, includingrun::tests::cpu_feature_check_matches_host, which here takes the "has AVX2" side on real hardware.Not tested
victory run --executeitself: no title was run (no game files used), so the check's place inrun()is covered by the unit tests only.AI use