CLI: check for AVX2 before running a title (VICTORY_SKIP_CPU_CHECK=1 to bypass) #238
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/238"
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 Marvisak/VIctory. Originally posted by dpalacios69 on 2026-11-24T01:42:41Z.
victory 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).
Imported from Marvisak/VIctory. Originally posted by MisaXz on 2026-11-24T02:27:08Z.
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
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T09:43:28Z.
Review: APPROVED
Tested
397005fon Windows 11, RTX 5070, MSVC: the workspace passes (199 outsidevictory-shader;victory-shader --libsingle-threaded: 69), including the four new CPU-check tests and the host check.--execute, before any title code, sovictory runwithout it, andinspect/translate, still work on any CPU.is_x86_feature_detected!("avx2")is the right probe, since Zen 2 titles use VEX/AVX2 freely."1"bypass for emulators such as Intel SDE is a reasonable escape hatch. Putting the decision incheck_cpu_features_withlets the tests run regardless of the host CPU.No issues found.
AI-assisted (Claude Code).