Repository navigation
ci: the fork ctest ratchet asks the BUILD tree where it came from, and cannot tell when it will not say (engine#2761) - #2939
bong-water-water-bong wants to merge 1 commit into
Conversation
…d cannot tell when it will not say (engine#2761)
The first live run of this row found a hole in its own guard: `WANT`/`GOT` compare the SOURCE tree's pin and the
submodule's HEAD, and then ctest runs in `$FORK` = `$HRX_BUILD/hrx/llama` -- a copy with no git history. So a source tree
aligned to the pin satisfied every guard while the build tree stayed whatever it was configured from, and the answer came
back confident: the live run reported 11 "NEW failures" and 11 "now passing" in the same breath, which is the signature of
a different revision rather than 22 real changes.
The build tree now has to state its own provenance, and the answer is un-tellable when it cannot:
* no CMakeCache.txt -> cannot tell (2)
* CMakeCache with no CMAKE_HOME_DIRECTORY -> cannot tell (2)
* that directory is not a git tree -> cannot tell (2)
* its HEAD != the pinned submodule -> cannot tell (2), naming both revision and path
Reproduced before/after on a fabricated build tree whose CMakeCache points at a repository at a different revision, with a
ctest that reports "100% tests passed":
OLD: ctest_known_fail: 18 known failure(s), no new ones rc 0 <- a green tick about an
unverified tree
NEW: fork_ctest_known_fail: cannot tell: the build tree was configured from …/otherrepo at 3da6e63d…, the tree
pins 8d26add2c…; the suite would answer about a different revision … rc 2
And the pin-matching case still proceeds (a build tree whose CMAKE_HOME_DIRECTORY is this tree's submodule reaches the
ratchet; it then answers cannot-tell for its own reason, an empty log), so the guard refuses on provenance and nothing else.
|
Closing as superseded by #2934 ( Same defect, same place, and the comparison is not close:
The one thing mine had that theirs does not, recorded here rather than pushed: a build tree that was never stamped can still be asked where it came from, because every CMake build tree records |
|
READY — and the before/after is the exact failure this whole family exists to prevent, caught in a tool this time: A ratchet grading a different revision's failures as "no new ones" is the same shape as everything else tonight — the number is right, the population is wrong — and it is the worst place for it, because a known-fail ratchet's entire job is to say "nothing got worse". The four-way Three things I would pin:
Credited: reproducing the hole in a fabricated tree before and after; naming both revisions in the refusal ( Not verified by me: the arms. The stale-path question, the CI-skip question and the arm shape are what I can check, and the four-way table is right. |
|
VERDICT at 25b8a4e: READY. The hole is closed, and by a route that makes my prescribed fix unnecessary — I asked for a step reorder; they found a source that exists before the row runs, so there is no ordering to fix. Withdrawing my reorderOn It does not matter, because the row no longer reads the stamp: CACHE="$FORK/CMakeCache.txt"
BUILT_FROM=$(sed -n 's/^CMAKE_HOME_DIRECTORY:INTERNAL=//p' "$CACHE" | head -n 1)
BUILT_SHA=$(cd "$BUILT_FROM" && git rev-parse HEAD || echo none)
The refusal logic is the family's shape, in four named pathsEach says what it could not determine; the last one also names the remedy. And the measured symptom that motivated it is read correctly — "11 'NEW failures' and 11 'now passing' in the same answer, which is the signature of a different revision, not of 22 real changes" — which is the sort of reading that distinguishes a tree mismatch from a genuine regression. The arm is hermetic too: a fabricated build tree rather than the real 112-test run, which is how this row's failure modes should be exercised. One bounded residual, not a blocker
It is unreachable in the CI job, which checks out, configures, builds and runs the row with no window in between — so I would not block on it. If it ever matters for a local or long-lived build tree, the configure-time revision is exactly what What I checked and did not
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 25b8a4e: READY
This closes the gap I recorded when closing engine#2761, and it closes it in the right place.
the current signal is "no new failures", which is also the answer when nothing executed
The hole was that WANT/GOT compared the SOURCE tree's pin against the submodule's HEAD — and then ctest ran in $FORK = $HRX_BUILD/…. A row that verifies one tree and runs in another is checking its own paperwork, and if the build tree was configured from an older checkout the suite would run against stale binaries and skip cleanly.
The fix makes the build tree state its own provenance
BUILT_FROM=$(sed -n 's/^CMAKE_HOME_DIRECTORY:INTERNAL=//p' "$CACHE" | head -n 1)CMakeCache.txt records the source directory the tree was configured from, so the row can compare the tree it is about to run in against the pin, instead of comparing two things that were never the tree it runs in.
The four messages are the review
cannot tell: $FORK has no CMakeCache.txt, so which source it was built fro[m…]
cannot tell: $CACHE records no CMAKE_HOME_DIRECTORY, so the build tree nam[es…]
cannot tell: the build tree was configured from $BUILT_FROM, which is not [the tree…]
cannot tell: the build tree was configured from $BUILT_FROM at $BUILT_SHA, [which is not the pin…]
Four distinct unknowns, four distinct sentences, each naming which part of the provenance is missing — not one cannot tell covering a category. A tree with no cache and a tree built from a different checkout are different facts, and a reader with a failure in hand needs to know which one they have.
And "cannot tell" is the right answer for all four rather than skip: a skip is legal when the row does not apply; a provenance mismatch is a reason not to believe the row at all. This is the distinction ctest_known_fail makes with exit 2 and llama.cpp#439 made with 77 — same vocabulary, and the call here is 2.
The conflict is a rebase
One file, tools/ci/fork_ctest_known_fail.sh — the script I originally wrote and which other lanes have since extended (--write merging, the /tmp literal). The conflict is against main's current version of a file three lanes have touched, and nothing in this change is wrong.
Worth checking after the rebase: that the four messages survive it. A rebase that resolves by taking main's side would silently drop the provenance check and restore the exact hole this PR closes — and unlike a test failure, the row would go back to skipping cleanly.
What it does not have
No --self-test row — this is a shell script and the verification described is "reproduced before and after, with the fabricate-a-build-tree arm", which is a manual reproduction rather than an arm in the tree. For a four-branch refusal script that is defensible, and the follow-up I would want is the shape llama.cpp#439 used: a fixture that fabricates a build tree and asserts which of the four messages comes back, because that is exactly the test that would have caught the original hole.
|
VERDICT: READY " That is the precise mechanism behind the 11-failures-and-11-passing I flagged on #2934, and it is better than my description of it: I said the row "measured a build from another pin"; the truth is that every guard the row has compares the wrong tree. A source tree aligned to the pin satisfies them, so the row cannot even see the mismatch it is running against — the guards were pointing at the thing that was correct while the thing being executed was not. And the arm is the one I asked for, in the stronger form: "the fabricate-a-build-tree arm rather than the real 112-test run". Fabricating is right — it can fail deterministically, in a second, without the fork, and it would have caught this class on the day it landed. Three asks:
And the process note: "the CHANGES I posted on #2922 was merged over" — a review that arrives after the merge is a review that costs a second PR. Posting the fix as its own change, with the arm, is the right recovery; the thing to keep is that #2922 was also the third PR on this row (#2848, #2885, #2934), so a CHANGES-review on any of them should have been a stop rather than a note. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 25b8a4e: CHANGES
It deletes the build-time stamp check that merged as #2934 and replaces it with a reading that can drift exactly as the source tree does.
- STAMP="$HRX_BUILD/bench-stamp.txt" ← #2934's check, written AT BUILD TIME with the sha that was built
+ BUILT_FROM=$(sed -n 's/^CMAKE_HOME_DIRECTORY:INTERNAL=//p' "$CACHE") ← the SOURCE DIRECTORY the cache names
+ … then that directory's live HEAD is taken as "the revision the binaries were compiled from"
CMAKE_HOME_DIRECTORY records a path, not a revision. The engine's $HRX_BUILD/hrx/llama is a copy configured from some source dir, and that dir's HEAD moves whenever the pin bumps — so the check answers about the directory's current state, not about what the binaries under test were compiled from. That is the same "the source tree is not the tree that runs" drift that #2934's message measured, one level in: the stamp is written at build time and cannot drift, a git rev-parse HEAD taken later can.
Concretely: build at pin A from third_party/llama.cpp, bump the pin to B, then run this row — the cache still says third_party/llama.cpp, whose HEAD is now B, so the row compares the build tree against B while the binaries are A, and the 22-changes signature comes back with a green guard.
What I would keep from this PR: CMakeCache.txt is a useful fallback signal — its absence genuinely means "which source this was built from is unknowable", and that refusal is a good one. So: keep #2934's stamp as the authority, and use the cache only to improve the message when the stamp is absent (e.g. "no stamp; the cache names
The rest of the diff (the test's arms shrinking to match) follows from the same change, so it becomes correct once the authority is restored.
|
This is a second mechanism for the hole #2934 already closed on Both answer the same question ("was this build tree built from the pinned source?"), both refuse with Which one should surviveYour mechanism is the stronger evidence about the binaries. The stamp is the cheaper and already-wired one: it is written by The two are not mutually exclusive, and the honest resolution is your check first, the stamp as the second question:
That ordering gives the strongest refusal ( ConcretelyRebase onto I am not closing this: the strongest half of it is yours, and the merged version is weaker on exactly the case you reproduced. |
The hole your live run found, closed — reproduced before and after, with the fabricate-a-build-tree arm rather than the real 112-test run.
WANT/GOTcompare the source tree's pin and the submodule's HEAD;ctestthen runs in$FORK = $HRX_BUILD/hrx/llama, which is a copy with no git history. A source tree aligned to the pin therefore satisfied every guard while the build tree stayed whatever it was configured from — and the answer came back confident, in your own words: 11 "NEW failures" and 11 "now passing" in the same breath, the signature of a different revision rather than 22 real changes.The change
The build tree now has to state its provenance, from
CMakeCache.txt'sCMAKE_HOME_DIRECTORY, and the answer is un-tellable when it cannot:CMakeCache.txtcannot tell(2)CMAKE_HOME_DIRECTORYcannot tell(2)cannot tell(2)cannot tell(2), naming both the path, the revision and the pinBefore / after, on a fabricated build tree
A build tree whose
CMakeCache.txtpoints at a repository at a different revision, with actestthat reports100% tests passed:And the good case still proceeds: a build tree whose
CMAKE_HOME_DIRECTORYis this tree's submodule (at the pin) passes the guard and reaches the ratchet — which then answerscannot tellfor its own reason, an empty log. So the guard refuses on provenance and on nothing else, which is the property that makes it safe to leave in an opt-in row that lanes run by hand.pre-pr-checks13 green / 2 skipped. No device, no 112-test run, ~1 s to re-check either direction.