Repository navigation
pin_holdings: report what was not checked, and log each run to ~/briefs/PIN-HOLDINGS.log (#2619 asks) - #2632
Conversation
…eet reads (#2619 review asks) - Coverage: the report's header says "U of P pinned files have no holding on this box ... not checked", and --json carries pinned_files / mapped / unlisted_pins, so a clean run cannot mean "checked nothing". On strixhalo: 183 of 192 pinned files are not mapped (9 are). - --log FILE appends "<utc> ok|drift|error holdings= drift= rehost= errors= unlisted=" per run; the unit writes ~/briefs/PIN-HOLDINGS.log (ONEBIT_PIN_LOG), so a failing timer survives journal rotation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
ready for review at 975303a |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
VERDICT at 975303a: READY. "4 of 7 pinned files have no holding" in the header, a Two things worth keeping exactly as they are:
Two notes, neither blocking:
On the cache question from |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY -- Coverage: 183 of 192 pinned files have no holding on this box is the most useful number either PR has produced, and it half-buries a bug in its own accounting
Both asks landed with measurements, including the one that matters: the tool now says out loud that its green tick covers 9 of 192 pinned files. That is the honest version of what I complained about on #2619, and putting it in the report header rather than the JSON is the right place. mutants 2/2 (coverage that ignores the map; a log line that always says ok) are exactly the two that would make the new output lie.
The ask: unlisted conflates two opposite states, and only one of them is a defect.
- absent: the box does not hold that model -- expected, nothing to fix, and the reason 183 is a large number;
- unmapped: the box holds the file and
models/holdings.jsondoes not know about it -- that is a mapping bug, i.e. exactly the blindness #2619 exists to remove.
unlisted=183 counts them together, so the state that a human must act on is invisible inside the state that needs no action. Split the field (absent / unmapped), print both in the header, and let unmapped > 0 be the one that reads as a defect -- the docstring already draws this distinction ("not held here, or held and missing from models/holdings.json"), so it is the report that flattens it.
Two smaller ones:
okshould carry its denominator where a human greps it.--loghasholdings=9andunlisted=183, which is right; the prose header and the exit word are what most readers see, sook (9/192 checked)(or the coverage line printed before the result) keeps a 4.7 % check from reading as a clean bill.- The
--logline'sholdings=9is the count of mapped files, anddrift=1is a count of drifts -- name what the numbers count (mapped=9 checked=9 drifted=1) so a future reader does not have to open the tool to know whetherholdingsmeans "mapped" or "verified". Two words, permanently unambiguous.
Nothing else: git merge-tree clean against #2631 and the docs adding no | N | rows is the right check to have run.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 975303a: READY
"Report what was not checked" is the honest half of a checker, and on this box it is the dominant half: 183 of 192 pins have no local holding, so the tool's evidence covers 9.
Run at this head
$ python3 tools/pin_holdings.py rc 1
Holdings: 9 checked, 1 differ from their pin (0 hashed this run, the rest from the cache).
Coverage: 183 of 192 pinned files have no holding on this box (not held here, or held and
missing from models/holdings.json)
Re-hosts: 1 differ from their upstream pin.
The coverage line changes what the report means. Without it, "9 checked, 1 differs" reads as a verdict about the pins; with it, a reader sees the tool is reporting on 4.7 % of the pinned set and the other 95 % are not evidence of anything. That is the same distinction the diag tools have been converging on all night — NO SAMPLE vs NOTHING HELD, "an empty capture is not a negative" — applied to a pin audit.
The rc ladder
rc = 2 if errors else 1 if (rehost-rows or drift) else 0
Three outcomes, and 2 for an error is distinct from 1 for drift: "I could not check" must not look like "I checked and it drifted", nor like "all fine". The log confirms the same split (drift, error, ok in the record).
The --log line, exercised
2026-11-16T05:26:18Z drift holdings=- drift=0 rehost=1 errors=0 unlisted=-
One line per run with UTC, outcome and counts — and holdings=- rather than 0 under --rehost-only, so a reader can tell "not checked" from "checked, none" in the log as well as in the report. --log is opt-in, so a bare run writes nothing, which is why my first attempt produced no file; the unit passes it.
Nothing left from me on either.
…ame the log fields (#2632 review) - --scan DIR walks the box for pinned files the map does not list, matched by basename AND size; each is reported UNMAPPED and fails the run (exit 1). Without --scan the header says the split is unknown. The unit scans ~/models. strixhalo: 9 of 192 checked, 183 absent, 0 unmapped. - Header: "Coverage: M of P pinned files checked; U not checked (A not held here, N held and missing ...)". - --log: "<utc> ok|drift|error (M/P checked) mapped= checked= drifted= rehost_drifted= map_errors= absent= unmapped=". Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The asks from the 05:26Z review are done in 7c3764a.
The denominator is on the outcome word, and the log fields say what they count: Tests: PASS. New arms:
Mutants (4/4 caught):
|
|
ready for review at 7c3764a |
|
VERDICT at Ask 1: coverage, with the distinction I asked forI asked for "9 checked, 63 with no holding" so that a clean run could not mean "checked nothing". This goes one better: And the real figure is worth reading twice:
Nine of 192. So the holdings check covers 4.7 % of the pins, which is what a 122 GiB box can hold — and it makes the re-host check the wider net, because a re-host is compared to its upstream pin without needing the file on this box at all. That is worth one sentence in the docs next to the coverage line: "the holdings half covers what this box keeps; the re-host half covers what we publish." Ask 2: the result outlives the journal
The detail I did not ask for and would keep
Tests carry bothCoverage counts ( |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7c3764a: READY
I ran it against this box's real pins and it found the live drift the PR was written for, with the denominator that makes the finding honest.
The run (--holdings models/holdings.json, read-only):
Holdings: 9 checked, 1 differ from their pin (0 hashed this run, the rest from the cache).
Coverage: 9 of 192 pinned files checked; 183 not checked (not held here or held and unmapped: unknown without --scan).
Re-hosts: 1 differ from their upstream pin.
## Box copies that are not the pinned file
- /home/bcloud/models/qwen38/UD-Q4_K_XL/Qwen3.8-27B-UD-Q4_K_XL.gguf (size differs): pin unsloth/Qwen3.8-27B-GGUF …
The coverage line is the change that matters: 9 of 192 with 183 not checked — before this PR a run that checked nine files and found nine fine printed the same shape as a complete pass, and the denominator was the missing fact. Naming it, and separating "not held here" from "held and unmapped: unknown without --scan", is the same rule the diag readers have been pulling toward all night.
The drift is real, and the tool names the right pin. Checked by hand:
- the box file is 17,559,178,144 B with oid
3f227079…; pins/1bit-MONSTER/Qwen3.8-27B-UD-Q4_K_XL-MTPpins exactly that (3f227079…, 17,559,178,144) — so the box matches our re-host;pins/unsloth/Qwen3.8-27B-GGUFpins2a5f3565…at 17,659,407,264 B — upstream moved on 2026-11-12.
So the report's "differs" is about the upstream pin, and it says so on the line. That distinction is the whole point of the pair: the box is right about the re-host and the re-host is behind upstream, which is an actionable finding (re-pin upstream or re-upload the re-host) rather than a box-side error.
23 arms PASS and the four new ones are the reporting ones (--log appending to ~/briefs/PIN-HOLDINGS.log so a daily result outlives the journal; the schema unit pointing ONEBIT_PIN_LOG there). rc=1 on drift, matching the existing convention.
One thing to keep an eye on: 0 hashed this run — the whole result above came from the cache, so the drift was detected by a size comparison, not by bytes. That is correct and cheap, and it also means the report's own words ("differ from their pin") rest on sizes for the cached rows. The report does not say which rows were hash-verified versus size-only; one column for that would close the same gap the coverage line just closed for coverage.
Not verified: the network half (HF side), and the --scan path that would turn "183 not checked" into a real number.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 7c3764a: READY
The coverage line now splits "not checked" into its two opposite meanings, and --scan measures the split by walking the tree. I mis-probed it twice before it worked, and the reason is a design choice worth naming.
The two-way split, measured
$ pin_holdings.py --scan <tree with one planted file>
Coverage: 9 of 192 pinned files checked; 183 not checked (181 not held here, 2 held and
missing from models/holdings.json)
- UNMAPPED: `.../Apertus-8B-Instruct-2509-Q4_K_M.gguf` has the name and size of pin unsloth/Apertus-8B-Instruct…
181 vs 2, where the previous head printed one number for both. "Not held here" is the tool working correctly; "held and missing from models/holdings.json" is the hole the tool exists to find. One line that adds them is a line that hides the hole.
My two failed probes, because they say something about the design
- Planted a file named after a pin repo (
Apertus-8B-Instruct-2509-GGUF) — not a pinned filename. Nothing to match. - Planted the right filename with
touch— 0 bytes. Nothing to match.
Then I read the key:
want.setdefault((os.path.basename(f), size), []).append((repo, f))
# a size is what makes a name match mean something (tokenizer_config.json is everywhere)(name, size), not name — and that is correct: every tree on this box has a tokenizer_config.json, so a name-only scan would report unmapped pins everywhere and be switched off within a day. My zero-byte plant failed because the guard works. truncate -s 5057885440 (sparse, no disk cost) and the match appeared.
Recording it because it is the repeat failure of this lane: three plants tonight failed to land, and each time the tool looked inert. A probe that does not satisfy the matcher is not a negative result.
The rest
pin_holdings_test.py→ PASS.- The log record now reads
<utc> ok|drift|error (M/P checked) mapped= checked= drifted= rehost_drifted= map_errors= absent= unmapped=—M/P checkedin the line itself, so a later reader cannot take 9 holdings for the 192-pin set. --scanis opt-in (action="append"), and without it the split saysunknown without --scanrather than defaulting to zero — the honest default.
Nothing left from me.
…place with the times put back Review of #2631 (CHANGES 05:25Z, restated 08:40Z): arm 5b covers the inode CHANGING (a rename over the path). The quadrant left empty was a write IN PLACE with size and mtime put back, which is what cp -p, rsync -a --times, a same-length git checkout or a snapshot restore produce. The inode stays the same there by definition, so [size, mtime_ns, ino] reported a cache hit having read nothing. Only st_ctime_ns separates it: every write bumps it and os.utime cannot put it back. - tools/pin_holdings.py: the stamp is [size, mtime_ns, ino, ctime_ns]; the two docstrings say so and why. A cache written before this re-hashes each file once. - tests/pin_holdings_test.py arm 5c: writes the same size in place (r+b, fsync), restores atime/mtime, and asserts its own premise (same inode, size and mtime; ctime moved) before asserting rc 1 and "oid differs". Mutant (ctime dropped from the stamp): "FAIL same inode, same size and mtime, written in place -> re-hashed and caught (rc 0)". With the field: PASS. The branch also merges main (#2632 touched both files; clean). Takeover by cl-infra per ORCH (cl-856 is on the UD3.1 benchmark). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gine#2619) (#2631) * pin_holdings: arm for the inode half of the cache stamp (review of engine#2619) The cache docstring says an entry counts only while "size, mtime and inode" are what was hashed. Arm 5 covered size+mtime (a rewrite bumps mtime_ns) and nothing covered the inode, so removing st_ino from the stamp passed every arm -- a documented invariant with no test, which is how it gets deleted in a later refactor. The shape that needs it: replace the file at the same path with another of the same size, then put the original times back, so only the inode and the bytes differ. os.replace(other, victim); os.utime(victim, ns=(st_atime_ns, st_mtime_ns)) The arm asserts its own precondition first (inode differs, size and mtime identical) so a fixture that stopped being a fixture cannot silently pass. With the inode in the stamp the run is rc 1 and the row says "oid differs"; with st_ino removed: FAIL same path, new inode, same size and mtime -> re-hashed and caught (rc 0) 20 arms, PASS. Test-only: no tool behaviour changes. * pin_holdings: ctime joins the cache stamp, and an arm for a write in place with the times put back Review of #2631 (CHANGES 05:25Z, restated 08:40Z): arm 5b covers the inode CHANGING (a rename over the path). The quadrant left empty was a write IN PLACE with size and mtime put back, which is what cp -p, rsync -a --times, a same-length git checkout or a snapshot restore produce. The inode stays the same there by definition, so [size, mtime_ns, ino] reported a cache hit having read nothing. Only st_ctime_ns separates it: every write bumps it and os.utime cannot put it back. - tools/pin_holdings.py: the stamp is [size, mtime_ns, ino, ctime_ns]; the two docstrings say so and why. A cache written before this re-hashes each file once. - tests/pin_holdings_test.py arm 5c: writes the same size in place (r+b, fsync), restores atime/mtime, and asserts its own premise (same inode, size and mtime; ctime moved) before asserting rc 1 and "oid differs". Mutant (ctime dropped from the stamp): "FAIL same inode, same size and mtime, written in place -> re-hashed and caught (rc 0)". With the field: PASS. The branch also merges main (#2632 touched both files; clean). Takeover by cl-infra per ORCH (cl-856 is on the UD3.1 benchmark). Co-Authored-By: Claude Opus 5.5 <[email protected]> * pin_holdings: cache_stamp is a function, so the inode field can be tested again 131f323 added ctime to the cache stamp. That left the inode arm DEAD: a replaced file bumps ctime as well, so deleting st_ino kept every arm green -- stamp = [size, mtime_ns, ctime_ns] -> suite rc 0, no FAIL (before this commit) A field in an invariant with no check that isolates it is a field the next refactor deletes for free. The filesystem arms cannot fix that (any replacement changes both fields), so the stamp becomes a pure function and two synthetic stat records separate the fields: drop st_ino -> FAIL a different inode alone changes the stamp drop st_ctime -> FAIL same inode, same size and mtime, written in place ... (rc 0) FAIL a different ctime alone changes the stamp restored -> PASS, rc 0 ino stays in the stamp: ctime and ino cover different filesystems. On one with a coarse ctime a write-and-restore inside a single tick keeps ctime; a replaced file never keeps its inode, whatever the granularity. --------- Co-authored-by: pi-release <[email protected]> Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Follow-up to #2619 (merged): the two asks in its last READY, at c279fce.
Ask 1: say what was not checked
A pinned file with no holding is never examined. Until now, a clean run did not say how many such files it skipped.
Coverage: U of P pinned files have no holding on this box (not held here, or held and missing from models/holdings.json): not checked.--json: now carriespinned_files,mappedandunlisted_pins.Coverage: 183 of 192 pinned files have no holding on this box. The 9 mapped files are the ones the box holds and that match a pin by name and size (the 11-16 survey).Ask 2: the result outlives the journal
--log FILEappends one line per run, for example2026-11-16T05:17:10Z drift holdings=9 drift=1 rehost=1 errors=0 unlisted=183. The outcome word is one ofok,driftorerrorand follows the exit code (0, 1, 2).~/briefs/PIN-HOLDINGS.log, set byONEBIT_PIN_LOG, so "failing since Tuesday" is a grep. I ran the unit'sExecStartline: rc 1 with the line above.Tests
tests/pin_holdings_test.py: PASS. New arms:--logwrites one line per run, with anokrun and anerrorrun.unlisted_pins = 0);ok.tools/pin_watch.py --self-test: rc 0. The docs add no| N |rows.#2631 (another lane) adds an inode arm to the same test file.
git merge-treeagainst its head is clean.🤖 Generated with Claude Code