Repository navigation
hrx_f16_narrowing: --write refuses to record a guard LOSS without an explicit flag - #2342
Conversation
…explicit flag (#2244) The guard set is asserted by --check now, but --write is the command a PIN BUMP runs, and a bump resolution that took the other side of a .loom conflict would record a smaller guard set as the new baseline -- 34 body changes in one diff, the five lost guards invisible in the noise, and from then on --check passes forever. Recording a loss has to be an act, not a side effect. So write() compares the guard set it is about to record against the one on disk and refuses when it would drop any, naming each. --allow-guard-loss exists for the case where a guard genuinely moved. Verified against the corpus that motivated it: --write on llama.cpp#327's draft (rc 1) names mul_mat_id_{q4k,q5k,q6k}_f16_wmma_projection, mul_mat_id_swiglu_f16_f16_accumulate and mul_mat_id_swiglu_f16_f16_wmma_body; with --allow-guard-loss it proceeds and records 85 bodies / 21 accumulators / 5 guards. Self-test 37 arms, three of them the refuse/allow/recorded-it sequence.
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 4dd6bea: READY
This is the distinction between a ratchet and a rubber stamp, and it is one condition.
guard_loss = sorted(old_guards - set(guards))
if guard_loss and not allow_guard_loss:
for rel in guard_loss:
print(f"REFUSING to write: {rel} would lose its guard marker from the baseline")--write is the operation that turns a ratchet into paperwork: it records whatever the tree currently says, so any regression becomes the new baseline in one command. Refusing on a loss is what keeps the baseline a claim rather than a transcript, and three details make the refusal usable:
- it names each lost path, not a count — so the person running it knows exactly what they are about to accept;
- it names both remedies and asks for a reason: "if the merge really did revert them, fix the merge; if the guard genuinely moved, re-run with
--allow-guard-lossand say why in the commit" — the escape hatch exists, is spelled out, and is named for what it permits; - the flag is
--allow-guard-loss, not--force, so the command line records the decision in a form a later reader can interpret.
And it pairs with #2340 exactly: #2340 makes which bodies carry a guard part of the baseline, and this makes a loss of that membership something a human has to state out loud. Without this, #2340's baseline would be one --write away from silently accepting the very regression it was built to catch — the failure #2340's own body measured on #327's draft.
Worth noting as the third refusal-shaped fix in this file's neighbourhood tonight (§#2331's merge base, #2323's reachability, this): in each case the fix was not to compute a better number but to make the tool decline when the answer is not what it looks like.
#2340 made
--checkassert the guard set. This closes the other half:--writecould launder the very regression the check catches.--writeis what a pin bump runs, and a bump whose.loomconflicts were resolved taking the other side records a smaller guard set as the new baseline. In that diff there are 34 body changes, so five lost guards disappear in the noise — and from then on--checkpasses, permanently.The property this buys: a guard can leave the baseline only by an argument someone typed, on the record, in a commit message — not as a side effect of the command every bump already runs.
Verified:
--checkat main's pin still passes (51 / 11 / 10, rc 0);tools/copyright.py --checkclean; self-test 37 arms, three of them the refuse / allow / "and the baseline now records none" sequence.Scope, unchanged from #2340: this guards the presence of a marker, not its correctness. A wrong prescale still needs a known-answer row.