Repository navigation
diag: check-deployed --against <ref>, so "are the deployed bytes CURRENT?" is a question the tool can answer (engine#3087) - #3090
bong-water-water-bong wants to merge 1 commit into
Conversation
…ENT?" is a question the tool can answer (engine#3087) check_deployed compares the deployed file to its own provenance, which proves the bytes match their label -- and the label can be arbitrarily old. Measured tonight: this box ran 11be13e's sampler with `check-deployed: ok` printing all night while main carried aad1977. --against <ref> hashes <ref>:tools/diag/accel_sampler.sh and compares it with the deployed sha256: rc 0 current, rc 1 STALE (with the number of commits touching the file), rc 2 cannot-tell when ACCEL_SAMPLER_REPO names no checkout. The no-argument form is byte-for-byte the old contract. Three arms with a fixture repo; two mutations caught (always-current, silent-pass).
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a6ea313: READY
This closes the other half of the #3075 incident, and the sentence that says why is worth keeping:
"
--againstanswers 'are the deployed bytes CURRENT?' — which comparing them to their own provenance cannot."
That is exactly the gap I flagged in review of #3075: check-deployed compared the deployed bytes with a commit recorded next to them, and a smoke run that wrote a branch's summary stayed "ok" because the recorded provenance moved with the bytes. A ref is a fact the bytes cannot assert about themselves.
Verified on the box, including the case that must not pass:
$ bash tools/diag/accel_sampler.sh --self-test
accel-sampler self-test: ok (… rotation, summary replaced not truncated, faults split by device)
$ ACCEL_SAMPLER_REPO= bash tools/diag/accel_sampler.sh check-deployed --against HEAD /bin/true ; echo rc=$?
rc=2 ← no repo named: cannot tell, never a pass
And the fixture is the right shape again — it owns both sides: a ref holding the deployed bytes is rc 0, one commit later is rc 1 and says STALE, and no repo named is rc 2. Three outcomes, three codes, each driven from a repo the test built rather than from the caller's checkout. That is the same property #3075 established (fixture_repo()) and it is what makes these arms worth having.
One thing to say in the file, because it will be asked: which ref a lane should pass. HEAD in the checkout that produced the deployed copy, origin/main when asking whether the deploy is behind the fleet's tip, and 1bit/hrx-vulkan-patched for the fork — three different questions with the same flag. One line naming the intended caller (the sampler's own install path, presumably HEAD at install time) keeps a future reader from using --against origin/main on this repo and reading the answer as the fork's.
|
VERDICT: READY " That is the sharpest form of tonight's recurring defect: a check that verifies identity-on-paper while the paper has aged. Every other instance tonight was a tool that could not look; this one looked, found agreement, and the agreement was true and useless — the deployed bytes matched a label that pointed at a commit nobody had run in hours. Three asks:
On the shape: |
|
One line for this PR while you are in so The arm inherits the variable it is testing against, and the guard is deliberately - knob_out=$(DIR="$d/wrongknob" bash "$0" sample 2>&1); knob_rc=$?
+ knob_out=$(env -u ACCEL_SAMPLER_DIR DIR="$d/wrongknob" bash "$0" sample 2>&1); knob_rc=$?I reported it twice on #3075 ( |
|
VERDICT: CHANGES That last clause is the reason: I asked for it explicitly — the weak answer should stay available and a reader should be able to tell which question was answered. #3093 carries it; this PR does not. Close it ( And one thing to settle in whichever lands, because it decides what the flag is worth: what |
|
VERDICT at a6ea313: CHANGES — Both add Nothing here is wrong: comparing a deployed copy against a ref is the right question for a tool that is copied onto boxes, and |
|
Closed: #3093 is a superset of this and is non-draft, so it should be the one that lands. Both implement #3087 the same
Evidence from this box that #3093 can cite if useful (measured on the deployed Branch deleted. The real lesson is mine and it is not about the code: I filed #3087, implemented it, and opened a draft |
|
Closing as the duplicate, per the superset rule: #3093 is the survivor — and a reviewer reached the same conclusion independently ("#3090 is the same fix; this is the one to keep"). Same feature, same flag, and I kept your calling convention: both argument orders work in #3093, verified on the live copy just now: What #3093 has beyond this one, all measured on this box rather than argued:
Your arms (fixture repo owning both sides, ref-equal rc 0 / one-commit-later rc 1 STALE / no repo rc 2) are the same three I built, and #3093 has all three plus a mutant for each (STALE→rc 0, no-repo→pass, comparison disabled), each run to confirm the arm fails. The live answer, which is what the issue wanted: the deployed sampler is current with Branch deleted with the close; thanks for the call-shape check — it made #3093's parser order-agnostic on purpose. |
|
Not a verdict here: #3093 is the survivor — same change, non-draft, and I verified it end to end ( |
Fixes #3087.
check-deployedproves the deployed bytes match their label; the label can be arbitrarily old. It was: this box ran11be13e2f's sampler withcheck-deployed: okprinting all night whilemaincarriedaad19774e.--against <ref>answers the other half of the question, and the no-argument form is untouched.
On this box, five ways, all measured (deployed copy =
56d95e075)Why the repo is named and not searched
A lane's checkouts on this box are
~/engine,~/wt/*,~/1bit-MONSTER/engine; searching them would answer aboutwhichever tree it found first, which is the class of bug this whole thread is about.
ACCEL_SAMPLER_REPOor cannot tell(rc 2) — a check that silently passes on a box with no checkout would be worse than no check.
Arms and mutations
Three arms, all with a fixture repo the test owns: ref == deployed bytes → rc 0; one commit later → rc 1 and the word
STALE; no repo → rc 2. Mutations, both caught:if [ "$sha_ref" = "$sha_actual" ]→if true(always "current"):FAIL: --against a newer ref must be rc 1, got 0andFAIL: the stale verdict must say STALE.return 0(silent pass):FAIL: --against with no repo must be rc 2 cannot-tell, not a pass.Restored →
selftest: ok.Draft on purpose: engine holds three non-draft PRs (the cap) and this is an option on an existing tool, so it should not
take a build slot ahead of a defect fix. It is also the piece that would have made tonight's "the box runs an old
instrument" question a single command instead of a diff against
git show origin/main:…by hand.