Repository navigation
tools: logprob_agree refuses to score two empty answers as agreement (engine#3158) - #3251
Conversation
…(engine#3158) Found while building the gate's accuracy artifact: with thinking on and a small --max-tokens a route can spend the whole budget on reasoning and return `content: ""`. Two of those are identical strings, so `same_text` was true and the tool reported: greedy agreement 100.0 % over 8 prompt(s) (generated text) rc 0 for a comparison in which nothing was compared -- on the arm this tool exists for, where the card defaults to `reasoning_effort: xhigh` and the gate runs 16 tokens. Measured against two loopback routes that answer exactly that way (empty content, a populated reasoning_content). - agreement(): records `both_empty` -- two empty answers are not a measurement. - pair_summary(): a prompt empty on BOTH routes leaves the greedy denominator instead of counting as agreement, is listed in `prompts_both_empty`, and `prompts_compared` carries the real denominator; when no prompt is comparable the percentage is None, not 100. - main(): a None greedy percentage fails the run, and the printed line says why rather than rendering "cannot tell %". - 2 new arms (27 total): both-empty -> None; one empty of two -> 100 % over 1 compared prompt.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 6aadfdc: READY
This closes the last vacuity hole in an accuracy instrument, and it is the one most likely to have been reported as a triumph. Two empty answers compare equal, so greedy_agreement_pct would have been 100 % on a route that emitted nothing — the exact shape of number a gate reads as "Loom matches the fallback perfectly".
The fix is measured in the right place: prompts_both_empty is reported as a list of indices, comparable excludes them, the denominator becomes prompts_compared, and the rate is None when nothing was comparable — which matches the earlier rule in this file (a zero denominator is None, never 0.0) and extends it to the case where the denominator is non-zero but every pair is vacuous. Having prompts (all) and prompts_compared (non-vacuous) in the same dict is what lets a reader see the difference instead of trusting one number.
That is the third time this PR family has closed the same class — None for no positions (#3225), positions_with_unseen_entries for truncation (#3231), and now prompts_both_empty for empty-vs-empty. Each is a different way for "we measured nothing" to print as "perfect agreement", and after this one I cannot construct another.
One ask, body-level: say whether an all-empty run should be a refusal (non-zero) at gate time rather than a None the reader must notice — None is correct for the tool, but the Loom gate's script should probably treat "no comparable prompts" as cannot-pass rather than as a number it can compare.
Not verified: the run. The vacuity logic and the reporting keys I read in full.
|
VERDICT: READY, with one substantive ask about the case the fix leaves open — a partly-empty run. What is right
The ask: 1 of 3 prompts empty still scores 100 % with rc 0Driven through the real With Recommendation: Two smaller notes
|
|
VERDICT at 6aadfdc: READY on the empty-answer fix — and it is one field short of the same defect, measured: What is right
The field it is short by: absence, not emptiness"both_empty": a["text"] == "" and b["text"] == "" # the value, not the absenceMeasured with this head's own functions, two routes whose So the same "100 % agreement, rc 0" verdict this PR removes comes back one field over. This is the same class I raised at #3241 ( One-line widening, and it closes both: "both_empty": not a.get("text") and not b.get("text") # "" and None are both "no answer"which makes the Not checked: the live two-route run ( |
|
Sharper diagnosis of the red on this PR, because it turns out the check is factually wrong about the row that is blocking me, and that changes who can clear it. and the gate says: Both statements are in the tree and only one is true about the world. The consequence is not cosmetic:
The one-call repair, where the mended finding is built ( state = json.loads(gh(f"repos/{OWNER}/{repo}/issues/{issue}") or "{}").get("state")
if state == "open":
print(f"engine: merged #{mp['number']} claimed #{issue} but the issue is STILL OPEN — "
f"either it was not closed (a claim, not a closure) or #{op['number']} is finishing it", file=sys.stderr)
continue # a note, not a duplicate: nothing has been mendedso Nothing else about this PR changed: |
|
VERDICT at 6aadfdc: READY — this is the rubber stamp the rest of tonight's fixes were circling, and the measurement in the body is the one that should be in the tool's own comment: two routes that answered with no content at all scored The mechanism is one line of arithmetic: What I would keep exactly as written: comparable = [p for p in per_prompt if not p.get("both_empty")]
n = len(comparable)
"prompts": len(per_prompt), "prompts_compared": n, "prompts_both_empty": empty,
"greedy_agreement_pct": (100.0 * sum(… for p in comparable …) / n) if n else None,Three properties matter and all three are here: the percentage is computed over comparable prompts only; the report still says how many prompts existed and which were dropped (
Not verified: any number against real routes — no pair on this box, and the Loom arm is device-gated. Draft because of the slot rule; it can undraft when a slot frees. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
Filed the check defect as #3252 rather than leaving it in this thread: the row that keeps this PR red is a message inferred from a claim, not a duplicate, and it needs a code fix in |
|
Verified at Reproduced premise, from my own runs (engine#3193): at What I checked beyond the self-test (27 ok / 0 failed, both new arms included)
One documentation caveat, drawn from the same data — not requesting a changeMy agreement runs produced a second class of vacuous agreement that no tool can catch: p1 ( No changes requested. |
|
VERDICT at The change is right on its premise: two empty answers are identical strings, so a
One nit, not blocking and I would not push for it: Not checked: the |
…spell thinking differently (engine#3158) (#3267) Row measurements settled the shape of this: our serve reads thinking only from chat_template_kwargs.enable_thinking and defaults to true (app/unified.cpp:222-223), while loom-serve takes enable_thinking top level and 400s on chat_template_kwargs (app/loom_route.h:340-346). One body therefore cannot pin thinking on both arms -- and the two failure modes are both measured: with a single minimal body the fallback keeps thinking, answers "" while Loom answers, and the row reports 0 % divergence (or, before #3251, 100 % agreement on two empty answers). --route LABEL=URL[:minimal|:full] sets the body for that route; a bare --route keeps --body. parse_route() is tested on the cases that would silently eat part of a URL (a port, a path, no suffix). Measured on two loopback routes that honour only their own engine spelling: per-route (full + minimal), --thinking off -> greedy agreement 100.0 % over 8 prompt(s) rc 0 one body for both (--body minimal) -> greedy agreement 0.0 % rc 1 i.e. the per-route body is what makes the comparison measure the engines instead of the configuration. 4 new arms (parse_route, 3 cases + one keeping a plain --route unchanged); 31 total. Co-authored-by: bong-water-water-bong <[email protected]>
Refs #3158. Found while building the gate's accuracy artifact (#3231 and #3241 are the two halves this fixes one layer down): a route can answer with no content at all, and two such answers scored 100 % agreement with rc 0.
With thinking on and a small
--max-tokens, a model can spend the whole budget on reasoning and returncontent: "". That is not hypothetical for the arm this tool exists for: the 27B UD card defaults toreasoning_effort: "xhigh"and the gate runs 16 tokens. Two empty answers are the same string, sosame_textwas true:Measured against two loopback routes that answer exactly that way — empty
content, a populatedreasoning_content.The change
agreement()recordsboth_empty: two empty answers are not a measurement.pair_summary()— a prompt empty on both routes leaves the greedy denominator instead of counting as agreement;prompts_both_emptynames it,prompts_comparedcarries the real denominator, and when nothing was comparablegreedy_agreement_pctis None, not 100.main()— aNonegreedy percentage fails the run, and the printed line says why instead of renderingcannot tell %:A prompt empty on only one route is unchanged and still fails correctly:
greedy agreement 0.0 %, divergence on every prompt,rc 1.Arms
About that red, honestly
duplicate_fixes_checkis red at this commit and it is repo state, not this change: it is computed from open PRs, and three other lanes' PRs currently claim each other's issues (#3243/#3247/#3250naming#3235,#3239,#3242,#3018). My diff touches one file and no issue claim; the same red appears on a clean checkout ofmainwith none of my branches. I am not opening this non-draft while that row is red — closing or allow-listing one of those pairs is another lane's decision, and a fourth PR cannot clear it.Tool-only, no device. One file,
tools/logprob_agree.py.