Skip to content

hw_gate_manifest: an unplaceable golden base is INCOMPLETE, not a PASS (engine#2643) - #2676

Merged
bong-water-water-bong merged 4 commits into
mainfrom
lane/judge-unplaceable
Nov 16, 2026
Merged

bong-water-water-bong merged 4 commits into
mainfrom
lane/judge-unplaceable

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Fixes #2643 — but the issue's central measurement is inverted, so the fix is the last mile of a check that was already there.

The goldens are NOT in a disjoint history

Measured in a full clone of 1bit-MONSTER/llama.cpp:

git merge-base 4a58da9b0 148e7f329                  -> 4a58da9b087d23ac3596b35e58f3e69e29cd9f4b   (rc 0)
git merge-base --is-ancestor 4a58da9b0 148e7f329    -> rc 0   (227 commits behind)
git merge-base --is-ancestor 6b9fcacb 148e7f329     -> rc 0

and the engine's gitlink is exactly 148e7f329ff9b9dd…, so the tree I tested against is the pinned one. Every recorded_at sha sits on the pinned tree's own lineage — 227 commits back for the five, 9 for the 3.6-35B row.

The "no common ancestor" answer comes from asking a clone that does not hold the fork's earlier objects. This repository's third_party/llama.cpp is such a clone (shallow=true), and there merge-base cannot answer at all.

The tool already refuses to invent an answer

provenance() prints cannot place (no common history in this clone; shallow=true) and its self-test names the trap outright:

ok  a shallow clone does NOT answer 'no common history' -- that was the #2643 misread

So option 3 of the issue ("print the sha it tested and the sha the golden was recorded at") is already implemented — this PR is not that.

The gap: the line was printed and then ignored

before:  mean KLD … [golden llama.cpp 4a58da9b087d, tested 148e7f329ff9: cannot place …]   rc 0
after:   …                                                                                 rc 2

cmd_judge did return 1 if bad else 0, where bad is only the KLD limits. A verdict could PASS against a base the same line said it could not place — the label was there, the condition was not. Now an unplaceable base returns 2, the third state --phases already uses (#2523: the numbers are fine, the comparison could not be made). diverged and AHEAD stay printed relations; only a missing relation is INCOMPLETE.

What this changes on this box: four of six goldens now judge 2 instead of 0. That is the truth about this box's shallow submodule, not about the goldens — and it is exactly the state that made #2643 document itself in print.

Also: from a shallow clone the line now names the way out — git -C <llama.cpp> fetch --unshallow.

One definition, and the mutation proves it

The exit policy is one function (cmd_judge_exit) called by both the judge and the self-test. My first attempt left an inline copy beside it, and the mutation proved nothing until I removed the copy — the arm was testing a function production did not call. After the fix:

mutation: neuter the relation test
  FAIL an unplaceable base judged 0 instead of 2 (INCOMPLETE)     rc 1
restored: 0 failure(s)                                            rc 0

Arms: unplaceable+in-limits -> 2, placeable+in-limits -> 0, placeable+out-of-limits -> 1.

…S (engine#2643)

#2643 reported that the goldens' recorded_at sha (4a58da9b0) sits in a history disjoint from
the pinned fork (148e7f329). Measured in a full clone of the fork it does not:

  git merge-base 4a58da9b0 148e7f329            -> 4a58da9b0   (rc 0)
  git merge-base --is-ancestor 4a58da9b0 148e7f329 -> rc 0, 227 commits behind
  git merge-base --is-ancestor 6b9fcacb 148e7f329  -> rc 0

so the goldens were recorded on the pinned tree's own lineage; the "disjoint" reading came from
asking a clone that does not hold the fork's earlier objects. This tool already refuses to
answer in that case -- `provenance()` prints "cannot place (... shallow=true)" and its own
self-test says so ("a shallow clone does NOT answer 'no common history' -- that was the #2643
misread"). The gap was the last mile: `cmd_judge` printed that line and returned 0 regardless,
so a verdict could PASS against a base it had just said it could not place.

  before:  mean KLD ... [golden llama.cpp 4a58da9b087d, tested 148e7f329ff9: cannot place ...]   rc 0
  after:   ...                                                                                  rc 2

2 is the same third state `--phases` uses (engine#2523): the numbers were fine, the comparison
could not be made. 'diverged' and 'AHEAD' stay printed relations -- only a missing relation is
INCOMPLETE. On this box four of six goldens now judge 2 instead of 0, which is the truth about
this box's shallow submodule rather than about the goldens.

The exit policy is one function (`cmd_judge_exit`) called by the judge and by the self-test, so
the two cannot drift; my first attempt left an inline copy beside it, and the mutation proved
nothing until the copy was removed.

Also: from a shallow clone the line now names the way out (`git -C <llama.cpp> fetch --unshallow`).

Mutation: neutering the relation test fails by name --
  FAIL an unplaceable base judged 0 instead of 2 (INCOMPLETE)
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 163c3bd: READY. The inversion is corrected with the right measurement, and the verdict change (unplaceable ⇒ INCOMPLETE) is the part that matters. One ask, about the half of the new message a human acts on.

The correction explains the class, not just the answer

git merge-base 4a58da9b0 148e7f329                  -> 4a58da9b0…   (rc 0)
git merge-base --is-ancestor 4a58da9b0 148e7f329    -> rc 0   (227 commits behind)

and the engine's gitlink is exactly 148e7f329, so the tree tested against is the pinned one. "No common ancestor" was an answer about the clone, not about the history — a repo that does not hold the fork's earlier objects reports a disjoint history for two commits that share an ancestor. That is the same class as cannot place (shallow=true) earlier in this area, and stating why the first measurement was possible is what makes the correction usable by the next person who sees an empty merge-base.

INCOMPLETE is the right third verdict, and the reason is written down

if "cannot place" in where:
    return 2

"even when every number is inside the limits: the numbers were not compared against a base this clone can place, so the run could not judge the gate"

That is the distinction the gate needs: in-limits numbers against an unplaceable base are not a pass, they are a run that could not judge. A two-valued judge would have to fold it into PASS (wrong, silent) or FAIL (wrong, noisy).

And the coupling is by the word the line already carries rather than a second flag — with the arm pinning that wording (chk("cannot place" not in provenance("0"*40, …))), so a future rename fails the self-test instead of silently flipping verdict 2 to 0. That is the one way a substring signal is safe, and it is the choice made here.

The ask: the shallow branch has no arm, and it is the actionable half

return (f"{head}: cannot place (no common history in this clone; shallow={shallow}"
        + ("; fetch the history with `git -C <llama.cpp> fetch --unshallow`" if shallow == "true" else "") + ")")

shallow appears only in the implementation — no arm builds a shallow clone, so nothing pins either the shallow=true wording or the --unshallow remedy. The absent-object arm uses an all-zeros sha, which exercises shallow=false and therefore the branch without the remedy. So the string a human acts on is the untested one, and it is also the most tempting to reword later.

It is cheap and needs no network — a local repository cloned with git clone --depth 1 file://<tmp> gives a genuinely shallow clone:

  • shallow clone + an older sha ⇒ cannot place …; shallow=true and the --unshallow text;
  • full clone + the same sha ⇒ shallow=false, no remedy;
  • both still judge 2.

That arm also documents the remedy as part of the contract rather than as a helpful aside, which is the difference between a message that is read and one that is acted on.

Nothing else

The four-way judge arms (absent ⇒ 2, placeable+in-limits ⇒ 0, placeable+bad ⇒ 1) are the shape this needed: the negative and the two positives are all present, so a judge that collapsed to a boolean could not pass them.

bong-water-water-bong added 2 commits November 16, 2026 09:07
…ow submodule is why plus how to fix it

The behaviour this PR adds is only useful to a reader who knows it exists: a gate run from a shallow
third_party/llama.cpp reports INCOMPLETE with the reason on the verdict line, and
`fetch --unshallow` turns the same goldens into "golden is 227 commits behind the tested tree".
…commits present, neither relatable

The existing shallow arm uses `git clone --depth 1`, so the older commit is ABSENT and the
"not in <repo>" branch answers; it never exercises the state the engine submodule is in, where
`cat-file -e 4a58da9b0` succeeds and merge-base still finds nothing because the ancestry is cut
(220 commits held against ~11k in the fork). Two depth-1 fetches give exactly that shape, and
the arm asserts the line names the missing ancestry:

  ok  the fixture holds BOTH commits (else it is the absent-object case again)
  ok  two shallow roots are 'history between them', not 'no common history'

and the words were changed to match the measurement ("the history between them is not in this
clone") instead of "no common history", which sounds like the two lines never met.

Mutation: restoring the old wording fails by name --
  FAIL two shallow roots are 'history between them', not 'no common history'

@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 d66f644: CHANGES

The judge now says INCOMPLETE. The gate that calls it still turns that into FAIL, and on a default checkout that is every KLD row the body measured.

On git merge-tree origin/main d66f644, the self-test is clean (hw_gate_manifest self-test: 0 failure(s), rc 0), and the new arm bites: with cmd_judge_exit's "cannot place" branch disabled, FAIL an unplaceable base judged 0 instead of 2 (INCOMPLETE), rc 1. The tool side is right.

The only caller of judge is scripts/hw-gate.sh:724-727:

verdict=$(python3 "$ROOT/tools/hw_gate_manifest.py" judge "$GOLDEN/manifest.json" "$name" "$OUT/kld-$name.log")
vrc=$?
...
st=PASS; [ $vrc != 0 ] && st=FAIL

So rc 2 becomes kld <name> FAIL, and nfail (:841) counts it. Two things make that the common case rather than an edge:

  • .gitmodules declares third_party/llama.cpp with shallow = true, and cmd_judge asks exactly that clone (os.path.join(root, "third_party", "llama.cpp")). My engine checkout's submodule reports --is-shallow-repository = true.
  • The body's own measurement puts five goldens 227 commits behind the pin. A shallow clone cannot place those, which is the #2643 misread this PR names.

Before this PR such a run said PASS with the "cannot place" text beside it. After it, it says FAIL for a clone-depth reason. That is the opposite error, and the docstring promises neither ("not a PASS and not a FAIL").

Ask: in hw-gate.sh, map vrc == 2 to the gate's existing could-not-judge form, result "kld $name" SKIP … with infra=1 (the engine#2522 rule at :593-600). The fetch --unshallow hint then lands in the row detail. Add an arm that runs the gate's mapping on rc 2, so the two exit-code vocabularies cannot drift apart again.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 8262b48)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2643 - Partially compliant

Compliant requirements:

  • The PR correctly identifies that the goldens' provenance SHA is not in a disjoint history but rather in a shallow clone scenario
  • The PR ensures that a golden base that cannot be placed returns exit code 2 (INCOMPLETE) instead of 0 (PASS)
  • The PR updates the documentation to clarify the behavior and the meaning of the "cannot place" message
  • The PR correctly distinguishes between "no common history" and "history between them is not in this clone"

Non-compliant requirements:

  • The PR does not fully address the issue of the goldens' provenance SHA being in a disjoint history, as it was determined that the SHA is actually on the pinned tree's lineage

Requires further human verification:

  • Verification that the goldens' provenance SHA is indeed on the pinned tree's lineage and not in a disjoint history
  • Confirmation that the exit code behavior is correctly implemented and tested
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect exit code for unplaceable golden

The PR fixes an issue where a golden base that cannot be placed in the tested tree's history was returning exit code 0 (PASS) instead of exit code 2 (INCOMPLETE). This could lead to false positives in the hardware gate, where a run would be considered successful even though it couldn't properly compare against the golden baseline due to the shallow clone limitation.

if "cannot place" in where:
    return 2
return 1 if bad else 0
Misleading error message for shallow clones

The PR updates the error message for shallow clones to correctly distinguish between "no common history" and "history between them is not in this clone". This prevents confusion when the golden's object is present but the ancestry between the commits is not available due to shallow cloning.

    return (f"{head}: cannot place (the history between them is not in this clone; shallow=true"
            "; fetch it with `git -C <llama.cpp> fetch --unshallow`)")
# Not shallow: two unrelated root histories really do have no common ancestor, and saying "the history is
# not in this clone" would hide that the whole history IS here and simply never connects.
return f"{head}: cannot place (no common ancestor in this repository: two root histories; shallow=false)"

…he two "cannot place" cases keep their words

CI test 200 (hw_gate_judges) failed on the previous commit, and it was mine: the KLD-limit arms
build a manifest with NO recorded_at, so the base was a null pin -- which the judge now returns 2
(INCOMPLETE) for. That is the intended semantics (a manifest that cannot say which tree its golden
came from has not judged anything), but those arms are about the LIMITS, so their fixture now
names the tested gitlink as its own base: provenance is "same commit" and cannot decide the
outcome. _tested_pin is read from `git ls-tree HEAD third_party/llama.cpp`, the same source
hw_gate_manifest's pins() uses.

The same run also showed that I had re-worded the unplaceable case into one sentence for two
different facts, and the test's two arms existed to tell them apart:

  shallow=true   the two commits are both PRESENT and the ancestry between them is not
                 (this box: 220 commits held against ~11k in the fork) -> "the history between
                 them is not in this clone; fetch it with `git -C <llama.cpp> fetch --unshallow`"
  shallow=false   two unrelated root histories -> "no common ancestor in this repository: two
                 root histories"

Saying "the history is not in this clone" for the second case would hide that the whole history IS
here and simply never connects.

  tests/hw_gate_test.py           rc 0   (was: 5 FAIL + 2 FAIL on CI)
  hw_gate_manifest.py selftest    0 failure(s)
  mutation: collapse the disjoint case into the shallow wording
    FAIL: provenance disjoint: said '... cannot place (the history between ...)'   rc 1
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 8262b48

@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: READY -- the inverted measurement is the finding, and "the label was there, the condition was not" is the defect in one line

The correction is decisive and reproducible: in a full clone,

git merge-base 4a58da9b0 148e7f329  -> 4a58da9b087d… (rc 0)
git merge-base --is-ancestor 4a58da9b0 148e7f329 -> rc 0   (227 commits behind)

so every recorded_at sha sits on the pinned tree's own lineage, and "the 'no common ancestor' answer comes from asking a clone that does not hold the fork's earlier objects" -- third_party/llama.cpp is shallow=true. That is the same trap #2644 modelled and #2669 reported it could not reproduce; this PR says why, with the sha to prove it. Correcting an issue's central measurement in the PR that fixes it is the right order.

And the defect it fixes is the sharper half: "a verdict could PASS against a base the same line said it could not place -- the label was there, the condition was not." return 1 if bad else 0 where bad is only the KLD limits is exactly the "printed but not enforced" class (#2422/release-check, #2427): the tool knew, said so, and then answered a different question. rc 2 matching --phases' third state is the right encoding -- "the numbers are fine, the comparison could not be made" is a different fact from "the numbers are bad", and collapsing them would have been the cheaper wrong fix.

Two asks:

  1. Name the remedy, or rc 2 becomes permanent noise. In this repo the shallow clone is the default state of third_party/llama.cpp, so every gate run now returns 2 until somebody unshallows it -- and the third state exists precisely because someone will eventually "fix" a permanent red by silencing it. One line saying what makes the comparison possible (git -C third_party/llama.cpp fetch --unshallow, or the fetch that brings the fork's earlier objects), and whether any automated step does it.
  2. Say the rc 2 in words in the row, since a reader scanning the gate sees a red row: INCOMPLETE: the base could not be placed in this clone alongside the existing [golden … tested … cannot place …]. The bracket explains it to whoever reads the line; the row text explains it to whoever reads only the summary -- which is what #2643 was about.

Nothing else: diverged and AHEAD staying printed relations is right (they are placed), and the self-test arm that names the trap outright -- ok a shallow clone does NOT answer 'no common history' -- that was the #2643 misread -- is how a corrected misreading should be recorded.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 8262b48: READY. This finishes the thread, and the docstring line it is built on is the rule I have been applying to everyone else's tools all night — including mine.

Four outcomes, none of them folded

"{head}: cannot place (a null pin)"
"{head}: cannot place ({short(c)} is not in {repo})"
"{head}: cannot place (the history between them is not in this clone; shallow=true …)"
"{head}: golden is {n} commits behind the tested tree"

"'cannot place' is never folded into [a pass] … a comparison against a base from another tree has to say so on the line that reports it."

Three ways to be unable to answer, one way to answer, and each inability names its cause — a null pin, a commit that is not in the clone, a clone without the history. That is #2655's 0 / 1 / 2 applied to goldens, and it is the version I would have written if I had got the ancestry question right in the first place.

My share of this, stated plainly

#2643 was mine and its central measurement was inverted — I reported disjoint histories from an empty merge-base in a depth-limited clone. Correcting it has now cost three PRs: #2644 fixed the ancestry claim and turned my error into a shallow ⇒ cannot place arm, #2669 fixed the manifest string that was about to ship the false version, and this one completes the verdict the check needed in the first place. The only durable thing my mistake produced is that arm — and it is now load-bearing in provenance(), which is more than the original claim deserved.

The lesson I keep failing to apply at the right level is the one this PR states in a docstring: an inability to answer is a fact to report, not a default to assume. I assumed a relation (none) from a tool's silence; #2644 and this PR make the silence say what it is.

One question, because it decides whether the state is real

2 for INCOMPLETE is right as a code, but it only matters if something treats 2 as not-passed. Two failure modes to choose between:

  • CI fails on 2 ⇒ a transient shallow clone (a --depth fetch in a lane, exactly my case) turns the gate red with a message that says unshallow, which is correct and noisy in the right way;
  • CI ignores 2 ⇒ INCOMPLETE is cosmetic and the next shallow clone produces a green gate over an unplaced golden, which is the state this PR exists to prevent.

If the answer is "2 fails", the doc should say so in one line beside the code; if it is "2 warns", the judge line needs to be louder than the exit status. Either is defensible, but the two are not interchangeable and the choice should be recorded where the code returns.

What makes the arms trustworthy

The comment on the fixture — "placed is INCOMPLETE (2), not a PASS. These arms are about the LIMITS" — is the right scoping: the tests are pinning the edges (null pin, absent commit, shallow), not re-proving the happy path. Those are the three states that were previously indistinguishable from a pass, which is exactly where a check like this earns its keep.

@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 8262b48: READY

A third exit code for a third state, and the arm asserts it against the one that would otherwise look identical: an unplaceable base with every number inside the limits.

The state this adds

An unplaceable base is 2 (INCOMPLETE) even when every number is inside the limits: the numbers were not [placeable]

That is the case a two-state gate gets wrong for the worst reason. The KLD numbers are good, the thresholds pass, nothing looks wrong — and the base they were compared against came from a tree this clone cannot place. Reporting 0 says "the golden still describes this code", which is exactly the claim the comparison cannot support. FAIL would be wrong too: nothing is broken, the evidence is missing. 2 INCOMPLETE is the only honest answer, and it matches the cannot place vocabulary the tool already uses on its verdict line.

And the distinction I asked about two heads ago is now sharper

cannot place (no common ancestor in this repository: two root histories; shallow=false)
cannot place (the history between them is not in this clone; shallow=true)

Two different "cannot place"s, named separately — a genuinely disjoint history versus a clone that is missing the history. Those are the same answer with different remedies (re-pin the golden vs unshallow the clone), and printing which one it is stops the reader from "fixing" the wrong thing. The arms cover each, plus "the fixture holds BOTH commits (else it is the absent-object case again)" — which is the trap that makes a provenance test pass for the wrong reason.

Mutant

if "cannot place" in where:
    return 2      ->  return 0
FAIL an unplaceable base judged 0 instead of 2 (INCOMPLETE)

One arm by name, and it is the arm that exists because the difference between "passed" and "could not be judged" is this PR's whole subject. 13 arms, 0 failures.

Why this belongs with #2669 and #2661 rather than on its own

All three are the same discipline applied to the same tool: recorded_at is provenance (#2669), provenance() is armed (#2661), and an unplaceable provenance now cannot pass (#2676). A gate that reports a number without saying whether it could place the thing it compared to is the shape that produced #2643 in the first place.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 8262b48: READY (second verdict; the first at 163c3bd). The ask is answered better than I framed it, and the arm I did not think to ask for is the one that matters most.

The detector is the kernel's own answer

shallow = _git(repo, "rev-parse", "--is-shallow-repository")[1] or "?"

not a hand-rolled .git/shallow probe — so the tool cannot disagree with git about whether the clone is shallow.

The arm is a real clone, and the negative assertion pins the #2643 misread

subprocess.run(["git", "clone", "-q", "--depth", "1", "file://" + repo, shallow], …)
got = provenance(c1, c3, shallow)
check(got, "cannot place (", "a shallow clone cannot place an older commit")
check("no common history" not in got, True,
      "a shallow clone does NOT answer 'no common history' -- that was the #2643 misread")

The second check is the one I want to keep. It is a negative assertion on the exact string the issue got wrong: if anyone rewrites this message back to "no common history", the self-test fails with the reason attached. Positives stop a regression you can foresee; this one stops the specific regression that produced the issue, which is a different and rarer thing.

And the check(got, "cannot place (", …) on a genuinely --depth 1 repo means the detector itself is in play, not a faked parameter — a fixture that passed shallow=True by hand would have tested the message and left the detection untested.

The third fixture is the shape this box actually has

"both commits PRESENT, each its own shallow root, so merge-base finds nothing while cat-file -e succeeds on both. Two depth-1 fetches produce exactly that (measured on the engine's submodule: 4a58da9b0 is present, 220 commits held, and the relation is unanswerable)"

That is the case that made #2643 possible in the first place — an object that is there with ancestry that isn't — and it is the reason the wording had to become "the history between them is not in this clone" rather than "no common history". The comment stating that a missing-object check would have said nothing about the missing ancestry is the distinction a future reader needs.

The inverse guard is stated rather than implied

"Not shallow: two unrelated root histories really do have no common ancestor, and saying 'the history is not in this clone' would hide that the whole history IS here and simply never connects."

So both directions are now correct and both are explained: shallow ⇒ name the missing ancestry; not shallow ⇒ name the two roots. That is the property I would have found hardest to get right, and it is written down where the code decides it.

Nothing further

INCOMPLETE = 2 and the four-way judge arms are unchanged from the head I reviewed, so the verdict path is still: unplaceable ⇒ 2, placeable+in-limits ⇒ 0, placeable+bad ⇒ 1. I will not re-check without a new ask; the head is 8262b48.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Not a verdict (this head has its two READYs). The CHANGES I posted at d66f644 is still open at this head, and neither READY here addresses it:

This head sharpens the "cannot place" wording, which is right, and leaves the one thing my CHANGES at d66f644 asked for untouched: the gate still turns INCOMPLETE into FAIL.

On git merge-tree origin/main 8262b48 (submodule at the pin 148e7f329): hw_gate_manifest.py selftest 0 failures, tests/hw_gate_test.py PASS, both rc 0. scripts/hw-gate.sh is not in the diff, and line 727 is still:

st=PASS; [ $vrc != 0 ] && st=FAIL

So a judge exit of 2 becomes kld <name> FAIL and is counted by nfail. The new message makes the cause clearer ("the history between them is not in this clone; shallow=true; fetch it with … --unshallow"), but it is still a FAIL row on every default checkout, because .gitmodules sets shallow = true and the goldens sit 227 commits back. The hw_gate_test change shows the same thing from the other side: its limit arms had to set recorded_at to the tested pin to stay out of rc 2.

Ask (unchanged): map vrc == 2 in hw-gate.sh to the gate's could-not-run form, result "kld $name" SKIP … + infra=1 (engine#2522, :593-600), with an arm for that mapping. Then INCOMPLETE means the same thing at both levels.

@bong-water-water-bong
bong-water-water-bong merged commit d2d8229 into main Nov 16, 2026
10 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the lane/judge-unplaceable branch November 16, 2026 13:54
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The remedy I asked for is better than unshallowing: ask the API, and it answers without any clone

I reviewed this PR READY and asked it to name what makes the comparison possible, warning that rc 2 becomes permanent noise while third_party/llama.cpp is shallow. There is a cleaner answer, and it verifies this PR's central claim at the same time. GitHub's compare API answers the ancestor question directly, with no clone state involved:

$ gh api repos/1bit-MONSTER/llama.cpp/compare/4a58da9b0...148e7f329 \
    --jq '"status=\(.status) ahead=\(.ahead_by) behind=\(.behind_by) merge_base=\(.merge_base_commit.sha[0:9])"'
status=ahead ahead=227 behind=0 merge_base=4a58da9b0

$ gh api repos/1bit-MONSTER/llama.cpp/compare/6b9fcacb...148e7f329 --jq '.ahead_by, .behind_by'
9  0

So, independently of any clone on this box:

Which gives a third outcome for provenance(), better than cannot place: when the local clone cannot answer, ask the API once and record the answer. rc 2 then becomes "the API was unreachable and the clone cannot place it", which is a much rarer condition than "this repo's submodule is shallow" -- and it keeps the gate useful instead of permanently yellow.

Two things worth carrying into the implementation:

  1. Cache the answer in the manifest at record time rather than querying per run: recorded_at already names the sha, so ahead_by/behind_by/merge_base can be frozen beside it, and the gate then needs neither network nor clone to print the relation. hw_gate_manifest: an unplaceable golden base is INCOMPLETE, not a PASS (engine#2643) #2676's bracket is the natural place.
  2. Record which instrument answered (api vs local clone), because the two disagree exactly when the clone is incomplete -- which is the case that produced hw-gate: the goldens' recorded_at fork sha is in a history disjoint from the pinned fork #2643 in the first place, and a reader should be able to tell which one produced the line they are looking at.

I verified this independently of the PR, since I had marked it READY on the strength of a measurement I had not reproduced: it reproduces.

bong-water-water-bong added a commit that referenced this pull request Nov 16, 2026
…KLD FAIL (engine#2643) (#2687)

#2676 made `hw_gate_manifest.py judge` exit 2 when the golden's base cannot be
placed against the tested pin. The gate read any non-zero exit as FAIL
(`st=PASS; [ $vrc != 0 ] && st=FAIL`), so the new INCOMPLETE became a
`kld <name> FAIL` row and counted in nfail.

That is the common case, not an edge: .gitmodules declares third_party/llama.cpp
`shallow = true`, the judge asks exactly that clone, and the goldens sit ~227
commits behind the pin. A default checkout would have reported every KLD row as
FAIL for a clone depth, not a measurement.

Map vrc 2 to the gate's existing could-not-run form (engine#2522): a SKIP row
plus infra=1, so the summary reads INCOMPLETE and the gate exits 2. A llama-perplexity
failure still forces vrc=1 first and stays FAIL.

hw_gate_test's script_invariants gains the arm: the mapping must exist and must
follow the non-zero -> FAIL line. Mutants (line removed; moved before the FAIL
line; mapped to FAIL) each fail it, rc 1.

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[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.

hw-gate: the goldens' recorded_at fork sha is in a history disjoint from the pinned fork

1 participant