Repository navigation
Run the llama.cpp keep-install back-compat tests on Windows - #10106
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e398482fb3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if WINDOWS_HOST: | ||
| path.write_bytes(RUNNABLE_STUB if ok else b"not a PE image\n") |
There was a problem hiding this comment.
Keep Windows-native probes on executable-suffixed paths
On the new Windows runner, test_a_rotten_root_entrypoint_is_caught_even_when_build_bin_is_fine still builds its tree with the default simulated LINUX host, so these PE bytes are written to extensionless llama-server paths. Windows process resolution appends .exe when launching such a command, cannot find the extensionless fixture, and raises FileNotFoundError; _binary_image_runs deliberately treats that non-193 OSError as healthy. Consequently the rotten-root assertion remains True and the newly added Windows workflow fails consistently. Run this bad-image case with a Windows-shaped host/path or otherwise ensure the native probe launches the actual fixture.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The prediction is testable and it did not hold, so no change here. parity (windows-latest) on this PR passed in 2m24s, and the run log shows the file collected and executed rather than skipped:
SKIPPED [1] tests\studio\install\test_keep_install_backcompat_9979.py:516: os.access(X_OK) is always true on Windows, so the guard is POSIX only
611 passed, 3 skipped in 79.47s
That single skip is the labelled X_OK case, so the other 95 cases in the file ran natively, test_a_rotten_root_entrypoint_is_caught_even_when_build_bin_is_fine among them.
The mechanism assumed does not apply. CreateProcess appends .exe when resolving a bare name, but subprocess is handed a fully qualified path to a file that exists, and the literal path resolves first. The non-PE bytes then produce the intended ERROR_BAD_EXE_FORMAT, _binary_image_runs rejects the image, and the assertion holds. FileNotFoundError would need the path itself to be absent.
Worth noting the check that matters here is the one you point at indirectly: a green Windows job with the file silently skipped would be a false pass, which is why the job runs with -rs and why I read the summary rather than the conclusion.
| copy = Path(probe_dir) / "llama-server.exe" | ||
| try: | ||
| shutil.copyfile(source, copy) | ||
| subprocess.run([str(copy)], capture_output = True, timeout = 30) |
There was a problem hiding this comment.
Reject loader failures while vetting the runnable stub
If a copied candidate can be created but terminates with a Windows loader status such as 0xC0000135, subprocess.run returns a CompletedProcess rather than raising, so this probe accepts the bytes despite the helper's promise that they were verified runnable. That is precisely the missing-DLL failure described in the docstring; subsequent healthy fixtures then inherit the broken image and are rejected by _binary_image_runs, making the Windows row fail for the fixture rather than the product. Check the returned status for NTSTATUS loader failures before returning the candidate.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fair: the docstring promised the candidate was verified runnable and the code only verified that it started. Fixed in 6cd7207 by checking the status before accepting the bytes.
if probe.returncode >= 0xC0000000:
continueIn practice the current candidates are System32 tools whose imports are all KnownDLLs, so this has not fired, and the Windows row is green either way. Tightening it anyway because the gap was between the comment and the code, and a future candidate is exactly where that bites.
| # studio-backend-ci runs tests/studio/install on ubuntu only, so the windows | ||
| # row here is the sole place the keep path meets a real loader. | ||
| - 'tests/studio/install/test_keep_install_backcompat_9979.py' |
There was a problem hiding this comment.
Trigger Windows coverage for imported installer dependencies
The added path filter only triggers for this test file or studio/install_*.py, but the loaded installer directly depends on studio/prebuilt_core.py and studio/backend/utils/prebuilt/llama_backend.py; neither path matches either the pull-request or push filter. A change confined to those dependencies therefore receives only the existing Ubuntu execution from studio-backend-ci.yml, and the new native Windows loader coverage is silently skipped even though those modules supply installer behavior used by this test. Add the imported dependency paths to both filter blocks.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Correct, fixed in 6cd7207. install_llama_prebuilt.py imports both at module scope:
import prebuilt_core as _core # noqa: E402
from backend.utils.prebuilt.llama_backend import ( # noqa: E402so a change confined to either would have left this row unrun while still changing what it covers. Both paths added to the pull_request and push blocks.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
studio-backend-ci.ymlrunstests/studio/install/onubuntu-latestonly, both jobs. The keep-path back-compat matrix added in #9979 simulates Windows by injectingHostInfo(is_windows=True)on Linux, which is the right pattern for the path decisions and payload tables but proves nothing about the Windows loader. So the installer keep path is currently unverified on Windows rather than verified working.Running those files on a real
windows-latestrunner produced 76 failures: 43 intest_install_llama_prebuilt_logic.pyand 33 intest_keep_install_backcompat_9979.py.The two failure classes are not the same thing
A fixture artifact.
build_installwrites#!/bin/sh\nexit 0\ninto a file namedllama-server.exe. Windows refuses it withERROR_BAD_EXE_FORMAT,_binary_image_runscorrectly reports "not an executable image", and every healthy-install case fails. The fixture is wrong here, not the product.A real platform difference.
os.access(path, os.X_OK)returns true for any file that exists on Windows, andos.chmodcannot clear an execute bit Windows does not have. So theexecutable=Falsetrees are indistinguishable from healthy ones there, and theX_OKgate in_existing_install_runsdoes nothing on that platform. That gets labelled, not silently skipped.Changes
tests/studio/install/test_keep_install_backcompat_9979.py:_binary_image_runsthen sees a genuineERROR_BAD_EXE_FORMATfromCreateProcessinstead of a stubbedrun_capture. That branch and the0xC0000135one are structurally unreachable on Linux:OSError.winerrordoes not exist there, and a POSIX exit status cannot reach0xC0000000.python.exealone would losepython3xx.dlland die0xC0000135, hence a System32 tool whose imports are all KnownDLLs. If no candidate starts, the module skips with a clear reason instead of reporting the loader's refusal as a back-compat failure.executable=Falsecase is skipped on Windows, reusing the reason already intest_install_whisper_prebuilt_logic.py:.github/workflows/cross-platform-parity-ci.yml:paths:blocks.Why this workflow, and why only this file
The parity job is already
windows-latest, already capped at 10 minutes, already installs a superset of what these tests need, already runs with-rsso a silently skipped case is visible, and itspaths:filter already includesstudio/install_*.py, so the module under test triggers it today. Its Windows row runs in about 1m40s. Every other Windows job in the repo is a full-install smoke test measured in tens of minutes.test_install_llama_prebuilt_logic.pyis deliberately left out. It has 11 symlink sites, 22 shebangs and tests that shell out tobash(which onwindows-latestresolves to a WSL stub), and it already carries per-case Windows guards. It is POSIX by design and forcing it onto Windows is a large fight for little signal.What this still does not prove
Worth being precise, because the point of the change is to stop overstating coverage. Still unverified on real Windows after this: DLL and cudart loading and the
0xC0000135path, ACL and denied-file semantics,binary_env'sPATHconstruction (on Linuxos.pathsepis":", so the Windows branch builds a colon-joined PATH and asserts nothing about the real one), NTFS case-insensitiveglobin_runtime_payload_has, and long-path.exists()behaviour.The narrow claim: the keep-path back-compat matrix runs for real on Windows, and bad-image rejection is genuinely exercised there.
Verification
Linux is unchanged, 96 passed before and after with zero new skips. The parity job's own suite plus this file: 174 passed.
The Windows row wants reading rather than trusting once this is up. A green job with the file silently skipped is a failure, not a pass; the
-rssummary should show only the labelledX_OKcase.