host_cpu: move gta6rt's AVX preflight decision into a testable preflight() #183

Open
github-bot wants to merge 1 commit from github-bot/gh-183 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:37 UTC · original
ubiquitarianism:old-pr/9915 → main · +58 −5 · 4 files · 1 commits · draft

Carried over from old PR 9915 by Sunkiller-qc in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9915, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Sunkiller-qc: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Thanks for ad6e5d6, the clear AVX message is a real improvement. The decision in wmain (only --init/--run, LEONIDA_SKIP_CPU_CHECK, the message and exit code 4) wasn't reachable from a test, so this moves it into rt::host_cpu::preflight() with an injectable feature source and adds cases to host_cpu_test. Behaviour is unchanged.

Not built or run on my side.

**@⁠Andretuta** on GitHub · 2026-11-24 02:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/183) `ubiquitarianism:old-pr/9915` → `main` · +58 −5 · 4 files · 1 commits · draft > Carried over from **old PR 9915** by `Sunkiller-qc` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9915`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Sunkiller-qc`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Thanks for ad6e5d6, the clear AVX message is a real improvement. The decision in wmain (only --init/--run, LEONIDA_SKIP_CPU_CHECK, the message and exit code 4) wasn't reachable from a test, so this moves it into `rt::host_cpu::preflight()` with an injectable feature source and adds cases to host_cpu_test. Behaviour is unchanged. Not built or run on my side.
Follow-up to ad6e5d6. The check itself was tested, but the decision in
gta6rt's wmain (only --init/--run, LEONIDA_SKIP_CPU_CHECK=1, the message and
exit code 4) lived inline in main.cpp, where no test reaches it.

rt::host_cpu::preflight(starts_game, skipped, missing, error) now makes that
decision with an injectable feature source, and preflight(starts_game, error)
binds it to the running host. wmain prints the returned line and exits with
the returned code; behaviour is unchanged (--dry-run still reads neither the
CPU nor the environment). host_cpu_test covers --dry-run, the skip, a host
without AVX, an AVX host and a null error pointer.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:47:56 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/183/head:github-bot/gh-183'
git switch 'github-bot/gh-183'

Merge

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