[PR #3778] [Other] isolate cached engine vision tests from host CPU #4775

Open
opened 2026-11-07 15:38:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3778
Author: @BColsey
Created: 10/22/2026
Status: 🔄 Open

Base: main ← Head: fix/setup-choices-isa-floor


📝 Commits (1)

  • 358d8ef [Other] isolate cached engine vision tests from host CPU

📊 Changes

1 file changed (+23 additions, -5 deletions)

View changed files

📝 tools/test_setup_choices.py (+23 -5)

📄 Description

Problem and result

The cached-engine vision tests read the real host CPU while their fake engine stamps describe the normal AVX2 build. On an AVX-only host, setup correctly rejects that cache: the CUDA tests try to copy an engine their fake build never created, and the HIP tests escape to real ROCm acquisition. This test-only change models the CPU and matching ISA stamp explicitly and rejects unexpected external commands.

Refs #1935. Reproduced while validating #2769; kept separate because the setup fixtures are an independent problem.

Approach

Update only tools/test_setup_choices.py. Cover matching normal, AVX, and SSE4.2 engine stamps for the cached vision paths. Mock CPU capabilities and the ISA override together, and fail immediately if the tests attempt an external command or ROCm acquisition. Production setup logic and its ISA compatibility guards are unchanged.

Validation

Revision: 358d8efd60565ebf99ba5bd3bea25ef93e0ce926, based on main 011c9e600a93bbc9fd451c563501b5831c32bbca. Linux x86-64; Intel Xeon E5-2690 v2 (AVX, no AVX2); Python 3.12.3. Tests ran without a GPU, compiler execution, or downloads.

Passed:

PYTHONDONTWRITEBYTECODE=1 /usr/bin/python3.12 -m unittest \
  tools.test_setup_choices tools.test_setup_pins serve.test_family_name

79 tests passed, including the new older-CPU cached-engine regression. The unmodified main revision ran 78 tests with four errors in the two CUDA vision subtests and two HIP vision tests.

PYTHONDONTWRITEBYTECODE=1 /usr/bin/python3.12 -m unittest \
  tools.test_setup_oldcpu tools.test_setup_stale_stamp tools.test_setup_engine_keep

20 tests ran: 19 passed and one Windows-only CPUID check was skipped.

STRATA_ISA_FLOOR=none PYTHONDONTWRITEBYTECODE=1 /usr/bin/python3.12 -m unittest \
  tools.test_setup_choices.HipVision tools.test_setup_choices.CudaVision
git diff --check

Five tests passed under the ambient ISA override; the fixtures select their own modeled environment. Whitespace check passed.

Failed: None after the fix. The four original errors were reproduced before editing.

Not run: Windows-only CPUID execution and the complete repository suite. No engine/backend builds were needed for this test-only change.

Limits

This fixes the reproduced vision-fixture host dependence. It does not change engine acquisition, CPU detection, or runtime behavior, or claim to fix every host-dependent test mentioned in #1935.


🔄 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/Niko1221/Strata/pull/3778 **Author:** [@BColsey](https://github.com/BColsey) **Created:** 10/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/setup-choices-isa-floor` --- ### 📝 Commits (1) - [`358d8ef`](https://github.com/Niko1221/Strata/commit/358d8efd60565ebf99ba5bd3bea25ef93e0ce926) [Other] isolate cached engine vision tests from host CPU ### 📊 Changes **1 file changed** (+23 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `tools/test_setup_choices.py` (+23 -5) </details> ### 📄 Description ## Problem and result The cached-engine vision tests read the real host CPU while their fake engine stamps describe the normal AVX2 build. On an AVX-only host, setup correctly rejects that cache: the CUDA tests try to copy an engine their fake build never created, and the HIP tests escape to real ROCm acquisition. This test-only change models the CPU and matching ISA stamp explicitly and rejects unexpected external commands. ## Related discussion Refs #1935. Reproduced while validating #2769; kept separate because the setup fixtures are an independent problem. ## Approach Update only `tools/test_setup_choices.py`. Cover matching normal, AVX, and SSE4.2 engine stamps for the cached vision paths. Mock CPU capabilities and the ISA override together, and fail immediately if the tests attempt an external command or ROCm acquisition. Production setup logic and its ISA compatibility guards are unchanged. ## Validation Revision: `358d8efd60565ebf99ba5bd3bea25ef93e0ce926`, based on main `011c9e600a93bbc9fd451c563501b5831c32bbca`. Linux x86-64; Intel Xeon E5-2690 v2 (AVX, no AVX2); Python 3.12.3. Tests ran without a GPU, compiler execution, or downloads. **Passed:** ```sh PYTHONDONTWRITEBYTECODE=1 /usr/bin/python3.12 -m unittest \ tools.test_setup_choices tools.test_setup_pins serve.test_family_name ``` 79 tests passed, including the new older-CPU cached-engine regression. The unmodified main revision ran 78 tests with four errors in the two CUDA vision subtests and two HIP vision tests. ```sh PYTHONDONTWRITEBYTECODE=1 /usr/bin/python3.12 -m unittest \ tools.test_setup_oldcpu tools.test_setup_stale_stamp tools.test_setup_engine_keep ``` 20 tests ran: 19 passed and one Windows-only CPUID check was skipped. ```sh STRATA_ISA_FLOOR=none PYTHONDONTWRITEBYTECODE=1 /usr/bin/python3.12 -m unittest \ tools.test_setup_choices.HipVision tools.test_setup_choices.CudaVision git diff --check ``` Five tests passed under the ambient ISA override; the fixtures select their own modeled environment. Whitespace check passed. **Failed:** None after the fix. The four original errors were reproduced before editing. **Not run:** Windows-only CPUID execution and the complete repository suite. No engine/backend builds were needed for this test-only change. ## Limits This fixes the reproduced vision-fixture host dependence. It does not change engine acquisition, CPU detection, or runtime behavior, or claim to fix every host-dependent test mentioned in #1935. --- <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 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
Niko1221/Strata#4775
No description provided.