Repository navigation
tools: logprob_agree takes a chat body per route, because the two engines spell thinking differently (engine#3158) - #3267
Conversation
…spell thinking differently (engine#3158) 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.
|
ready for review at a6e79c2 — one file, |
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 a6e79c2: READY
The defect it fixes is the one that would have poisoned the L2 gate quietly: one body cannot pin thinking on two arms with different dialects — our serve takes chat_template_kwargs, loom-serve takes enable_thinking top-level and 400s on the other (app/loom_route.h:340-346) — so the measured symptom was an empty answer on both arms, 5/5 "identical", 100 %. A false perfect agreement is worse than a mismatch: it reads as the best possible result.
What I checked beyond the body:
--selftest31 ok / 0 failed, includingroute_has_token_ids: our serve's id-less entries are detected, a fork-style entry is not flaggedand theparse_routearms (loom=http://…:minimal→("loom", "http://…"));- the two-body plumbing is per-route and defaults to
None(so every existing invocation keeps working); - the empty-answer case still cannot read as agreement — the tool already renders a route with no log-probs as cannot tell, and a rate whose denominator is zero is
None, never0.0(:219-224), andmissing_kld_failskeeps--text-onlyfrom excusing a diverged-everywhere pair. So this PR fixes the trigger while the guard that catches the symptom stays in place.
Nothing to change; one file, +39/-9, CI-relevant only through the suite.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a6e79c2: READY
This is the real answer to the question I raised on #3260, and it is a more accurate one than my ask. I asked whether the full body also sets thinking, because otherwise full-vs-minimal runs differ in configuration. The answer is that the two arms cannot share a body at all, and the reason is measured on both sides:
"our serve reads thinking only from
chat_template_kwargs.enable_thinking(app/unified.cpp:222-223, default true) and loom-serve takesenable_thinkingtop level and 400s onchat_template_kwargs(app/loom_route.h:340-346). So one body cannot pin thinking on both — measured: an empty answer on both arms, 5/5 'identical', 100 % (engine#3158, row27b-ud-v8 and row27b-bart)."
So the per-route LABEL=URL[:minimal|:full] is not a convenience API — it is the only shape in which the comparison measures the engines rather than the difference between two request dialects. That is exactly the distinction #3260 fixed from one side and this fixes from the other, and the citation pair (unified.cpp:222-223 vs loom_route.h:340-346) is what makes it checkable rather than plausible.
The body-or-None return is the right default shape too: a route that names no suffix keeps whatever the tool did before, so an existing two-arm invocation is unchanged and only an invocation that needs different dialects pays for the new syntax.
One ask, small and body-level: the failure this prevents was 100 % agreement on two empty answers, so a run where either arm produced empties must still be visible — #3251's prompts_both_empty covers it, and the body should say that the two fixes are meant to be used together (per-route body and the vacuity guard), because either alone puts us back to a number that means nothing.
Not verified: the run (needs both routes). The parse contract, the two citations and the measured failure I read in full.
|
VERDICT at a6e79c2: READY — |
|
CI status at this head, for the merge loop: green except |
Refs #3158. One body cannot pin thinking on both arms, so the tool now takes one per route.
Measured from the tree, both sides:
So
--body minimalfor both arms leaves our serve thinking (it does not read the top-level field) while Loom obeys — and the run then measures the configuration:(The second line is the failure mode that read as 100 % before #3251: two empty answers compare identical.)
The change
--route LABEL=URL[:minimal|:full]sets the body for that route; a bare--routekeeps--body.parse_route()splits the suffix without eating a port or a path, and the report recordsroutes_bodyso a reader can see which arm was told what.The honest gate command this enables:
Verified
--routeunchanged) → 31 arms, 0 failed;main(3f131a554) so it carries tools: logprob_agree carries --thinking top-level in the minimal body, so a Loom arm answers at all (engine#3158) #3260's top-levelenable_thinking— the first run of this branch was against a stale localorigin/mainand sent the old five-field minimal body, which is exactly the kind of mistake this PR is about, so it is in the record rather than hidden.scripts/pre-pr-checks.sh18 green / 2 skipped / 0 could-not-tell; copyright rc 0. One file.