[PR #1311] host_cpu: move gta6rt's AVX preflight decision into a testable preflight() (OLD-9915) #1341

Open
opened 2026-11-26 20:20:55 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1311
Author: @ambroseautomation
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: carry/old-9915-host-cpu-preflight


📝 Commits (1)

  • 6bb8113 host_cpu: move gta6rt's AVX preflight decision into a testable preflight()

📊 Changes

4 files changed (+58 additions, -5 deletions)

View changed files

📝 runtime/src/host_cpu.cpp (+15 -0)
📝 runtime/src/host_cpu.h (+7 -0)
📝 runtime/src/main.cpp (+4 -5)
📝 runtime/test/host_cpu_test.cpp (+32 -0)

📄 Description

Summary

Coordination item: OLD-9915 (carry-forward of old-pr/9915, preserving original author Sunkiller-qc).

Problem & Root Cause

gta6rt's AVX / host CPU preflight decision (checking missing ISA features, respecting dry_run, and formatting the refusal message) lived inline in runtime/src/main.cpp, so it could not be unit-tested directly against synthetic feature masks.

Implementation

  • Moves the preflight decision into host_cpu::preflight(...) in runtime/src/host_cpu.h and runtime/src/host_cpu.cpp, returning whether startup should proceed and any refusal message.
  • Updates runtime/src/main.cpp to call host_cpu::preflight(...).
  • Extends runtime/test/host_cpu_test.cpp to test preflight() directly across synthetic feature combinations and dry_run modes.

Tests Run

Environment: Windows 11 Pro 64-bit, Visual Studio 18 Community (cl.exe x64, /std:c++20 /W4 /WX).

  • cl /nologo /std:c++20 /EHsc /W4 /WX /Iruntime/src runtime/test/host_cpu_test.cpp runtime/src/host_cpu.cpp + host_cpu_test.exe — PASS (host: 0 missing feature(s), host_cpu_test: all passed)
  • .\scripts\build_runtime.ps1 -jobs 8 — PASS (runtime/build/gta6rt.exe built cleanly)
  • python -I scripts/check_no_game_data.py runtime/src/host_cpu.cpp runtime/src/host_cpu.h runtime/src/main.cpp runtime/test/host_cpu_test.cpp — PASS

Disclosure

AI-assisted: yes (carry-forward, rebase onto current main, and local MSVC build/test verification; original implementation by Sunkiller-qc).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1311 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-9915-host-cpu-preflight` --- ### 📝 Commits (1) - [`6bb8113`](https://github.com/ubiquitarianism/leonida/commit/6bb8113987a03f1e784204e7e653e56c181dd6b3) host_cpu: move gta6rt's AVX preflight decision into a testable preflight() ### 📊 Changes **4 files changed** (+58 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `runtime/src/host_cpu.cpp` (+15 -0) 📝 `runtime/src/host_cpu.h` (+7 -0) 📝 `runtime/src/main.cpp` (+4 -5) 📝 `runtime/test/host_cpu_test.cpp` (+32 -0) </details> ### 📄 Description ## Summary Coordination item: `OLD-9915` (carry-forward of `old-pr/9915`, preserving original author `Sunkiller-qc`). ### Problem & Root Cause `gta6rt`'s AVX / host CPU preflight decision (checking missing ISA features, respecting `dry_run`, and formatting the refusal message) lived inline in `runtime/src/main.cpp`, so it could not be unit-tested directly against synthetic feature masks. ### Implementation - Moves the preflight decision into `host_cpu::preflight(...)` in `runtime/src/host_cpu.h` and `runtime/src/host_cpu.cpp`, returning whether startup should proceed and any refusal message. - Updates `runtime/src/main.cpp` to call `host_cpu::preflight(...)`. - Extends `runtime/test/host_cpu_test.cpp` to test `preflight()` directly across synthetic feature combinations and `dry_run` modes. ## Tests Run Environment: Windows 11 Pro 64-bit, Visual Studio 18 Community (`cl.exe` x64, `/std:c++20 /W4 /WX`). - `cl /nologo /std:c++20 /EHsc /W4 /WX /Iruntime/src runtime/test/host_cpu_test.cpp runtime/src/host_cpu.cpp` + `host_cpu_test.exe` — PASS (`host: 0 missing feature(s)`, `host_cpu_test: all passed`) - `.\scripts\build_runtime.ps1 -jobs 8` — PASS (`runtime/build/gta6rt.exe` built cleanly) - `python -I scripts/check_no_game_data.py runtime/src/host_cpu.cpp runtime/src/host_cpu.h runtime/src/main.cpp runtime/test/host_cpu_test.cpp` — PASS ## Disclosure AI-assisted: yes (carry-forward, rebase onto current `main`, and local MSVC build/test verification; original implementation by Sunkiller-qc). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1341
No description provided.