Repository navigation
logprob_agree: a reply cut by max_tokens at an agreeing prefix is truncated, not a counted split (#3158) - #3430
Conversation
…ncated, not a counted split (#3158) ask() records finish_reason. near_tie_score() reports a prompt as truncated when one text is a prefix of the other and the shorter run stopped on its budget (finish "length"): before, a cut reference gave no readable gap (counted) and a cut route was judged at a token it never chose. Two self-test cases; docs/loom-route.md names the kind. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…ts cut inside the thinking (#3158) (#3434) A reply cut by max_tokens inside its reasoning ends in REASONING_SEP, so its text is no longer a prefix of the longer reply and #3430's test counted it. The prefix test now runs on the texts without the separator. One self-test case. Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Follow-up to #3423 / #3429. These merged without the truncation case raised in the cl-inkling review on each; cl-npuconc's points are separate and untouched here.
Defect:
near_tie_score()couldn't tell a reply that stopped from one cut by its token budget.ask()did not recordfinish_reason.max_tokens.split_marginfinds no route token among its candidates, and the prompt was counted.think_openprefill, make the cut land at different places.Change (
tools/logprob_agree.py, plus one sentence indocs/loom-route.md):ask()records"finish": ch.get("finish_reason").near_tie_score(): when one text is a prefix of the other and the shorter run'sfinish == "length", the prompt istruncated."cut": "route" | "reference".finish: "stop") is still judged at the CPU's token, so an early end of turn is not excused. So is every non-prefix split.near-tie ruleline printstruncated Nand marks those promptscut(route|reference).Checks:
--selftest: 42 ok. Two new cases:bash scripts/pre-pr-checks.sh --base origin/main: 18 green, 2 skipped (gpu-kernels audits, no checkout).finishfield, so they score exactly as before. Nothing re-scored changes.🤖 Generated with Claude Code