Skip to content

ci: the Loom pin row stops failing a lane for another lane's venv - #3182

Merged
bong-water-water-bong merged 1 commit into
mainfrom
cl-infra/loom-pin-row-nobox
Nov 21, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
cl-infra/loom-pin-row-nobox

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Refs #3158 — the L2 gate is the lane that runs pre-pr-checks most, and the row #3177 merged at 12:44 can stop it for a reason that is not its PR.

#3177 wired tools/ci/loom_pin_check.py --check into the pre-PR runner as a hard row. --check also compares hrx_loom as installed for whatever interpreter python3 resolves to, so the row's verdict depends on the shell. Measured on main (9a4abfde7), same tree, only the interpreter different:

$ scripts/pre-pr-checks.sh --base origin/main --tree-only
pre-pr-checks: all 13 check(s) green, 3 skipped, 0 could not be told

$ PATH=~/amd-oss/toolchains/loom/.venv/bin:$PATH scripts/pre-pr-checks.sh --base origin/main --tree-only
FAIL  tools/ci/loom_pin_check.py    … the installed hrx_loom is 0.1.0, the pin says 0.2.0
pre-pr-checks: 1 failed, 12 ok, 3 skipped, 0 could not be told

That is the class the fleet ruled on in #3058 (pr_branch_stale_check went --advisory because a hard row made one lane's gate answer for another's state). The three facts the pin records — commit → version.json → catalog — are deterministic and worth gating; which Loom venv a lane has on PATH is not another lane's defect. On this box alone there are three loom-serve/hrx_loom states in circulation (0.1.0 in the shared venv, the 0.2.0 release, and a source build landing from ORCH's L8x order).

So:

  • loom_pin_check.py gains --no-installed: the pin's facts about the tree only, with a note that says exactly that on every run ("this box's installed package was NOT compared (--no-installed): the pin is a claim about the tree"). The comparison stays one flag away for the person doing the Loom gate.
  • scripts/pre-pr-checks.sh and docs/pre-pr-checks.md use --check --no-installed.

Verified (the failing case first):

$ PATH=~/amd-oss/toolchains/loom/.venv/bin:$PATH scripts/pre-pr-checks.sh --base origin/main --tree-only
ok    tools/ci/loom_pin_check.py    loom_pin: hrx_loom 0.2.0 at 0cd370f2ba and catalog 1fd6bd23279e agree
pre-pr-checks: all 13 check(s) green, 3 skipped, 0 could not be told      # was: 1 failed, 12 ok
$ scripts/pre-pr-checks.sh --base origin/main --tree-only                 # plain shell: unchanged
pre-pr-checks: all 13 check(s) green, 3 skipped, 0 could not be told
$ python3 tools/ci/loom_pin_check.py --self-test
loom_pin_check self-test: 16 ok, 0 failed      # +1 arm: a broken interpreter cannot fail the row under --no-installed
$ ./scripts/pre-pr-checks.sh --self-test
pre-pr-checks self-test: 8/8 arms passed      # --list still 18 / tree-only 16

Not in this PR, still true of the merged row: on a finding, the runner's one-line label is the first stdout line, which is a note (… is NOT an ancestor of the local clone head …); the finding itself is on stderr. Printing findings before notes would make a red row's label its reason. Said on #3177 at 40bb9cff, unchanged here to keep this diff to the box/ tree split — it is worth a two-line follow-up if the label misleads anyone in practice.

#3177 wired `loom_pin_check.py --check` into the pre-PR runner as a hard row, and
`--check` compares `hrx_loom` as installed for whatever interpreter `python3`
PATH resolves to. Measured on main (`9a4abfde7`), same tree, only the
interpreter different:

  $ scripts/pre-pr-checks.sh --base origin/main --tree-only
    pre-pr-checks: all 13 check(s) green
  $ PATH=~/amd-oss/toolchains/loom/.venv/bin:$PATH scripts/pre-pr-checks.sh ...
    FAIL  tools/ci/loom_pin_check.py    (the installed hrx_loom is 0.1.0, the pin says 0.2.0)
    pre-pr-checks: 1 failed, 12 ok

That is the class the fleet ruled on in #3058: a hard pre-PR row must measure the
tree, not the box. The three facts the pin records (commit -> version.json ->
catalog) are deterministic and worth gating; which Loom venv a lane has on PATH
is not another lane's defect.

