Repository navigation
hw_gate_manifest: an unplaceable golden base is INCOMPLETE, not a PASS (engine#2643) - #2676
Conversation
…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)
|
VERDICT at The correction explains the class, not just the answerand the engine's gitlink is exactly INCOMPLETE is the right third verdict, and the reason is written downif "cannot place" in where:
return 2
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 ( The ask: the
|
…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
left a comment
There was a problem hiding this comment.
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=FAILSo rc 2 becomes kld <name> FAIL, and nfail (:841) counts it. Two things make that the common case rather than an edge:
.gitmodulesdeclaresthird_party/llama.cppwithshallow = true, andcmd_judgeasks 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.
PR Reviewer Guide 🔍(Review updated until commit 8262b48)Here are some key observations to aid the review process:
|
…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
|
Persistent review updated to latest commit 8262b48 |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
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:
- Name the remedy, or
rc 2becomes permanent noise. In this repo the shallow clone is the default state ofthird_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. - 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 clonealongside 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.
|
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"
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 My share of this, stated plainly
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; One question, because it decides whether the state is real
If the answer is "2 fails", the doc should say so in one line beside the code; if it is "2 warns", the What makes the arms trustworthyThe 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
left a comment
There was a problem hiding this comment.
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 0FAIL 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.
|
VERDICT at The detector is the kernel's own answershallow = _git(repo, "rev-parse", "--is-shallow-repository")[1] or "?"not a hand-rolled The arm is a real clone, and the negative assertion pins the #2643 misreadsubprocess.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 The third fixture is the shape this box actually has
That is the case that made The inverse guard is stated rather than implied
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
|
|
Not a verdict (this head has its two READYs). The CHANGES I posted at This head sharpens the "cannot place" wording, which is right, and leaves the one thing my CHANGES at On st=PASS; [ $vrc != 0 ] && st=FAILSo a judge exit of 2 becomes Ask (unchanged): map |
The remedy I asked for is better than unshallowing: ask the API, and it answers without any cloneI reviewed this PR READY and asked it to name what makes the comparison possible, warning that So, independently of any clone on this box:
Which gives a third outcome for Two things worth carrying into the implementation:
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. |
…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]>
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:and the engine's gitlink is exactly
148e7f329ff9b9dd…, so the tree I tested against is the pinned one. Everyrecorded_atsha 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.cppis such a clone (shallow=true), and theremerge-basecannot answer at all.The tool already refuses to invent an answer
provenance()printscannot place (no common history in this clone; shallow=true)and its self-test names the trap outright: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
cmd_judgedidreturn 1 if bad else 0, wherebadis 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--phasesalready uses (#2523: the numbers are fine, the comparison could not be made).divergedandAHEADstay printed relations; only a missing relation is INCOMPLETE.What this changes on this box: four of six goldens now judge
2instead of0. 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:Arms: unplaceable+in-limits -> 2, placeable+in-limits -> 0, placeable+out-of-limits -> 1.