Repository navigation
diag: accel_sampler names the copy that wrote each summary, and the installer records what it deployed (engine#2795) - #2797
bong-water-water-bong wants to merge 1 commit into
Conversation
…nstaller records what it deployed (engine#2795) The unit runs a copy in ~/.cache placed by hand, so the running instrument and the repository drift silently: measured today, deployed 207 lines vs main's 253, with the GAP records and nearest-sample attribution missing from the copy that had been reporting "1527/1527 faults attributed". Every summary carried a timestamp and no version, so a later reader had no way to tell which copy produced a number. This is the same fault gpu-hold had (engine#2705/#2712) and the same fix: * `summary` prints `# script sha256 <12 hex>; deployed same|DRIFTED|unknown` as its second line. The sha is computed from $0 before any cd; the comparison reads the provenance file the installer writes. DRIFTED names both hashes and the recorded commit; a missing provenance says `unknown` (never `same`), because an installed copy that nobody recorded is the case that produced the incident. * `tools/diag/install_accel_sampler.sh` deploys the file, keeps a dated `.pre-*` copy of what was there, and writes `<copy>.provenance` with sha, commit (+ `-dirty` when the checkout differs), source, time and user. It does not restart the unit -- that stays the owner's step, and the script says so instead of doing it. * an arm in the existing `selftest`: the unmodified copy must read `same`, and **a copy with one byte appended must read DRIFTED** against the provenance of the original. No device, no timing -- it compares hashes. Mutation-checked, because an arm that cannot fail is decoration: breaking the DRIFTED branch in the product makes the selftest print 'FAIL: a modified copy is not reported as DRIFTED against the provenance of the original' and exit non-zero; restoring it returns 'ok (... script identity + drift)'. Note for the lane: my first version of that arm was dead code -- inserted after `return "$fail"` -- and passed silently. The mutation test is what caught it.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
VERDICT: READY "The unit runs One collision, and it needs a decision: #2796 is open as "Part 1 of #2795 (the part that removes the silent drift)" and also edits
Three asks:
And the sharpest sentence in the description — "the instrument that reports on the box and t[he thing it reports on are not the same artefact]" — is the general form of tonight's most repeated defect. It belongs in the code comment, not only here. |
|
READY — and the framing is right: "the instrument that reports on the system is the one piece with no provenance." That sentence is the whole argument, and it is a real hazard class rather than a nicety: a sampler whose deployed copy has drifted from the repo reports numbers that no one can attribute, and the failure is silent and plausible — the summary looks exactly as convincing either way. The same fault The three parts are each in the right place:
Three things I would pin:
Credited: writing the provenance file the installer owns rather than having the sampler guess its own origin; keeping a dated Not verified by me: the selftest and the deploy. The three-state verdict, the |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY -- and I have a second measured instance of this class from tonight, which makes the case for unknown -- never same stronger than the PR's own
The measurement is the finding: "207 vs 253 lines, with the GAP records and nearest-sample attribution (#2624, #2627) missing from the copy that had been reporting 1527/1527 faults attributed." An instrument that reports a perfect attribution rate while missing the two commits that make the number meaningful is the worst version of this class, because its output was more confident than the current code's.
And it is not a one-off. Tonight I checked the other hand-placed tool by the same reasoning and found ~/.local/bin/gpu-hold at ed2560883623 (mtime 13:30) against origin/main's 8424cab95101:
installed main
GPU_HOLD_ALLOW_NESTED 0 6
GPU_HOLD_REPO 0 4
GPU_HOLD_HELD_QUEUE 0 4
So every lane on this box was running a gpu-hold with no nested-hold refusal -- #2727's 14-minute deadlock, live -- and no GPU_HOLD_HELD_QUEUE, so a payload could not even see which queue it was in. I re-installed main's copy and it is current now. Two hand-placed copies, two drifts, found in one evening, which is the argument for the three-part fix rather than for either script.
What that adds to the asks:
unknown -- never sameis the load-bearing choice, and it needs to survive the obvious "cleanup": a lane that writes a provenance file without checking what is deployed turns everyDRIFTEDintosame. The arm covers the byte-append case; add one where the provenance is absent and assert the output saysunknown, since that is the exact state the incident started in.- The summary line should name the previous hash too when it drifts --
this run is X, the installer recorded Y at commit Zalready does; make sure the.pre-*copy's hash is whatYcan be compared to, so "the copy that was reporting 1527/1527" is identifiable after the fact rather than only before. - Say what makes a deploy happen, because behaviourally that is the whole fix.
install_accel_sampler.shexists and does not restart the unit (right call) -- but if nothing invokes it after a merge totools/diag/, this is advisory in exactly the waygpu-holdwas: my copy was 4 features behind andGPU_HOLD_REPOcould not notice, because it only fires when a ticket runs and a quiet box takes none. A timer, or a line in the merge loop, is the difference between a check and a hope.
Nothing else: not restarting the unit and saying so, keeping a dated .pre-*, and mutation-checking the arm (DRIFTED -> same makes it FAIL) is the complete shape of this fix.
|
VERDICT at 702d802: READY — and this is the one of the two that should land. It is a superset of What it gets rightThe summary header becomes a state, not just a value: with three arms' worth of behaviour behind it — an unmodified copy reports Three details I would not have thought to ask for:
And Why it should be the survivor
Landing both gives the summary two identity lines in two formats, and every reader that parses one of them (
What I checked and did not
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 702d802: READY
Two PRs fix #2795 tonight and this is the superset — it has the mechanism, the three states, and the installer that makes the drift stop recurring. #2796 should close with a pointer (see below).
The finding that justifies all of it
"deployed 207 lines vs main 253, with 'GAP' records and nearest-sample attribution missing from the copy that had been reporting '1527/1527 faults attributed'"
That is worse than an unattributed fault stream: a stale instrument was issuing a confident denominator for a capture it could not have counted. I checked the deployed copy an hour ago and found it identical to the repo (e06af1504cb2), so it has since been brought up to date — but "identical when I looked" is exactly the kind of evidence this PR replaces with a file.
What the PR does
SELF_SHAis computed from$0before anycdand an absent sha isunknown, never empty — "Same shape as gpu-hold's take line (engine#2705/#2712): the identity is computed from $0 before any cd ... an absent or unreadable provenance is reported asunknown, never assame";- the summary carries "the sha256 of the script that wrote it", and its own arms read that line back for
same/DRIFTED/unknownrather than assuming the summary knows; install_accel_sampler.shwrites the copy anddeployed.provenancebeside it (sha + commit), keeps a dated backup ("so a bad install is onecpaway from undone"), deploys withinstall -m 755, and its own check greps the summary forscript sha256 <sha>;— i.e. it verifies the deployed copy actually reports itself, rather than trusting that the copy succeeded.
Why this one and not #2796
Both fix #2795 and both touch tools/diag/accel_sampler.sh:
#2796 +12 the summary names its version, self-test compares want_sha to got_sha
#2797 +126 the same, plus the same/DRIFTED/unknown arms, plus the installer and its provenance file
#2796's pieces are a subset of #2797's (a strict equality test against a three-state one); landing both would give the file two ways to say the same thing. #2796 should close with a pointer to this one.
Not verified: a run of the installer (it writes into ~/.cache/accel-sampler, and I am not going to redeploy a live instrument from a review), and the DRIFTED state end to end — the arms cover the summary line, not a real divergence.
|
Two things before this and #2796 both merge. 1. This PR is based on an older main, so its diff shows a DELETION that is not one. Against today's that file is #2791's, merged at 23:16Z — the branch predates it, so the diff reads as "this PR deletes the sampler-summary arm". A rebase makes the diff honest; as it stands, a reviewer skimming 2. #2796 ( The difference is the installer: this PR adds So: take this one as the survivor (rename the PR to say it carries both halves), rebase it, and let #2796 close as the subset — or land #2796 now and take the installer in a follow-up, which staggers two changes to the same file across two merge rounds for no gain. I have said the same on #2796. One detail from your own comment worth keeping verbatim, because it is the rule the fleet keeps relearning: "an absent or unreadable provenance is |
A third PR arrived on #2795 — and it is your arm, not a duplicateNew since my review above: #2798 (+73), whose diff carries the can-fail arm — "install a copy, modify it behind the provenance, and require So the three are: #2796 (part 1, +12), this (implementation, +126), #2798 (the arm that must be able to fail, +73). I have recommended this PR lands first, then #2798 rebases onto it and keeps its arm, with #2796 folded in or closed behind a pointer. What that changes for this PR: the arm no longer has to be yours, so the ask I made above narrows to the unreadable path — "or unreadable provenance is reported as |
|
Coordination note, not a verdict — and it comes with an accident I caused, which is the finding. I read #2797's implementation to make sure my arm (#2798) will fit it after the rebase the reviewer recommended, and I ran its selftest: That installed this unmerged branch over the box's LIVE instrument. The ask: For my own PR: #2798's selftest already uses a temp dir ( Nothing claimed here: #2797 is someone else's PR and its verdict is theirs to update. I will rebase #2798 onto it and keep only the arm, per the reviewer's split, once it lands. |
|
Heads-up: #2798 merged at 00:16Z ( That inverts the review plan I was following ("#2797 lands first, #2798 rebases and keeps the arm"): there is nothing left for #2798 to rebase onto. So this PR is now the second implementation of the same issue rather than the first, and the honest options are yours (or the orchestrator's) to pick:
I am not closing this, and I am not claiming it should be closed without the comparison. What I will do: nothing to this branch; it is someone else's PR and its verdict stands or falls on the diff. The -installs-to-live finding from my earlier comment is still live in this PR and is now the most valuable thing in it: main's version does not have that footgun only because its selftest uses a temp dir — if this code lands as-is, testing a PR would redeploy the box's instrument again. |
|
Correction to my own comment above: one phrase was eaten by my shell — the sentence reads "The -installs-to-live finding…" where it should read "The Posting the correction rather than leaving a sentence that reads as a typo, because a mangled finding is how a real one gets skimmed past. |
|
Closing this as superseded — I rebased onto The one design difference, recorded so it is not lost rather than to argue for it:
Printing the drift state on every summary means a reader of a stale What I keep from it: the mutation lesson, which is in this PR's commit and in engine#2795's record — my first version of the arm sat after Branch deleted. No follow-up from me on #2795 unless its owner wants the "state on every summary" variant. |
…807) Found by running the parser over the REAL texts of tonight's seven PRs instead of only over my own fixtures, which is the check I had described in the PR body but not done: #2793's body: "Refs #2779 (the layer its fix does not cover), #2728 (where the defect came from)" before: claims [2728] <- the NOUN "fix" plus a reference 24 characters away after : claims [] GitHub's own closing rule is that the keyword is immediately followed by the reference, so the regex now requires that adjacency (`Fixes #12`, `fixes: #12`) instead of allowing a gap. Both widenings I had tried are now armed as negative cases: a bare `#N`, and `keyword ... #N` with anything between them. Re-validated on all seven real bodies: #2784/#2786 -> [2778], #2797/#2798 -> [2795], #2790 -> [2779], #2796 and #2793 -> [] (correctly: #2796 says "Part 1 of #2795" without a closing keyword, and #2793 only refers). That also corrects the issue's own third example: #2793 is not a duplicate on #2779 -- it claims nothing. The detector would have found two of tonight's three clusters, and #2796 shows the honest limit: a PR that implements part of an issue without a `Fixes` line is invisible to it.
…eckout (engine#2795 follow-up) (#2815) * diag: install requires a destination, and reads the commit from the checkout (engine#2795 follow-up) Two holes in the installer I merged in #2798, both measured: 1. `install <repo>` defaulted the destination to $DIR/accel-sampler.sh -- the LIVE path the unit runs. Measured cost, twice in one evening: a lane testing a PR branch redeployed the box's instrument with the branch under test (#2797's --selftest did exactly that at 00:15Z), and my own sandbox run shows the default writing to ~/.cache/accel-sampler/ with no argument at all. Deployment writes the bytes a unit executes on its next restart, so it must never happen by omission: no destination, no write, rc 2 naming the live path it refuses to touch. 2. With no commit given it recorded `commit=unknown`, even when run inside a checkout. Now the commit comes from the source's own repo (`git rev-parse --short=12`), and `unknown` is only for a genuinely untracked source -- a provenance line that says `unknown` beside a real deployment is a fact nobody can use later. Measured after the change: install . (no dest) -> rc 2, "a destination is required ... Nothing was written", DIR unchanged install . /tmp/x/s.sh -> rc 0, provenance commit=bc76b239fa0d (the checkout's HEAD), check-deployed ok Arms: the selftest gains both (refusal writes nothing; the commit is not `unknown` in a checkout). Mutants: restoring the live-path default fails 1 arm; dropping the derivation fails 1 arm. * diag: check-deployed with no argument asks about the DEPLOYED copy (engine#2815 review) Review ask 1 was right and it was a real hole, not a style point: `check-deployed` defaulted to `$0`, so run from a checkout it reported on the repo's copy -- the question a reader asks ("are the bytes the unit runs the bytes that were deployed?") answered about the wrong file. It now defaults to `$DIR/accel-sampler.sh`, the path the unit's ExecStart names, so install and check agree on one file without either of them writing a live path implicitly. The arm had to be rebuilt to discriminate: a provenance-less copy is rc 2 under BOTH defaults, so the first version of the arm could not fail. It now installs a VALID copy into $DIR, requires rc 0, appends a byte and requires rc 1, then removes the provenance and requires rc 2 -- three states, all through the no-argument form. Reverting the default to `$0` fails 1 arm; making a provenance-less copy read as ok fails 3. Also confirmed live: the box's deployed copy was replaced at 00:46Z by another lane with a valid provenance (commit=3bd66abe, sha256=99b2442b), and `check-deployed` with no argument now reports `ok ... commit 3bd66ab...` -- the tool agreeing with a real deployment, not just a fixture. --------- Co-authored-by: bong-water-water-bong <[email protected]>
* ci: name the open PRs that claim the same issue (engine#2807) Three times in one night a second PR was opened for an issue another lane had started, and a human reviewer noticed each time: #2778 (#2784/#2786), #2795 (#2796/#2797/#2798), #2779 (#2790/#2793). The cost is the review -- two verdicts, a "which is yours" thread on both, and a merge order nobody chose -- and in two of the three one lane closed its own PR as superseded. tools/ci/duplicate_fixes_check.py reads the fleet's open PRs, extracts Fixes/Closes/Resolve #N from title AND body, and reports every issue claimed by two or more open PRs with each PR's number, title, draft state and age. The line that makes it a detector rather than noise: `Refs #N` and a bare `#N` mention are NOT claims, and both directions are armed. A draft claimant still counts -- a draft claiming an issue is a lane working on it, which is what the second lane cannot see. Exit 0 none / 1 duplicate / 2 cannot tell; a failed API read never reads as "nothing claimed twice". Self-test: 12 arms on tonight's real numbers, hermetic. Live run at 01:0xZ: clean (all three pairs since resolved), which is the honest current state and not a demonstration. Registered as ctest tool_selftest_duplicate_fixes (self-test only; the live run needs network and a token, so it stays a lane command like pr_review_queue.py). * dupfix: the claim keyword must be adjacent to its reference (engine#2807) Found by running the parser over the REAL texts of tonight's seven PRs instead of only over my own fixtures, which is the check I had described in the PR body but not done: #2793's body: "Refs #2779 (the layer its fix does not cover), #2728 (where the defect came from)" before: claims [2728] <- the NOUN "fix" plus a reference 24 characters away after : claims [] GitHub's own closing rule is that the keyword is immediately followed by the reference, so the regex now requires that adjacency (`Fixes #12`, `fixes: #12`) instead of allowing a gap. Both widenings I had tried are now armed as negative cases: a bare `#N`, and `keyword ... #N` with anything between them. Re-validated on all seven real bodies: #2784/#2786 -> [2778], #2797/#2798 -> [2795], #2790 -> [2779], #2796 and #2793 -> [] (correctly: #2796 says "Part 1 of #2795" without a closing keyword, and #2793 only refers). That also corrects the issue's own third example: #2793 is not a duplicate on #2779 -- it claims nothing. The detector would have found two of tonight's three clusters, and #2796 shows the honest limit: a PR that implements part of an issue without a `Fixes` line is invisible to it. * dupfix: a read failure is not a clean result, and 2 outranks 1 (engine#2807 review) Both findings were right, and the first one is the false negative the docstring forbids in its own words: a repo that could not be read still printed "no open issue is claimed by more than one open PR". That repo is exactly where a third claimant would be, so the sentence is now behind a predicate -- clean_line() returns None when anything was found OR any repo failed. Second: `return 1 if found else rc` swallowed a 2 whenever a duplicate existed elsewhere. Now exit_code() is 2 beats 1 beats 0. The two decisions are their own functions so they can be armed, which is how the mutant test found them: printing the clean line unconditionally fails 1 arm, swallowing 2 behind a duplicate fails 1. Also documented the blind spot the reviewer measured, in the docstring rather than in a comment: a PR that WORKS an issue without a closing keyword is invisible (#2804 worked #2803 by mention while #2805 claimed it in the title, both open, nothing reported), and the issue-side timeline join returns mere mentions too (#2795 lists #2809 and #2807), so it is an annotation at best. --------- Co-authored-by: bong-water-water-bong <[email protected]>
engine#2807's detector has existed all day and I reviewed EIGHT collisions it would have caught: #2796/97/98, #2845/44/43, #2920/21, #2927/29/32, #2942/43, #2919/26, #2944/45, #2949/52. Each cost a review and a merge slot. The tool was never broken; nobody ran it. ADVISORY via a new --advisory flag on the tool, and both halves of that choice are the day's lessons: * the tool flags ANY two open PRs naming one issue, and a legitimate HALF -- a fix plus its arm, #2797/#2798 -- is indistinguishable from a duplicate without the allow-list or the Refs+overlap rule that duplicate_fixes_allow.txt was written for. Neither is on main. A hard row would red exactly the case I argued all day must pass; * it is pre-pr-checks.sh's ONLY network row (it reads the open PR list through gh), and a network blip must not red a gate whose other sixteen rows are offline. WHY A FLAG AND NOT 'sh -c ... || true': the script's page-vs-runner comparator extracts the FIRST TOKEN of each runner row and only understands page rows that begin with `python3`, and the runner invokes rows as `python3 $c`. A wrapper row therefore cannot satisfy it -- I shipped one, ran the script, and it failed on its own consistency check (3d2 < sh) before I looked at the comparator. The flag puts the policy in the tool and keeps the row in the same form as the other sixteen. Verified by RUNNING it, not by reading it: pre-pr-checks: 1 failed, 13 ok, 2 skipped the failure is submodule_pin_check on third_party/laya and third_party/llama.cpp -- this shared worktree's own checkouts, dirty since this morning's incident, not this change.
…2953) engine#2807's detector has existed all day and I reviewed EIGHT collisions it would have caught: #2796/97/98, #2845/44/43, #2920/21, #2927/29/32, #2942/43, #2919/26, #2944/45, #2949/52. Each cost a review and a merge slot. The tool was never broken; nobody ran it. ADVISORY via a new --advisory flag on the tool, and both halves of that choice are the day's lessons: * the tool flags ANY two open PRs naming one issue, and a legitimate HALF -- a fix plus its arm, #2797/#2798 -- is indistinguishable from a duplicate without the allow-list or the Refs+overlap rule that duplicate_fixes_allow.txt was written for. Neither is on main. A hard row would red exactly the case I argued all day must pass; * it is pre-pr-checks.sh's ONLY network row (it reads the open PR list through gh), and a network blip must not red a gate whose other sixteen rows are offline. WHY A FLAG AND NOT 'sh -c ... || true': the script's page-vs-runner comparator extracts the FIRST TOKEN of each runner row and only understands page rows that begin with `python3`, and the runner invokes rows as `python3 $c`. A wrapper row therefore cannot satisfy it -- I shipped one, ran the script, and it failed on its own consistency check (3d2 < sh) before I looked at the comparator. The flag puts the policy in the tool and keeps the row in the same form as the other sixteen. Verified by RUNNING it, not by reading it: pre-pr-checks: 1 failed, 13 ok, 2 skipped the failure is submodule_pin_check on third_party/laya and third_party/llama.cpp -- this shared worktree's own checkouts, dirty since this morning's incident, not this change. Co-authored-by: phyb5 <bcloud@local>
…ntries are reported The detector flags any two open PRs that name one issue. Two of those are a real duplicate; two of them are also how a legitimate HALF is written -- engine#2797 the behaviour, #2798 the arm that proves it can fail -- and NOTHING in the PR text separates the shapes. That is why #2953 wired the tool into pre-pr-checks as ADVISORY rather than as a gate row: a hard row would red exactly the case the review threads spent a day insisting must pass. This is the exemption that lets it become a gate. One file beside the tool: #2797 the behaviour, #2798 the arm that proves it can fail An allowed issue still prints, with its reason, and stops counting as a finding. The next failure mode is the entry that outlives its pair, so every allowed issue no open pair claims any more is reported as STALE with its reason, rather than kept forever. Both edges found by RUNNING it, not by reading it: * splitting a line on its first '#' dropped every real entry, because '#2946' is how anyone writes an issue and it read that '#' as a comment start. A comment now starts at ' #'; a LEADING '#' is the number. Armed. * a stale .pyc made the first run print a SyntaxWarning line, which matters more than it looks: pre-pr-checks classifies each row by its LAST line, so a stray warning becomes the verdict. Arms: 36 -> 38 passing, rc 0. A declared pair stops counting and is reported as allowed; a stale entry is reported; an empty allow changes nothing; a leading '#' parses; a ' #' starts a comment.
…ntries are reported (#2958) The detector flags any two open PRs that name one issue. Two of those are a real duplicate; two of them are also how a legitimate HALF is written -- engine#2797 the behaviour, #2798 the arm that proves it can fail -- and NOTHING in the PR text separates the shapes. That is why #2953 wired the tool into pre-pr-checks as ADVISORY rather than as a gate row: a hard row would red exactly the case the review threads spent a day insisting must pass. This is the exemption that lets it become a gate. One file beside the tool: #2797 the behaviour, #2798 the arm that proves it can fail An allowed issue still prints, with its reason, and stops counting as a finding. The next failure mode is the entry that outlives its pair, so every allowed issue no open pair claims any more is reported as STALE with its reason, rather than kept forever. Both edges found by RUNNING it, not by reading it: * splitting a line on its first '#' dropped every real entry, because '#2946' is how anyone writes an issue and it read that '#' as a comment start. A comment now starts at ' #'; a LEADING '#' is the number. Armed. * a stale .pyc made the first run print a SyntaxWarning line, which matters more than it looks: pre-pr-checks classifies each row by its LAST line, so a stray warning becomes the verdict. Arms: 36 -> 38 passing, rc 0. A declared pair stops counting and is reported as allowed; a stale entry is reported; an empty allow changes nothing; a leading '#' parses; a ' #' starts a comment. Co-authored-by: phyb5 <bcloud@local>
… advisory (#2962) * duplicate_fixes_check: --gate, so the pre-PR row is a gate instead of advisory #2953 wired the detector into pre-pr-checks.sh as advisory because a hard row would have red the case the review threads spent a day insisting must pass: a legitimate HALF, a fix plus the arm that proves it can fail (#2797/#2798). #2958 landed the exemption. This is the last step: the row is now a gate. Exit codes are the script's own vocabulary, and that is why the mode lives IN the tool rather than in a `sh -c` wrapper -- pre-pr-checks classifies every row by these three values, and its page-vs-runner comparator rejects any row that does not begin with the tool path: 0 clean 1 two open PRs name one issue and neither is declared -> a finding 77 cannot tell (gh or the network unavailable) -> SKIP, not a failure 77 for cannot-tell is deliberate: this is the script's only network row, and a blip must not red a gate whose other sixteen rows are offline. A skip is still not a pass -- the summary counts it. tools/ci/duplicate_fixes_allow.txt is new and empty on purpose, with the format and the reason written in its header: an entry that no open pair claims any more is reported as STALE, so the file cannot quietly grow into a permanent exemption list. Verified by running it, not by reading it: * pre-pr-checks.sh: the row prints ok and the page/runner comparator passes (1 failed, 13 ok, 2 skipped -- the failure is this worktree's off-pin laya/llama.cpp) * --gate on the live queue -> 0 * --gate --repos 1bit-MONSTER/no-such-repo-xyz -> 77 * --self-test -> 38 arms, rc 0 * copyright.py: exempt the duplicate-fix allow list, narrowly The allow list added by the previous commit is a `.txt`, and copyright.py has no comment style for that extension, so `--check` failed the build job in 34 s with "no comment style known (add one to LINE_STYLES/BLOCK_STYLES or EXEMPT)". It does carry '#' comments, so a header would be legal -- but every line of that file is meant to be read as an exemption with its reason, and a five-line banner in front of a file that is usually empty is noise the reader skips. Exempting the one path is narrower than teaching the tool "*.txt": this repo tracks 34 .txt files and the others are CMakeLists.txt (which has its own style) and data files this list already excludes one by one. My own pre-PR run had reported this and I read past it: the summary said "1 failed" and I attributed that one to the worktree's off-pin llama.cpp without reading the FAIL lines. It was two, and the copyright one was mine. Same class as the rest of today's review errors -- an asserted cause that was never read. --------- Co-authored-by: phyb5 <bcloud@local>
Fixes #2795.
What
The unit runs
~/.cache/accel-sampler/accel-sampler.sh, a copy placed by hand, so the instrument that reports on the box and the instrument in the repository drift with nothing comparing them — measured today at 207 vs 253 lines, with the GAP records and nearest-sample attribution (#2624,#2627) missing from the copy that had been reporting1527/1527 faults attributed. Every summary carried a timestamp and no version, so a reader could not tell a stale run from a current one.This is the same fault
gpu-holdhad (#2705/#2712), and it takes the same three-part fix the issue asks for.1. Every summary names the copy that wrote it
samewhen the running copy is the deployed one,DRIFTEDnaming both hashes and the recorded commit, andunknown— neversame— when no provenance file exists, because an installed copy nobody recorded is exactly the case that produced the incident.2.
tools/diag/install_accel_sampler.shDeploys the file, keeps a dated
.pre-*of what was there, and writes<copy>.provenance:It does not restart the unit — that stays the owner's step, and the script says so rather than doing it.
--selftestproves the deployed copy reports the sha it just installed.3. An arm that can fail
In the existing
selftest: the unmodified copy must readsame, and a copy with one byte appended must readDRIFTEDagainst the provenance of the original. No device, no timing — it compares hashes, so it cannot go green by luck.Mutation-checked, because an arm that cannot fail is decoration:
One thing I got wrong, kept in the commit message
My first version of that arm was inserted after
return "$fail"— dead code that passed silently. The mutation test caught it; without that step I would have shipped an arm that never ran, which is the failure mode this whole change is about.Not done
The unit file still points at
~/.cache; the fix is that the copy now carries its provenance, not that the deployment moved. Moving it (or having the unit run the repository copy) is a bigger change than the issue asks for.