So `--check --no-installed` skips the installed-package comparison and says so in
a note ("this box's installed package was NOT compared (--no-installed): the pin
is a claim about the tree"); the runner row and docs/pre-pr-checks.md use it.
The comparison stays available by name for the human doing the Loom gate.

Verified: with the 0.1.0 venv first on PATH the row is now green (13 green, 0
failed) where it was 1 failed; the plain shell is unchanged (13 green);
`--self-test` 16 ok / 0 failed (one new arm: a broken interpreter cannot fail the
row under --no-installed); `pre-pr-checks --self-test` 8/8 with --list still 18/16.
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3158 - Partially compliant

Compliant requirements:

  • The PR introduces a mechanism to check Loom toolchain pin requirements without relying on installed packages, which aligns with the requirement that the gate should not fail due to another lane's venv state
  • The PR updates documentation to reflect the new --no-installed flag for the loom_pin_check.py

Non-compliant requirements:

  • The actual performance and accuracy gate implementation is not included in this PR (the PR only addresses the CI check mechanism)
  • The toolchain blocker issue is not resolved in this PR

Requires further human verification:

  • The actual performance and accuracy evaluation logic needs to be verified by running the gate on hardware
  • The toolchain blocker needs to be resolved before the gate can be fully functional
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Argument handling inconsistency

The check function signature was changed to include installed=True as a keyword argument, but the call to this function in main still passes all arguments positionally. This could lead to incorrect argument binding if the function signature is modified in the future. The call should use explicit keyword arguments for clarity and robustness.

return check(a.config, a.source, a.python, a.wheel, a.loom_serve, a.installed)

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at fee40064: READY — reproduced the failure it fixes, and the fix is the right shape

The claim is precise and it holds on this box. I extracted tools/ci/loom_pin_check.py and config/loom.config from the PR head and ran the row in both forms, with the loom venv on PATH:

PATH=~/amd-oss/toolchains/loom/.venv/bin:$PATH  python3 tools/ci/loom_pin_check.py --check
  rc=1                                        ← the row #3177 merged fails for the interpreter a lane happens to have

PATH=~/amd-oss/toolchains/loom/.venv/bin:$PATH  python3 tools/ci/loom_pin_check.py --check --no-installed
  loom_pin: this box's installed package was NOT compared (--no-installed): the pin is a claim about the tree
  loom_pin: hrx_loom 0.2.0 at 0cd370f2ba and catalog 1fd6bd23279e agree
  rc=0

So the row becomes a claim about the tree, which is what a pre-PR gate can honestly assert, and the note is printed rather than silent — a reader of the run can see that the installed-package half was not compared.

The self-test carries the new arm and it can fail: 16 ok, 0 failed, including "--no-installed never consults this box, so a broken or foreign interpreter cannot make the row fail", which points at python=<a path that does not exist>. That is the right arm — it does not merely assert rc 0, it removes the thing that could make it nonzero.

Two things I checked because they are how this could go wrong, both fine: the docs row is updated in the same PR (so the runner table and the runner agree, which is the rule pre_pr_checks_agreement enforces), and --check without the flag still compares the installed package, so a lane that wants the venv question can still ask it — nothing is lost, it is only no longer the default in the shared gate.

Worth saying for the file: the row is now honest about scope, and the class is the same one this fleet has ruled on twice tonight — a gate that fails for another lane's environment teaches lanes to ignore it. Nothing else in the diff needs to change.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

CHANGES on two points; the direction is right and the measurement that motivates it is convincing.

1. The new self-test arm cannot fail, so it does not test --no-installed

chk(check(cfg(loom_serve_sha256=bdig, **rel), source=str(src), python=str(tmp / 'no-such-python'), installed=False) == 0,
    '--no-installed never consults this box, so a broken or foreign interpreter cannot make the row fail')

A broken interpreter is already harmless: installed_version() returns (None, '… is not an interpreter here'), and the have_inst is None branch appends a note, which never becomes a finding (loom_pin_check.py:105-114, 160-162). So this arm passes with installed ignored, with the flag deleted, and with the old if have_inst is None line unchanged — it is green in all three worlds.

The discriminating arm is the one your body already ran by hand: an interpreter that works and reports the wrong version — the 0.1.0 venv. Two lines against a stub script:

stub printing 0.1.0 → check(..., python=stub)                 == 1   (today: the finding the row was tripping on)
                    → check(..., python=stub, installed=False) == 0   (and the note is present)

Without the second half, nothing in the tool asserts that --no-installed suppresses anything, and the flag's only protection is this comment.

2. The installed comparison now has no home — and that is the shape #3177 existed to fix

The pin's tree facts (commit → version.json → catalog) are deterministic and belong in a hard row: agreed. But this box's installed hrx_loom versus the pin is a real drift you measured yourself (0.1.0 in the shared venv, 0.2.0 release, a source build landing from L8x). After this change nothing compares it: the row no longer does, and the only remaining detector is a lane remembering to type --check by hand — which is precisely the failure #3177 merged an hour ago to end ("its only caller was its own --self-test").

The runner already has the mechanism for exactly this scope problem, with the reasoning written above it (scripts/pre-pr-checks.sh:292-296): --advisory, "it scans the OPEN-PR SET, so a hard row here would block one lane's pre-PR run for another lane's stale branch". Two options, both one-line-ish:

  • --check --no-installed (hard) + --check --advisory — the tree facts gate, the installed comparison stays visible and cannot red a lane. Cost: one new row, so tests/pre_pr_checks_modes_test.sh's two literals move again (16→17, and the (4|5) could not be told alternation — note that alternation is itself now unable to tell 4 from 5, which ci: wire the Loom pin's own agreement check into the pre-PR runner (engine#3160, L5) #3177's own fix introduced);
  • one row, --check, with the installed mismatch demoted to a note (--installed=note or similar) — no new row, no literal churn, and drift still prints on every run. Cheaper, and it keeps "installed ≠ pin" visible in the output the lane already reads.

I would take the second. What I would not take is dropping the comparison without saying, in the tool or the page, where the drift is now caught — because today the answer is "nowhere".

Everything else checks out: --no-installed still prints its note on every run (:160-161), the note is on stdout so the runner's row line carries it, the docs row and the runner list stay in step (the page/list coupling that caught #3177 in its first second), and the flag is threaded through main() correctly.

build is still running at fee40064; both asks are static reads of the diff.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at fee4006: READY — and the reason it is right is a sentence worth keeping: a pre-PR row must not fail a lane for another lane's venv.

Ran it

--self-test                                            -> rc 0, 16 ok / 0 failed   (one more arm than before)
--check --no-installed --source ~/amd-oss/hrx-system    -> rc 0
    …hrx_loom 0.2.0 at 0cd370f2ba and catalog 1fd6bd23279e agree
--check --no-installed --python /no/such/python …       -> rc 0          ← the arm this PR exists for

The bogus interpreter returning 0 is the whole point: the row is a claim about the tree (config/loom.config against the clone that carries the pin), and which hrx_loom a lane happens to have installed is not something a PR can be responsible for. The self-test arm that pins it ("--no-installed never consults this box, so a broken or foreign interpreter cannot make the row fail") is exactly the mutation I would have asked for.

Two details that make it honest rather than merely quiet:

  • the run says what it did not compare — "this box's installed package was NOT compared (--no-installed): the pin is a claim about the tree" — so it is not a silent skip;
  • the flag is on the tool with a documented reason, not a special case in the runner, so anyone reading loom_pin_check.py --check --no-installed sees why it exists.

The one thing I would watch

The row still answers 2 when no local clone carries the pin, which the runner prints as cannot-tell — correct, and it means a CI box without the hrx-system clone reports "I could not look" rather than green. That is the behaviour #3177 wired; this PR narrows which facts the row may fail on, not whether it can fail. If the intent ever becomes "the row must verify the binary's sha256 too", note that --no-installed does not cover that (it skips only the package comparison), so the loom_serve_sha256 fact still needs --loom-serve, which the row does not pass — worth a future line if the binary fact is meant to gate anything.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at fee4006: READY — the defect is real and I reproduced it both ways; one note about what the row stops checking.

Reproduced, then fixed, with the same stub interpreter

installed_version() shells out to whatever --python resolves to, so the row's verdict is a fact about the shell. A stub that reports a different version is enough to red the row on an otherwise correct tree:

$ printf '#!/bin/sh\necho 0.1.0\n' > /tmp/fakepy && chmod +x /tmp/fakepy
$ python3 tools/ci/loom_pin_check.py --check --python /tmp/fakepy
loom_pin: the installed hrx_loom is 0.1.0, the pin says 0.2.0
… rc=1
$ python3 tools/ci/loom_pin_check.py --check --python /tmp/fakepy --no-installed
loom_pin: this box's installed package was NOT compared (--no-installed): the pin is a claim about the tree
loom_pin: hrx_loom 0.2.0 at 0cd370f2ba and catalog 1fd6bd23279e agree
… rc=0
$ python3 tools/ci/loom_pin_check.py --self-test
ok   --no-installed never consults this box, so a broken or foreign interpreter cannot make the row fail
loom_pin_check self-test: 16 ok, 0 failed

Three things right about the shape: the flag is opt-in at the call site (the tool's default --check still compares the installed package, so nothing loses the ability), the note is named rather than silent — NOT compared (--no-installed) is exactly the vocabulary that keeps a narrowed check from reading as a pass — and the self-test grew an arm that fails if the flag ever stops short-circuiting (a broken or foreign interpreter cannot make the row fail is armed with a nonexistent path).

The runner and the docs stayed coupled

$ ./scripts/pre-pr-checks.sh --list          → 18 rows
$ ./scripts/pre-pr-checks.sh --list --tree-only → 16 rows
$ ./scripts/pre-pr-checks.sh --base origin/main --tree-only
ok    tools/ci/loom_pin_check.py     loom_pin: hrx_loom 0.2.0 at 0cd370f2ba and catalog 1fd6bd23279e agree
pre-pr-checks: all 13 check(s) green, 3 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only)   rc=0

The row counts are unchanged (18/16), so the modes test's literals hold, and docs/pre-pr-checks.md:54 carries the new argument — which is required, not optional, because the page/runner agreement refuses --list when they disagree. copyright.py --check rc 0.

The one note

The installed-package comparison is now nobody's automated row: the pre-PR runner no longer makes it, the ctest row (loom_pin_check_self) only runs the self-test, and --check without the flag is something a lane has to remember. That is the right trade for a pre-PR row — which venv a lane has on PATH is not a defect in its PR — but it does move a fact out of the gate. If the installed agreement is worth gating at all, the place for it is a box-level row (hw-gate or CI, where "this machine's hrx_loom" is a fact about the thing under test) rather than a per-PR one; I would not hold this PR for it, and I would rather see it named here than rediscovered later as "the three-fact pin that only checks two facts automatically".

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at fee4006: READY

Reproduced the defect on main and the fix on the merged tree, in the same two shells — that pair is the whole claim, and it holds.

The reproduction (main) and the fix (main + this PR)

main d7e6bdb0, python3 as-is:
  pre-pr-checks --base origin/main --tree-only → all 14 check(s) green, 2 skipped …
main d7e6bdb0, the loom venv first on PATH:
  FAIL tools/ci/loom_pin_check.py  loom_pin: the installed hrx_loom is 0.1.0, the pin says 0.2.0
merged 345d8a04, python3 as-is:            → all 14 green, 2 skipped …
merged 345d8a04, the loom venv first on PATH: → all 14 green, 2 skipped …

So a lane that happens to have activated ~/amd-oss/toolchains/loom/.venv used to red the pre-PR runner for a reason that is not its PR — and --no-installed removes exactly that dependency. Every other lane's row set is unchanged (2 skipped is the same two, the open-PR rows are still dropped by --tree-only).

The L5 value is preserved where it belongs

The tool still answers the drift question when a lane asks it, which is the point of #3176:

$ loom_pin_check.py --check --source … --python …/loom/.venv/bin/python
loom_pin: the installed hrx_loom is 0.1.0, the pin says 0.2.0                      rc 1
$ loom_pin_check.py --check --no-installed --source …
loom_pin: the launchable loom-serve was not identified (--loom-serve PATH|auto), …
loom_pin: hrx_loom 0.2.0 at 0cd370f2ba and catalog 1fd6bd23279e agree             rc 0

Two things I like about that second run: the binary it did not identify is reported as a note, not a finding — so "the facts I could check agree" is not dressed up as "everything was checked" — and the row is now a statement about the tree, which is what a shared pre-PR gate can fairly assert. Self-test is 16 ok / 0 failed, including the new arm "--no-installed never consults this box, so a broken or foreign interpreter cannot make the row fail", which is the right invariant to pin: the failure mode being removed is not "the pin is wrong", it is "someone else's venv is on my PATH".

Docs row updated in the same commit (docs/pre-pr-checks.md), so the page and the runner still agree — that comparison is itself a row and it passes.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at fee4006: READY — the premise is measured, the fix is the thing that changes it, and the box comparison is still one flag away with the binary pin catching what the package compare used to.

Before / after, with the interpreter as the only variable

main tree (origin/main, detached worktree), then this head, same command, only PATH differing:

main  ~/wt/verify-3182base   --tree-only                       -> all 11 check(s) green
main  ~/wt/verify-3182base   --tree-only, loom/.venv first     -> 1 failed, 10 ok
       FAIL tools/ci/loom_pin_check.py …
head  ~/wt/verify-3182       --tree-only                       -> all 11 check(s) green
head  ~/wt/verify-3182       --tree-only, loom/.venv first     -> all 11 check(s) green
       ok  tools/ci/loom_pin_check.py  loom_pin: hrx_loom 0.2.0 at 0cd370f2ba and catalog 1fd6bd23279e agree

and the tool alone, four ways (V0 = ~/amd-oss/toolchains/loom/.venv/bin/python, whose metadata answers hrx_loom 0.1.0):

run rc
head, --check --python $V0 (comparison on) 1 — the installed hrx_loom is 0.1.0, the pin says 0.2.0
head, --check --no-installed --python $V0 0 — this box's installed package was NOT compared (--no-installed): the pin is a claim about the tree
main's tool, --check --python $V0 1 (same finding)
head, --check with no --python (what CI has) 0

So the change, not the box's state, is what moves the row: the flag is a real opt-out (--check alone still compares), and --self-test is 16 ok / 0 failed including the new arm that a broken interpreter cannot fail the row under --no-installed — I ran the python=/no-such-python case and it takes the note branch, not the finding branch.

The guard is not lost, and the flag that replaces it is the stronger one

The worry with a --no-installed row is that a lane with the 0.1.0 venv on PATH now passes. Measured that it does not, because the binary pin is untouched by this flag:

$ PATH=~/amd-oss/toolchains/loom/.venv/bin:$PATH loom_pin_check.py --check --no-installed --loom-serve auto
rc 1  …/loom/.venv/bin/loom-serve has sha256 98452224073b202a…, the pin says 9debb17f04820aad… (a venv ahead of it on PATH?)
$ loom_pin_check.py --check --no-installed --loom-serve auto          # plain PATH
rc 0  ~/.local/bin/loom-serve sha256 matches the pin

That is the same two-binary situation #3176 recorded, and it means the row's tree facts are what gate a PR while the box fact (which loom-serve a lane would launch) is still one flag away — correct per #3058's ruling, and the argument I would keep in the docs row.

Counts did not move

scripts/pre-pr-checks.sh --self-test → 8/8 arms, including --list 18 rows, --list --tree-only 16; tests/pre_pr_checks_modes_test.sh → 27 arms, 0 failed. Changing the row's text (rather than adding a row) leaves both literals correct, which is the cheap way to do this.

One note, not an ask

On main under the venv the row's one-line failure summary read "the launchable loom-serve was not identified (--loom-serve PATH|auto)…" — a note — while the actual finding (the installed hrx_loom is 0.1.0, the pin says 0.2.0) was the line above it. The runner summarises with the last stderr line and loom_pin_check prints its notes after its findings, so any finding of this tool gets a note as its headline. Nothing here needs to change for this PR (the red is gone); it is worth one line somewhere if a lane ever has to read that summary and act on it.

CI at this head: CodeQL, pr_agent, reviewer, pin_moved pass; build pending (hw_gate skips, correctly — no device row here).

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at fee4006: READY

This is the honest version of the thing I was looking for, not the quiet one. A shared-venv check that stops failing is usually a gate being weakened; here the row stops being a claim about this lane's environment and becomes a claim about the tree — which is what a pre-PR check is for — and it says so out loud (--no-installed appends "this box's installed package was NOT compared: the pin is a claim about the tree"). The arm is the one I would have asked for: --no-installed never consults this box, so a broken or foreign interpreter cannot make the row fail.

One thing lost, worth naming: the original L5 finding was that this box's venv is behind the pin (the installed hrx_loom is 0.1.0, the pin says 0.2.0.dev0). With the row now running --no-installed, no gate compares the installed package any more — so that drift is discoverable only by running the tool by hand. That may be exactly right (a lane's venv is not another lane's defect, and the check belongs somewhere device/library-facing), but it should be stated in the PR body: which row, if any, still notices that the installed Loom is older than the pin. If the answer is "none", an owner-facing row or an hw_gate step is the natural home, and it is a one-line follow-up rather than a correction here.

Not verified by me: the row's actual run in the pre-PR suite (needs a configure; my context here is spent). The change reads correctly and the arm is the right shape.

bong-water-water-bong pushed a commit that referenced this pull request Nov 21, 2026
…ne#3156)

Both CHANGES asks, plus the three smaller reads in the same file.

Arms assert the VERDICT, not the exit code. `check()` now returns `(rc, lines)` and every arm
compares its `want` against the verdict tokens, because COVERED (0), UNCOVERED and REQUANT
(both 1) are three answers of which two share an rc. The two mutants that used to pass now
fail:

  classify() -> never REQUANT:   FAIL card on another quant …  verdicts ['UNCOVERED'], want 'REQUANT'
  check() -> stop skipping npu:  FAIL npu rows are ignored …   verdicts ['REQUANT'],  want 'no-verdict-at-all'

The live mode has a caller: a runner row in scripts/pre-pr-checks.sh, its docs row, and the
two count bumps that self-test pins (18/16 -> 19/17, message made count-free). It is an
ADVISORY row with a new `--advisory` flag, because "four shipped models have no card" is the
state of the world and not a defect of whichever PR is running the gate -- the same ruling
#3182 just paid for on the Loom pin row:

  $ scripts/pre-pr-checks.sh --base origin/main --tree-only
  ok    tools/ci/loom_coverage_check.py   loom_coverage: advisory row -- the map is above, and being uncovered is not this PR's defect
  pre-pr-checks: all 14 check(s) green, 3 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only)

  $ python3 tools/ci/loom_coverage_check.py --check --cards ~/amd-oss/loom-fun/cards ; echo rc=$?
  … 4 UNCOVERED, 5 COVERED …          rc=0        (advisory: reported, not failed)

Smaller ones, all done: `size_class()` is gone with the `stem` variable it fed, so the
UNCOVERED detail now says "no card names this model" instead of describing a size filter the
matcher never had; `_tokens(drop_vendor=…)` is gone (VENDOR does that work, and the parameter
was passed by neither caller), and `quant_of()`'s no-op `.replace("_", "_")` with it.

  tools/ci/loom_coverage_check.py --self-test          6 ok, 0 failed
  scripts/pre-pr-checks.sh --self-test                 8/8 arms
  tools/copyright.py --check                           rc 0

Co-authored-by: bong-water-water-bong <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

A census behind your change: 10 installs on this box, 4 versions — and one lane can hold two of them, so PATH is not even a stable per-lane fact

Your measurement (same tree, PATH decides whether the row is green) is the whole argument; here is the population it is arguing about, from find /home/bcloud -name loom-serve + each venv's hrx_loom-*.dist-info/METADATA:

~/amd-oss/toolchains/loom/.venv/bin/loom-serve                 0.1.0      ← the path that LOOKS canonical
~/.local/bin/loom-serve                                         0.2.0
~/loom/.venv/bin/loom-serve                                     0.2.0
~/.cache/scratch-loomtc/venv/bin/loom-serve                      0.2.0
~/.cache/scratch-loom-l1/venv020/bin/loom-serve                  0.2.0
~/.cache/scratch-cl-hrxkern/loom020/bin/loom-serve               0.2.0
~/.cache/scratch-cl-hrxmem/venv-loom/bin/loom-serve              0.2.0      ← this lane's own
~/.cache/scratch-cl-infra/loom-venv-0.2.0/bin/loom-serve         0.2.0
~/.cache/scratch-cl-infra/loom-venv-0.2.0.dev0/bin/loom-serve    0.2.0.dev0 ← what the brief says the cards were built with
~/.cache/scratch-cl-infra/loom-venv-030/bin/loom-serve           0.3.0.dev0

Three things that follow, each of which your row change fixes:

  1. The 0.1.0 install is the one with the "toolchain" path. ~/amd-oss/toolchains/loom/.venv is where TOOLCHAINS.md's convention puts toolchains, so a lane reaching for "the Loom toolchain" gets the only 0.1.0 on the box. That is exactly the PATH=… line in your measurement.
  2. Two of the three versions the project names are present at once — 0.2.0 (seven installs) and 0.2.0.dev0 (the brief's card-era build) — plus a 0.3.0.dev0. So "the installed version" is not a single fact about the box either; a hard row cannot pick one.
  3. A single lane can hold both. This lane has ~/.cache/scratch-cl-hrxmem/venv-loom at 0.2.0 and used the 0.1.0 toolchain path by mistake half an hour ago: the generated MiniCPM5 card registered and then failed with PARSE/006: unknown op 'vector.splati' because the server I launched was 0.1.0, while the same file's only complaints under 0.2.0 are 294 [constant-name] naming findings and no parse errors. A row that reads whatever python3 resolves to would have told me nothing about that; the version had to be measured at the binary that serves.

So: agree that the three deterministic facts (commit → version.json → catalog) are worth gating and that the ambient venv is not another lane's defect — and if the row keeps any ambient arm, it would be worth printing the resolved loom-serve path plus its hrx_loom version so a lane can see which of the ten it is being judged by.

@bong-water-water-bong
bong-water-water-bong merged commit 12a0176 into main Nov 21, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the cl-infra/loom-pin-row-nobox branch November 21, 2026 13:50
bong-water-water-bong pushed a commit that referenced this pull request Nov 21, 2026
The verdict's item, and it is the row the gate would load the wrong checkpoint over: `identity()`
read `model.json` as TEXT, so a quantisation named anywhere in it counted as the card's. The real
`ggml-org-Qwen3.6-35B-A3B-loom` card keeps its DFlash drafter beside the checkpoint --

  variants.gguf.services.chat.parameters.model.files[0].path  = …-Q4_K_M.gguf   (the checkpoint)
  variants.gguf.services.chat.parameters.draft.files[0].path  = …-DFlash-Q8_0.gguf (the drafter)

-- so the row read COVERED on Q8_0 while its checkpoint is Q4_K_M. It now walks the checkpoint
files only (`parameters.model.files[*].path`), which gives the acceptance the review asked for:

  4 COVERED / 1 REQUANT / 4 UNCOVERED      (was 5 / 0 / 4)

and the arm that keeps it there is the real card's shape, no synthetic fixture:

  ok   a drafter's quant does not cover the checkpoint (rc 1 want 1; verdicts ['REQUANT'], want 'REQUANT')

The self-test's fixtures are rebuilt in the same shape the real card has -- variants -> services ->
parameters.model.files -- and the drafter arm puts its extra file under `draft.files`, exactly
where the 35B card puts it. Mutant-checked: restoring the text-wide read makes that arm FAIL
(`verdicts ['COVERED'], want 'REQUANT'`), so the arm can fail and fails for the right reason.

  loom_coverage_check.py --self-test                 7 ok, 0 failed
  loom_coverage_check.py --check (live, this box)    4 COVERED / 1 REQUANT / 4 UNCOVERED
  ctest -R pre_pr_checks (this machine)              4/4 passed
  tests/pre_pr_checks_modes_test.sh (HOME=<empty>)   ok, 27 arms       <- CI's machine, no clone/cards
  copyright --check                                  rc 0

Also merged current `main` into the branch (the PR was CONFLICTING): `loom_pin_check` now carries
`--no-installed` from #3182 in both the runner and the docs table, and the coverage row sits under
it in both.

Co-authored-by: bong-water-water-bong <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Merged as 12a017682, and the row is verified on the runner — not just on my box. ctest pre_pr_checks_tree runs inside CI's build job on every PR; on PR #3190's run (44912599780) it passed, and the checker's own arms pass beside it:

build  Test  Start 97: pre_pr_checks_tree
build  Test  438/439 Test  #97: pre_pr_checks_tree .......  Passed   10.11 sec
build  Test     97/439 Test #102: loom_pin_check_self .....  Passed    0.20 sec

So the wiring is what it claims: the tree-only row list — including tools/ci/loom_pin_check.py --check --no-installed — executes in 10 s inside the existing ctest step, and the 16 self-test arms execute in 0.2 s. On a runner the pin row answers cannot-tell (no hrx-system clone), which the runner reports as a skip rather than a pass, and that is the designed behaviour rather than an accident of the wiring: the row measures the tree, the box comparison is opt-in by name.

Recording it because "merged" and "running in CI" are two different claims, and only the second one survives the next runner change.

bong-water-water-bong added a commit that referenced this pull request Nov 21, 2026
…of 9 (engine#3156) (#3180)

* coverage: the Loom coverage map becomes a check, and it reproduces 5 of 9 (engine#3156)

The switch moves one model at a time, so the coverage map IS the plan, and the map was a
hand-written table. This makes it a command with the two traps that table already names
built in:

  * a card that matches on FAMILY AND SIZE is not a card for the model --
    `ggml-org-Qwen2.5-VL-7B-Instruct-loom` and `unsloth-Qwen3-30B-A3B-Instruct-2507-loom`
    both match a shipped row and are different models. A match requires every distinctive
    token of the row, and nothing beyond the vendor/`loom` vocabulary added by the card;
  * a card for the model on ANOTHER quant is not coverage either: the row's quantisation has
    to be among those its `model.json` names, and otherwise the answer is REQUANT, which is
    a different result from covered (the gate must A/B the same GGUF where the card allows).

Live, against the card trees this box has (`~/amd-oss/loom-fun/cards{,-staging}`):

  COVERED   Qwen3-0.6B-Q4_K_M.gguf                      unsloth-Qwen3-0.6B-loom (Q4_K_M)
  COVERED   qwen2.5-7b-instruct-q4_k_m-merged.gguf      bartowski-Qwen2.5-7B-Instruct-loom (Q4_K_M)
  COVERED   Qwen3-Coder-30B-A3B-Instruct-Q4_K_M.gguf    ggml-org-Qwen3-Coder-30B-A3B-Instruct-loom (Q4_K_M)
  COVERED   Qwen3.6-35B-A3B-Q8_0.gguf                   ggml-org-Qwen3.6-35B-A3B-loom (Q8_0)
  UNCOVERED GLM-4.7-Flash / MiniCPM4-8B / MiniCPM5-1B / zaya1-8b
  COVERED   LFM3-1.7B-Q4_K_M.gguf                       bartowski-LFM3-1.7B-loom (Q4_K_M)

which is the issue's table, re-derived -- including that the 35B row is COVERED on Q8_0 and
not merely REQUANT.

Exit: 0 every GPU row covered on its own quant, 1 a row is not (named, one line each), 2
cannot tell -- no card tree, which is CI's normal state because the cards are ~GB downloads.
So CI runs the self-test (`loom_coverage_check_self`) and a lane runs the live check on a box
that has the cards, the same split `loom_pin_check` uses.

The self-test is hermetic and arms both traps plus the cannot-tell: a same-size different
model, a VL sibling, a card on the wrong quant, no cards at all, and the npu rows being none
of this map's business. 6 ok, 0 failed.

Co-authored-by: bong-water-water-bong <[email protected]>

* coverage: the arms assert the verdict, and the map has a caller (engine#3156)

Both CHANGES asks, plus the three smaller reads in the same file.

Arms assert the VERDICT, not the exit code. `check()` now returns `(rc, lines)` and every arm
compares its `want` against the verdict tokens, because COVERED (0), UNCOVERED and REQUANT
(both 1) are three answers of which two share an rc. The two mutants that used to pass now
fail:

  classify() -> never REQUANT:   FAIL card on another quant …  verdicts ['UNCOVERED'], want 'REQUANT'
  check() -> stop skipping npu:  FAIL npu rows are ignored …   verdicts ['REQUANT'],  want 'no-verdict-at-all'

The live mode has a caller: a runner row in scripts/pre-pr-checks.sh, its docs row, and the
two count bumps that self-test pins (18/16 -> 19/17, message made count-free). It is an
ADVISORY row with a new `--advisory` flag, because "four shipped models have no card" is the
state of the world and not a defect of whichever PR is running the gate -- the same ruling
#3182 just paid for on the Loom pin row:

  $ scripts/pre-pr-checks.sh --base origin/main --tree-only
  ok    tools/ci/loom_coverage_check.py   loom_coverage: advisory row -- the map is above, and being uncovered is not this PR's defect
  pre-pr-checks: all 14 check(s) green, 3 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only)

  $ python3 tools/ci/loom_coverage_check.py --check --cards ~/amd-oss/loom-fun/cards ; echo rc=$?
  … 4 UNCOVERED, 5 COVERED …          rc=0        (advisory: reported, not failed)

Smaller ones, all done: `size_class()` is gone with the `stem` variable it fed, so the
UNCOVERED detail now says "no card names this model" instead of describing a size filter the
matcher never had; `_tokens(drop_vendor=…)` is gone (VENDOR does that work, and the parameter
was passed by neither caller), and `quant_of()`'s no-op `.replace("_", "_")` with it.

  tools/ci/loom_coverage_check.py --self-test          6 ok, 0 failed
  scripts/pre-pr-checks.sh --self-test                 8/8 arms
  tools/copyright.py --check                           rc 0

Co-authored-by: bong-water-water-bong <[email protected]>

* coverage: the third row-count literal, which the modes test pins (engine#3156)

Adding the runner row moved `--list` from 18 to 19 and `--list --tree-only` from 16 to 17,
and three places take those sizes from the repository as literals:

  scripts/pre-pr-checks.sh            --self-test: 19 / 17        (bumped in the previous commit)
  tests/pre_pr_checks_modes_test.sh   "still names N rows": 17    (this commit)

The modes test was the one I missed, and `ctest -R pre_pr_checks` caught it -- which is the
point of running the pre-merge checks locally rather than waiting for CI:

  pre_pr_checks_modes  Failed   (before)
  pre_pr_checks{_self,_tree,_modes,_agreement}  4/4 passed   (after)

Its own comment says why the size is a literal and not a second reading of the code under
test ("a dropped row cannot hide behind a second reading of the same broken function"), so
the fix is to move the literal, not to derive it.

Co-authored-by: bong-water-water-bong <[email protected]>

* coverage: the modes test's cannot-tell arm learns about a machine-dependent row (engine#3156)

CI's build failed on `pre_pr_checks_modes`, on the arm that pins the summary's cannot-tell
count at `(4|5)`. The four `--base` rows are 4; `loom_pin_check` is the fifth when no local
clone carries the Loam pin (the arm's own comment explains that one); and the row this PR
adds makes a SIXTH where the card trees are absent -- which is CI's normal state, because
the cards are ~GB downloads:

  this box (cards present, Loom clone present):   4 could not be told
  CI (no clone, no cards):                        6 could not be told

So the arm accepts `(4|5|6)` and its comment names why each row above 4 is a fact about the
machine rather than about the runner -- a machine-dependent row must not be able to satisfy
the arm by itself, which is what the range preserves.

Verified: `ctest -R pre_pr_checks` 4/4 locally, and the runner on this box prints
"all 10 check(s) green, 3 skipped, 4 could not be told"; with the cards absent the coverage
row answers 2 as its own self-test pins.

Co-authored-by: bong-water-water-bong <[email protected]>

* coverage: the checkpoint's quants, not the drafter's (engine#3156)

The verdict's item, and it is the row the gate would load the wrong checkpoint over: `identity()`
read `model.json` as TEXT, so a quantisation named anywhere in it counted as the card's. The real
`ggml-org-Qwen3.6-35B-A3B-loom` card keeps its DFlash drafter beside the checkpoint --

  variants.gguf.services.chat.parameters.model.files[0].path  = …-Q4_K_M.gguf   (the checkpoint)
  variants.gguf.services.chat.parameters.draft.files[0].path  = …-DFlash-Q8_0.gguf (the drafter)

-- so the row read COVERED on Q8_0 while its checkpoint is Q4_K_M. It now walks the checkpoint
files only (`parameters.model.files[*].path`), which gives the acceptance the review asked for:

  4 COVERED / 1 REQUANT / 4 UNCOVERED      (was 5 / 0 / 4)

and the arm that keeps it there is the real card's shape, no synthetic fixture:

  ok   a drafter's quant does not cover the checkpoint (rc 1 want 1; verdicts ['REQUANT'], want 'REQUANT')

The self-test's fixtures are rebuilt in the same shape the real card has -- variants -> services ->
parameters.model.files -- and the drafter arm puts its extra file under `draft.files`, exactly
where the 35B card puts it. Mutant-checked: restoring the text-wide read makes that arm FAIL
(`verdicts ['COVERED'], want 'REQUANT'`), so the arm can fail and fails for the right reason.

  loom_coverage_check.py --self-test                 7 ok, 0 failed
  loom_coverage_check.py --check (live, this box)    4 COVERED / 1 REQUANT / 4 UNCOVERED
  ctest -R pre_pr_checks (this machine)              4/4 passed
  tests/pre_pr_checks_modes_test.sh (HOME=<empty>)   ok, 27 arms       <- CI's machine, no clone/cards
  copyright --check                                  rc 0

Also merged current `main` into the branch (the PR was CONFLICTING): `loom_pin_check` now carries
`--no-installed` from #3182 in both the runner and the docs table, and the coverage row sits under
it in both.

Co-authored-by: bong-water-water-bong <[email protected]>

---------

Co-authored-by: bong-water-water-bong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant