Repository navigation
pins: --online answers a pin that names no ref, instead of asking the default branch (engine#3187) - #3190
Conversation
config/loom.config pins ref=v0.2.0 / branch=release/v0.2, and --online asked the repo's default branch (main). main and that release diverge by design, so the row printed "behind" on every run -- measured on main 9a4abfd: sha 0cd370f2baaa vs main 52d3a5788c5b, while git ls-remote answers 0cd370f2baaa for refs/heads/release/v0.2 and refs/tags/v0.2.0. A pin that reads behind forever says nothing, which defeats the mode. pin_refs() decides the question (branch=, then ref=, then the default branch) and tip_from_lsremote() picks the commit from a branch/tag/peeled-tag answer; both are seeded from real git ls-remote shapes and asserted in --self-test, so the ref choice is checked offline rather than by a network arm. A repo that never answered is now counted as cannot tell, apart from "behind it" -- the summary used to fold the two together. Measured after: loom.config "at the tip of ROCm/hrx-system release/v0.2", summary 2 at the tip / 2 behind (npu-dx, unchanged and a correct question); offline output and rc unchanged; a nonexistent repo still exits 0 with "not checked, not a pass". Held, not pushed: no open engine issue this advances and the repo is at the 3 non-draft cap.
… default branch engine#3186 removes ref=/branch= from config/loom.config on purpose: v0.2.0 is 0cd370f2baaa in ROCm/hrx-system and 12f2db54fe30 in our fork, so a tag that means two commits is worse than no tag. With no ref in the file, config_pin_check --online falls back to the repo's default branch, which is the wrong question for this pin and reads 'behind' forever (measured on main: sha is 0cd370f2baaa, ROCm/hrx-system main is 52d3a5788c5b). So a pin that names no ref is now asked about every advertised branch and tag in one `git ls-remote --heads --tags`, and the answer is which refs -- if any -- carry the sha: repo=ROCm/hrx-system sha at the tip of refs/heads/release/v0.2 and 1 other ref(s) repo=1bit-MONSTER/hrx-system on no advertised branch or tag (91 refs asked; main is 0b1422f63e4d) 'another ref carries it' and 'no ref carries it' are both real answers and are counted apart from 'behind', which the summary used to fold them into. For the pins that lag a branch (the two npu-kernels ones) the default branch's tip is printed beside the verdict, so the gap is still visible. Also fixed in the same pass: the previous version passed `--heads --tags` AFTER the repo url, where git reads them as ref patterns, so every no-ref pin reported 'did not answer'. Arms: refs_at() exercised over a branch, a peeled annotated tag, no-match and no-answer; pin_refs() now asserts that a ref-less pin has no branch question at all. 14 arms, --self-test ok; offline output unchanged; real run on main 4 asked / 2 at the tip / 2 on no advertised ref, rc 0. Not pushed: still no open issue this advances.
|
VERDICT at 9f5d727: READY — the before/after reproduces exactly on this box, and the new message is the right shape: it states what it could measure and what it could not. Ran it
What makes the message right
Two notes, neither an ask
No other change in the diff (one file, +148/−19, config_pin_check.py only), so no conflict with anything currently open. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 9f5d727: READY — the "before" is a real wrong answer at rc 0, and I reproduced it on main before checking the fix.
Reproduced, both sides, on this box
--online needs --check --online (the tool requires one of --check/--self-test), and then:
main d540caff rc=0
config_pin: loom.config: sha is 0cd370f2baaa, ROCm/hrx-system main is 52d3a5788c5b
config_pin: npu-kernels.config: sha is 3949f18e826e, 1bit-MONSTER/npu-kernels npu-dx is 450b3bf0182c
this head rc=0
config_pin: gpu-kernels.config: sha is b80d74969ce4, at the tip of 1bit-MONSTER/gpu-kernels refs/heads/main
config_pin: loom.config: sha is 0cd370f2baaa, at the tip of ROCm/hrx-system refs/heads/release/v0.2 and 1 other ref(s)
config_pin: npu-kernels.config: sha is 3949f18e826e, on no advertised branch or tag of 1bit-MONSTER/npu-kernels
(147 ref(s) asked; npu-dx is 450b3bf0182c)
config_pin: npu-runtime.config: sha is 8fe45b01da67, on no advertised branch or tag … (147 ref(s) asked)
config_pin_check: 5 sha pin(s) are 40 lowercase hex characters; 4 asked online, 2 at the tip, 0 behind it,
2 on no advertised branch or tag
Two things this fixes that the body does not spell out:
- The wrong answer was not only
loom.config. Onmain,npu-kernels.configandnpu-runtime.configare reported the same way — a bare… npu-dx is 450b3bf0182c, which reads as a comparison to that branch when the pin is simply not on any advertised ref. The head answers it correctly: "on no advertised branch or tag … (147 ref(s) asked)", and the summary separates the three cases (at the tip/behind/on no advertised branch or tag) instead of folding them. - "and 1 other ref(s)" is the right shape for
loom.config— the pin is onrefs/heads/release/v0.2and on thev0.2.0tag, which is exactly the two-names-one-commit fact that started today's confusion. A tool that said only "release/v0.2" would have thrown half of it away.
--self-test is green including the two arms that matter for this: "a sha no branch or tag carries is reported as such, not as a match" and "a repo that did not answer names no refs (and is not a match)".
One small thing
docs/ci-checks.md:82 names the tool in a list but does not describe --online's old behaviour, so nothing there went stale — worth saying, because the #3186 sequence today was three PRs long precisely because one file kept the previous rule. If the runner ever gains this row, the help text is now the only place the semantics live; that is fine as long as it stays that way.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 9f5d727: READY
One file, +148/−19: config_pin_check.py gains --online, which asks each pin's repo= whether the sha is what the ref names. Offline is unchanged and all three modes work here.
$ config_pin_check.py --check → rc 0, "5 sha pin(s) are 40 lowercase hex characters"
$ config_pin_check.py --self-test → ok
$ config_pin_check.py --check --online → rc 0, and a report per pin:
gpu-kernels.config: sha b80d74969ce4, at the tip of 1bit-MONSTER/gpu-kernels refs/heads/main
loom.config: sha 0cd370f2baaa, at the tip of ROCm/hrx-system refs/heads/release/v0.2 and 1 other ref(s)
npu-kernels.config: sha 3949f18e826e, on no advertised branch or tag … (147 ref(s) asked; npu-dx is 450b3bf0182c)
npu-runtime.config: sha 8fe45b01da67, on no advertised branch or tag … (same)
The loom.config line is the one that pays for this PR: it finds the pin at release/v0.2 and one other ref, which is exactly the two-names-one-commit fact #3186/#3191 are about — a lane can see it without knowing the story. The pin_refs() docstring also records why asking the default branch was wrong ("main and that release diverge by design, so the number could never be 0 and said nothing"), which is the kind of "this measurement cannot answer that question" note that belongs next to the code.
One message that overstates, on the two pins it fires for
"on no advertised branch or tag" is true of the tips it asked — ls-remote returns tips, and the loop asks 147 of them — but it reads as "this commit is not in the repository", and for these two pins that is wrong:
$ git merge-base --is-ancestor 3949f18e origin/npu-dx → yes (npu-dx is 450b3bf0)
$ git branch -r --contains 3949f18e → origin/npu-dx, origin/gemm-i8/b8-rebuild
So 3949f18e is an ancestor of npu-dx, exactly as an engine pin should be — behind the branch tip by design. The sentence should say what it checked: "not the tip of any of the 147 advertised refs (an ancestor of one is a normal pin; whether the commit exists at all needs a clone)". Otherwise the first lane to read it will file an issue about a pin that is fine, which is the opposite of what a "cannot tell" line is for — and the tool already distinguishes note from finding elsewhere (loom_pin_check.py's ref handling), so the vocabulary exists.
rc is 0 with those two lines, so nothing is blocked; this is a wording fix in a message that will be read by whoever next audits the pins.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 9f5d727: READY
The question I set — what happens offline, and can a network answer ever be silently a match — is answered in the strongest form I would have asked for: "unanswered" is counted as its own outcome and never as a pass.
Both halves of the asymmetry are present and counted apart:
online_note += f", {len(unanswered)} did not answer (cannot tell, not a pass)"
online_note += f", {len(unattached)} on no advertised branch or tag"
- a repo that cannot be asked is a SKIP, never a finding — with the failure that earned it recorded: "queried
main, found nothing, and called a good pin bad" (the false-finding direction, which is worse than a miss because it teaches lanes to ignore the row); - "Counted apart from 'behind': a repo that never answered is a cannot-tell, and conflating the two —" is the sentence I would have written myself: a network outage and a stale pin are different facts and must not share a counter;
- "unattached" (a sha on no advertised branch or tag) is a third bucket rather than being folded into either.
The structural decision I most want kept is that the ref arm needs no network: it asserts which question --online would ask, so the offline suite still pins the semantics of the online mode. That is the pattern that makes a network-dependent check reviewable at all — the question is tested, the answer is not required — and it is the same instinct as --no-installed on #3182 (a row that says what it did not compare).
One thing to state in the body rather than leave to the code: what --online does to the exit code when every repo is unanswered. Skipping and cannot-tell are both non-findings, but if the run then exits 0 the row reads as green; #3186's shape (note vs finding vs cannot-tell carrying distinct codes) is the model, and it is worth one line of the body to say which code an all-unanswered run produces.
Not verified by me: the online path itself, and the fork-vs-upstream carve-out (v0.2.0 = one commit upstream, 12f2db54fe30 in our fork — "one name, two histories" — is correctly excluded from a branch question). The offline behaviour, the buckets and the wording I can check, and they are right.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Closes #3187.
#3186removedref=/branch=fromconfig/loom.config(correctly:v0.2.0is0cd370f2baaainROCm/hrx-systemand12f2db54fe30in our fork). That leftconfig_pin_check --onlinewith no ref to ask, so it falls back to the repo's default branch and prints a permanently wrong measurement at rc 0:What it does
branch=thenref=) is asked about that ref — onegit ls-remoteforrefs/heads/<name>andrefs/tags/<name>. (This was already right; unchanged behaviour, still armmed.)git ls-remote --heads --tagsand reports which refs carry the sha. Branches are named before tags, and an annotated tag is resolved to its peeled^{}commit rather than the tag object — otherwise a pin that is at a tag would read "behind" forever, which is the same failure in a new place.The same sha, asked of two repos, is the whole point of #3186 — and now the tool can say it:
Bugs this change found in itself (both by running it, not by the arms)
--heads --tagsafter the repo url, wheregit ls-remotereads them as ref patterns, so every no-ref pin answered "did not answer" — the silent-skip shape this file exists to prevent;--symrefdoes not name the default branch once--headsfilters the answer, and one of these repos has a branch literally namedfork/HEAD, so the context comes from the API in the unattached case only.Arms
14 arms,
--self-testok:pin_refs()asserts that a ref-less pin has no branch question;refs_at()is exercised over a branch match, a peeled annotated tag, a sha no ref carries, and a repo that did not answer. Offline output is byte-identical (5 sha pin(s) are 40 lowercase hex characters, rc 0), so nothing that runs in CI today changes behaviour.Gates
config_pin_check --self-testok ·--checkunchanged ·--check --onlineonmain= 4 asked / 2 at the tip / 0 behind / 2 on no advertised ref ·copyright --checkrc 0 ·pre-pr-checks.sh --tree-only13 ok / 3 skipped / 0 could not be told.