Repository navigation
[PR] fix: guard the #5974 probe baseline write against overflow-arm demotion (#6865) - #6867
ranxianglei wants to merge 2 commits into
Conversation
…on (#6865) The #5974 corrective-pass probe (preflightCompressIfNeeded) measured the fresh rebuild and wrote a local estimate onto the session baseline without an overflow-arm guard. In the caliber-delta case (post-fold local probe slightly above the armed wall, but the payload actually fits) the probe demoted the ACTIVE overflow-arm evidence tag to "estimate" before the post-rebuild anchor write ran — silently dropping the evidence floor that keeps an armed session folding instead of trusting optimistic estimates. The next turn then fit-forwarded on a stale estimate until the upstream 400 re-armed it: the exact fold → forward → 400 livelock #5880 fixed, re-opened on the probe path. Extract the probe's baseline write into applyProbeBaselineAnchor (session.ts) with the same overflow-arm guard as armFailureShrink (relay.ts #2484). Unarmed and usage-grade behavior is unchanged (#1987 anchor, #604 usage→estimate). Regression test pins both directions (armed survives, unarmed anchors). Fixes #6865
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10255-pr.6867.4c3c1bbThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6867.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — 本 PR 与 PR #5899 同属 #5880 机制族(无守卫的本地 estimate 写入可把活跃的 Live state verified: PR head Code review(独立审 diff,非复读 issue):
结构化八问(供 reviewer):
判定: 可合 — 单模块纯 fix、双向回归测试、rebased head 上 CI 全绿、行为变更披露完整。合并顺序注意:#5899 与本 PR 谁后合谁做一次平凡 rebase。 |
What
The #5974 corrective-pass probe (
preflightCompressIfNeeded,src/server.ts) measured the fresh rebuild and wrote a local estimate onto the session baseline without an overflow-arm guard:In the caliber-delta case (post-fold local probe slightly above the armed wall, but the payload actually fits) the probe demotes the ACTIVE
overflow-armevidence tag toestimatebefore the post-rebuild anchor write runs. That silently drops the evidence floor that keeps an armed session folding instead of trusting optimistic local estimates (which undercount ~19-20% on code-heavy content). The next turn then fit-forwards on a stale estimate until the upstream400 CONTEXT_WINDOW_EXCEEDEDre-arms it — the exact fold → forward → 400 livelock #5880 fixed, re-opened on the probe path.Fix
Extract the probe's baseline write into
applyProbeBaselineAnchor(src/session.ts) with the same overflow-arm guard asarmFailureShrink(src/server/relay.ts#2484):The probe call site now invokes the guarded function. Unarmed and usage-grade behavior is unchanged (#1987 anchor, #604 usage→estimate).
Relationship to PR #5899
This is master's code (from the #5974 fix, now closed), a separate concern from PR #5899. PR #5899 guards the post-rebuild anchor path (
applyPostRebuildBaselineAnchor); this PR guards the probe path (applyProbeBaselineAnchor). Both close the same #5880-class gap (an unguarded estimate write demoting an active overflow-arm) on different code paths. This PR is independent and can land on its own.Behavior change (flagged)
Old: the #5974 probe could demote an active
overflow-armtag toestimatein the caliber-delta case, disarming the evidence floor and re-opening the #5880 livelock.New: the probe never demotes an active
overflow-armtag — an armed session keeps folding on the upstream-proven value.Why: the
overflow-armtag is the evidence floor; demoting it is what produces the livelock. Same doctrine as the #5880 fix andarmFailureShrink.Tests
tests/issue6865-probe-arm-guard.test.ts(new) pins both directions (#3617 gate discipline):Verified the test has teeth: with the guard stripped, the armed case fails.
Verification
npm run typecheckclean (0 errors).tests/issue6865-probe-arm-guard.test.ts4/4 pass.tests/issue5974-preflight-view-divergence.test.ts5/5 pass (probe path unregressed).Fixes #6865