Repository navigation
ci: a registry CONTENT row, so a hand-edited architectures.json stops merging green (engine#2698) - #2699
Conversation
`registry_pins` (the only registry row in a PR job) compares `sources["llama.cpp (hrx)"]` with the gitlink and never reads the fork, so a hand-edited CONTENT passed every check: measured on main 3e591b1, deleting one entry from `gguf_architectures.hrx` -- the list CMakeLists.txt compiles into hrx_archs.h, which is what `1bit serve` refuses architectures against -- left `--check-pins` at rc 0 while `--check` said "is stale". A per-architecture `backends` edit is the same: rc 0 for `--check-pins` and for `--check-gaps`. So this adds ctest `registry_content` = `tools/registry_build.py --check`, in the job that already checks out third_party/llama.cpp, and `registry_content_fire` (a fake fork and a fake gitlink in a scratch repo) so the row's own mutant is in the suite. `--check` now exits 77 (CTest's skip) instead of 1 when the fork is not checked out: the content cannot be known there, and a skip must not read as a pass. Arm 4 of the new test pins the other direction -- a fork checked out at a commit other than the pin is a failure (rc 1), not a skip. Mutants run against the new test: content comparison removed -> 3 checks fail; the skip returned as 1 -> 1 fails; the pin guard removed -> 2 fail. 13/13 pass on the branch.
|
ready for review at 5633652 — engine#2698. The row this adds asserts the axis |
|
CI cost, since this row runs on every PR: 0.58-0.62 s with the fork checked out at the pin (three runs, |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 5633652: READY
The defect is real, the new row catches exactly the edit that was green, and all three mutants fire as claimed. I reproduced both arms on this box with my own edits, not by reading the diff.
The hole, reproduced on this head's base content
Arm 1 — one entry out of the compiled list (I removed hrx from AfmoeForCausalLM's backends, sources untouched):
$ tools/registry_build.py --check-pins → rc 0 "records the committed pins" <- the only registry row in CI
$ tools/registry_build.py --check → "…/architectures.json is stale: run tools/registry_build.py"
Arm 2 — the same shape with the whole backends row cleared: --check-pins rc 0, --check-gaps rc 0, --check stale. Both edits would have merged green before this PR, which is the claim.
The row and its mutants
$ python3 tests/registry_content_test.py
registry_content_test: 13/13 passed
$ time python3 tools/registry_build.py --check
…/architectures.json matches the pinned sources rc=0 0.626 s
$ bash scripts/pre-pr-checks.sh
pre-pr-checks: all 13 check(s) green, 2 skipped
Mutants, each reverted (tools/registry_build.py restored, git status clean afterwards):
| mutant | result |
|---|---|
old != text → False (comparison removed) |
3 checks FAIL |
raise SystemExit(77) → 1 (skip as a failure) |
1 check FAILS |
if head and head != pin(HRX) → False (HEAD guard removed) |
2 checks FAIL |
Exactly the table in the body.
Why the row will really run in CI, and cannot dirty the tree
ci.yml:77 inits third_party/llama.cpp shallow at the pin before the build job's ctest --test-dir build (ci.yml:161), so --check sees a fork at the pin rather than skipping; SKIP_RETURN_CODE 77 is set on registry_content in CMakeLists.txt, so the no-checkout case reports as a skip and not as a pass. --check writes nothing (open(…, "w") is in the regenerate path only, registry_build.py:283), so it cannot race a parallel ctest row or leave the tree dirty, and at 0.6 s the 600 s per-test timeout is not in question. The Apache notice is on the new test file and tools/copyright.py --check is rc 0.
Two notes, neither a change request
- The row goes quiet — skip, green — if the submodule step ever stops running in the
buildjob (a rename, a conditional, a matrix change). That is the same propertyhrx_f16_narrowing_checkalready has, and the skip message does name the checkout, so this is consistent with the house pattern. If you want it airtight, one line before the ctest step asserting the directory exists turns "the row I just added checked nothing today" into a red run. Your call; I would not hold the PR for it. pre-pr-checkshere says 13 green, 2 skipped, where the body says 12 green, 3 skipped — the difference issubmodule_pin_check, which passes for me because this worktree has the submodule initialised. Nothing to fix, just so the counts in the body do not look wrong to the next reader.
Fixes #2698 matches the issue as written (registry_pins compares only the recorded sha). Green gates plus my own verification at 56336526.
|
VERDICT: READY The table is the argument, and it is the right one: two axes existed, a third did not —
And the sentence that makes the gap consequential rather than theoretical: " Plus the content is load-bearing: Three asks:
And one thing worth keeping: naming the two existing rows and their |
|
CTest's own verdict on the row, which the tool's return codes alone do not prove — the Configure: 21 s ( |
|
The row ran in CI, in the job that matters, and it is the row it claims to be — not a local run, and not a skip: ( |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Fixes #2698.
What was missing
registry/architectures.jsonhas two axes, and only one had a row:registry_pins(--check-pins)sourcessha and the gitlinkregistry_gaps(--check-gaps)--checkis the form that regenerates from the pinned fork and compares; it ran only in the daily census, which opens a PR when the file differs (and exits early when that day's branch already exists) instead of failing the PR that made the edit.The repository already says so in passing:
.github/workflows/hrx-pins-guard.yml:23-25explains what that workflow does not cover with "ctest registry_pins only checks that the registry matches the gitlinks, not that the two pins compile together". The content half is the same blind spot, one axis over.The content is not cosmetic:
CMakeLists.txt:138-151readsgguf_architectures.hrxout of this file and writesbuild/generated/hrx_archs.h, andapp/serve.cpprefuses an architecture that is not in it. Abackendsedit changes what the registry claims the product runs.Measured on main
3e591b1(fork checked out at the pin148e7f329)Control:
--checkrc 0,--check-pinsrc 0.Arm 1 — delete one entry from the compiled list (
gguf_architectures.hrx, 171 -> 170,sourcesuntouched):Arm 2 — clear one per-architecture
backendsrow (AfmoeForCausalLM, one line):What this changes
registry_content=tools/registry_build.py --check, next toregistry_pins. It runs in thebuildjob, which already doesgit submodule update --init --depth 1 third_party/llama.cpp(ci.yml:77), so it costs a submodule read and no new checkout.--checkexits 77 where the fork is not checked out (the same shape ashrx_f16_narrowing_check, engine#1962), with a message naming the checkout. A fork checked out at a different commit than the pin stays rc 1 — that is a failure, not a skip, because the content would come from a tree the registry does not name.registry_content_fire—tests/registry_content_test.py: a fake fork, a fake gitlink, the real tool, in a scratch repo. Arms: a freshly generated file passes; the content edit that made every other row green makes--checkred while--check-pinsstays green; a missing fork is 77 and not 0; a moved fork is 1.docs/registry.md, beside the sentence that describesregistry_pins, and the--checkline in the Commands block.On this branch:
--checkrc 0 with the fork at the pin, rc 77 without it.Mutants, so the arms are shown to fire (each reverted after the run):
old != text->False)Not covered here
--check, not the real fork's content; the real content is what the row asserts on every PR.registry/checked.json(written byregistry_check.pyon Strix Halo, i.e. which models were actually run and checked) is a different axis and remains unguarded by any PR job — out of scope for this issue, said plainly rather than silently.The exit-code change, checked against every caller
--check(and plain generation) now returns 77 instead of 1 where the fork is not checked out. Callers, audited:scripts/registry-regen.shset -euo pipefail.github/workflows/census.ymlset -euo pipefailin the stepgit submodule update --init --depth 1 third_party/llama.cppitselfregistry_content(new)SKIP_RETURN_CODE 77registry_gaps/registry_pins--check-gaps/--check-pinsbuild(), unaffectedtests/registry_{gaps,pin_index,pin_staged}_test.pyNo caller treats 77 as success: both scripts abort on any non-zero, and the one row that does interpret it is the one that must.