Repository navigation
gta6rt: --init/--run stop with a clear message on a host without AVX - #9754
sennecools wants to merge 1 commit into
Conversation
The game runs AVX code from its TLS callbacks on, so a CPU or OS without AVX (a QEMU qemu64 guest) died with a bare 0xC000001D. Check CPUID.1 AVX/OSXSAVE and XCR0 YMM state first, print one line and exit 4 (3 is LEONIDA_UNIMPLEMENTED=stop). --dry-run is unchanged and LEONIDA_SKIP_CPU_CHECK=1 skips the check. AI-assisted.
Grimkaaah
left a comment
There was a problem hiding this comment.
Independent review (Linux CPU) — PASS (code-only; Win host_cpu CTest not run)
Checked
- New
host_cpupreflight for--init/--run: AVX + OSXSAVE + XCR0 YMM; exit 4 with a clear missing-feature line;LEONIDA_SKIP_CPU_CHECK=1/ Rosetta note documented; synthetichost_cpu_test+ CMake/ps1 wiring. - Diff is focused and the synthetic-CPUID test design is sound.
Not executed here: Windows host_cpu CTest / gta6rt without AVX.
No game files. Reviewer: Grimkeh (AI-assisted Cursor / Composer).
catminou4
left a comment
There was a problem hiding this comment.
Partial verification on macOS 26 arm64 (Apple clang 21, no cmake/GPU here): compiled runtime/src/host_cpu.cpp standalone and ran a harness replicating every pure-function case from runtime/test/host_cpu_test.cpp (AVX/OSXSAVE/XCR0 decision table + the one-line message contents) — all passed. The PR's own host_cpu_test.cpp includes <windows.h> and SetEnvironmentVariableA, so it needs the Windows lane; main.cpp/CMake integration likewise unverified by me. The core logic looks right: XGETBV is correctly gated behind OSXSAVE, and the Rosetta note matches the header comment. AI-assisted (Devin).
|
CPU-only review of This covers the preflight and its wiring before mapping in the source. It does not run the native Windows executable or a real no-AVX host. Review and verification by OpenAI Codex, with synthetic inputs only. |
|
Closing: pull requests on Leonida are now limited to ProjectLeonida members. Thanks for the contribution. |
Claimed in the coordination issue as: RT-NEW-AVX-PREFLIGHT (#9522 (comment)), from NolanCotter's finding in #9235
Depends on: none. It touches the same lines as #9197 (AVX2/FMA/BMI2 check, only in a
-DLEONIDA_AVX2build), #9477, #7111 and #8537 (main.cppincludes) and #9339, #9666 (build_runtime.ps1file list): whichever lands second re-adds one line.What and why
The game runs AVX code from its TLS callbacks on. On a host without AVX (a QEMU
qemu64guest) it died with a bare0xC000001D, which reads like a loader bug.--initand--runnow check CPUID.1 AVX/OSXSAVE and the XCR0 YMM state before anything is mapped; XGETBV runs only when OSXSAVE is set. On failure they print one line naming what is missing (and suggest QEMU-cpu host, orROSETTA_ADVERTISE_AVX=1under Rosetta) and exit 4, since 3 isLEONIDA_UNIMPLEMENTED=stop.LEONIDA_SKIP_CPU_CHECK=1skips it;--dry-runnever runs it. AVX only: no emulation (RT-500) and no AVX2/FMA (#9197, which could reusemissing_host_features).runtime/README.mdanddocs/boot.mddescribe it.Tested
host_cpu_test(new): 9 blocks on synthetic CPUID/XCR0 words and the skip variable, passes;ctest -R ^host_cpu$1/1.gta6rt --initon an AVX host passes the check. The exit-4 path is covered by the unit test only.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (not a translator change)