Repository navigation
ci(install): assert host detection on all three platforms, not just the one - #3748
Merged
Merged
Conversation
…he one
`carl-install-smoke` is our only install check and it is `runs-on:
ubuntu-latest` with no matrix. So the install path is verified on exactly one
platform — and in one night every detect_host bug found on the other two was
invisible to it:
- Windows 11 24H2 REMOVED `wmic`, so the RAM arm fell through to its else
branch and recorded IC_RAM_MIB=0 on a machine with 64914 MiB. Every
downstream tier decision then ran on that zero, silently (#3739).
- The Intel-Mac arm builds llama-server CPU-only because a Metal build hangs
that hardware uninterruptibly — and nothing recorded that as the host's
serving PLAN, so the backend receipt refused a healthy node and advised
reinstalling with Metal, which would have hung it again (#3729 → #3740).
- The Linux/WSL RAM arm still turns an unreadable /proc/meminfo into 0 with no
warning: the same defect as the Windows one, on the platform CI DOES run,
unnoticed because nothing asserted the value.
Each was a detect_host fact being WRONG rather than missing, on a platform its
author could not run. Three operators, three boxes, and the shared CI checking
the tier none of them installs on.
NOT A MATRIX ON carl-install-smoke: that job is Docker-based and ~30 minutes.
`install-common.sh` is sourceable and `ic_detect_hardware` is a pure probe of
the machine it runs on, so a per-platform leg needs no Docker, no images and no
registry auth — seconds, not half an hour. The Docker smoke stays the Linux
end-to-end check; this is the cross-platform truth check.
Assertions are about SHAPE, not hardware. A CI runner is none of our boxes and
a test expecting an M5 or a 5090 fails for the wrong reason. What must hold
everywhere is that the detector produced a DETERMINATE answer rather than a
silent placeholder: platform recognised, RAM a positive integer, arch known,
gpu_kind one of the declared values INCLUDING `none` — because "no GPU" and "we
did not look" are different facts, and conflating them is what made the backend
receipt refuse a working CPU-by-plan host.
The Windows leg runs under Git Bash, which is the shell install.sh actually
uses there (uname -s reports MINGW64_NT-...), so it exercises the real branch
rather than a WSL or PowerShell approximation. `fail-fast: false` because the
point is to learn what ALL three report — failing fast would hide the second
bug behind the first, which is how these stayed hidden.
The job also runs a MUTATION step: force the RAM arm to the silent-zero shape
that shipped on 24H2, assert the leg goes red, restore. Verified by hand on
this Intel Mac before commit — mutated exit 1 with "IC_RAM_MIB=0 — a host with
no readable RAM figure will be mis-tiered, silently", restored exit 0. Written
after finding twice in one night that a green check can mean the checker never
ran (a crashed linter counted as zero errors; a pipe returned tail's exit
status instead of cargo's).
Both triggers carry the same paths filter, per the comment on
ts-persona-forbidden-strings-ratchet.yml where a missing filter on `push`
produced 100/100 red and taught everyone to ignore the X.
Card b2e4a0bb.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
… three The Windows leg failed on its own mutation step, and the failure was correct. My first cut patched the two expression shapes I could see from a Mac — macOS's `IC_RAM_MIB=$(( $(sysctl …) ))` and Linux's `IC_RAM_MIB=$(awk …)`. Windows's arm is a `case` over a captured variable since #3739, so neither pattern matched, nothing was mutated, the assertions passed unchanged, and the step reported exactly what had happened: host-detect-assert did NOT fail with RAM forced to 0 — the gate is dead. That is the mutation step catching a hole in the mutation step. It is also the same defect the whole PR is about, committed by me while writing the PR: I wrote a check against the platforms I could see and shipped it to three. Now patches by LINE rather than by expression — every `IC_RAM_MIB=` assignment becomes 0 regardless of the shape the platform's arm happens to use — and prints the count of mutated lines so a future no-op is visible in the log instead of inferred from a passing gate. Verified locally: 4 lines mutated, assert exits 1, restore exits 0. WHAT THE WINDOWS LEG ALREADY PROVED, and it is the point of the matrix: its ASSERTIONS all passed. `IC_PLATFORM=windows` on MINGW64_NT-10.0-26100, RAM a positive integer, gpu_kind `none`. So #3739's Get-CimInstance fallback works on a real 24H2-era runner — measured on a platform none of us can run, by the leg that exists for that reason, on its first execution. Card b2e4a0bb. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Second failure of the same kind, and the lesson is the PR's own thesis pointed at me twice. The mutation step must prove this gate can fail. My first cut patched the two RAM-assignment shapes I could see from a Mac; Windows uses a `case` over a captured variable since #3739, so nothing was mutated and the step reported the gate dead. I fixed that with a line-wise regex — which patched four lines and STILL left Windows reporting 16378 MiB, because replacing a whole line inside a `case` arm does not do what replacing an assignment does. Twice I wrote a platform-shaped mutation from the one platform I have, and both times the thing that caught it was the mutation step refusing to pass. That is the same defect this PR exists to prevent — a check written against the platforms its author can see — committed inside the check itself. So the defect is now injected where every platform CONVERGES: a `HOST_DETECT_MUTATE_RAM` hook in the assert script, applied after `ic_detect_hardware` returns and before the assertions run. Shape-independent, cannot silently miss an arm, and it lives in CI scaffolding rather than in a sed over production source — install-common.sh is no longer touched by the test at all. Verified locally, both directions: MUTATION: forcing IC_RAM_MIB=0 (was 32768) FAIL ram — IC_RAM_MIB=0 — a host with no readable RAM figure will be mis-tiered, silently mutated exit=1 clean exit=0 Card b2e4a0bb. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
ce8b9074's gap on #3748, and it lands on a claim I had already made without checking. I said the green Windows leg "confirms #3739's Get-CimInstance fallback works on a real 24H2-era runner". That is only true IF `wmic` was absent. `wmic` was removed in Windows 11 24H2, but a runner that still has it takes the LEGACY arm — the leg would pass, prove the old path, and say nothing about the fix. A passing RAM check reports the answer, never how it was obtained, and I filled in the how from what I wanted it to mean. The leg now prints the precondition, so the log answers the question instead of the reader assuming: wmic PRESENT — the RAM figure came from the legacy wmic arm; this run does NOT exercise the Get-CimInstance fallback (#3739) wmic ABSENT (removed in Win11 24H2) — the RAM figure came from the Get-CimInstance fallback (#3739) with the equivalent one-liner for the macOS sysctl and Linux /proc/meminfo arms, so every platform's log says which code actually ran. ON THE SECOND GAP (unconditional restore): already closed by the previous commit rather than by this one. The mutation moved from patching install-common.sh to a HOST_DETECT_MUTATE_RAM hook in the assert script, so the workflow no longer copies, edits or restores production source at all — there is nothing left to restore conditionally or otherwise. Verified: no `cp` of a backup remains in the workflow. Card b2e4a0bb. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
Contributor
Author
|
M5-core review: NO OBJECTION. A new, non-required matrix workflow (ubuntu/macos/windows) asserting host-detect SHAPE with a mutation step that forces IC_RAM_MIB=0 and expects red — a gate that has been seen to fail. The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card b2e4a0bb.
The gap
carl-install-smokeis our only install check, and it isruns-on: ubuntu-latestwith no matrix. The install path is verified on exactly one platform — and in one night everydetect_hostbug found on the other two was invisible to it:wmicremoved in Win 11 24H2IC_RAM_MIB=0on a 64914 MiB machine; every tier decision ran on that zero (#3739)/proc/meminfo→ empty →0Each was a fact being wrong rather than missing, on a platform its author could not run. Three operators, three boxes, and the shared CI checking the tier none of them installs on.
Why not a matrix on
carl-install-smokeThat job is Docker-based and ~30 minutes.
install-common.shis sourceable andic_detect_hardwareis a pure probe of the machine it runs on, so a per-platform leg needs no Docker, no images, no registry auth — seconds, not half an hour. The Docker smoke stays the Linux end-to-end check; this is the cross-platform truth check.What it asserts
Shape, not hardware. A CI runner is none of our boxes, and a test expecting an M5 or a 5090 fails for the wrong reason. What must hold everywhere:
*)arm, which records placeholders by construction)0is "we could not look" wearing the clothes of "there is none", and empty is the Linux failure shapegpu_kindis one of the declared values includingnone— "no GPU" and "we did not look" are different facts, and conflating them is what made the backend receipt refuse a working CPU-by-plan hostThe Windows leg runs under Git Bash, the shell
install.shactually uses there (uname -s→MINGW64_NT-...), so it exercises the real branch rather than a WSL or PowerShell approximation.fail-fast: falsebecause the point is to learn what all three report — failing fast hides the second bug behind the first, which is how these stayed hidden.The mutation step
The job forces the RAM arm to the silent-zero shape that shipped on 24H2 and asserts the leg goes red, then restores.
Verified by hand on an Intel Mac before commit:
Written after finding twice in one night that a green check can mean the checker never ran — a crashed linter counted as zero errors, and a pipe returned
tail's exit status instead of cargo's.Both triggers carry the same
pathsfilter, per the comment onts-persona-forbidden-strings-ratchet.ymlwhere a missing filter onpushproduced 100/100 red and taught everyone to ignore the X.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE