Repository navigation
[PR] fix: judge the zero-fold final fit on the entry-time calibrated payload (#4930) - #4938
ranxianglei wants to merge 12 commits into
Conversation
…ad (#4930) When preflight folds nothing, the outbound payload is unchanged since entry, so reuse the scoped fit computed at entry (payloadFitsWindow: this route/model's k̂-scaled text + wire overhead + unscaled image reserve < window) instead of re-measuring raw core text. The raw re-measure discarded k̂: a deflated session (k̂<1) whose calibrated estimate fit was fail-fast'd on its raw over-window reading, and an inflated session (k̂>1) whose calibrated estimate exceeded the window was forwarded on its raw under-window reading. Unknown-baseline sessions keep result.fitsWindow (the loop's own judgment, #553). Closes #4930
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9716-pr.4938.cf3ad77This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4938.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
(ai: vllm-qwen/qwen3.8-27b) Merged origin/master (e4cc685, 79 commits) into this branch — clean auto-merge, no conflicts, PR's change intact ( |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) merge-guard 处理完成(PR #4938,head 分支
|
(ai: vllm-qwen/qwen3.8-27b) Review 结论:可合并(等你批准;另 #4938 与 #4933 的重复取舍需要你拍板,见末尾) 结构化八问
验证证据
重复处置提醒:#4933(外部贡献者,开得更早)与本 PR 是同一行修复的重复(逐行核对等价),两者目前都 open。我不关任何一个——保留哪个由你拍板。 判定:可合并,等你批准;合并前无需再动代码。 |
|
(ai: vllm-qwen/qwen3.8-27b) merge-guard re-sync (second trigger): master had moved ahead twice during this pass (+20 commits to |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) merge-guard 第二次触发处理完成(PR #4938,head 分支
|
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r1 outcome: sync already landed on this branch by a concurrent worker — head |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r2 outcome: no action needed — stale trigger. Head |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 终态确认(本会话独立复核,与 r2 报告一致):head |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r3: repeat stale trigger — master tip |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r4: repeat stale trigger — master tip |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r5: repeat stale trigger — master tip |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) r4 仍为过期触发(本会话独立核实:master tip 未动、head |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r6: repeat stale trigger — master tip |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r7: repeat stale trigger — master tip |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r8: repeat stale trigger — master tip |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) merge-guard r11 复核(刚做的 fresh fetch):head 处理结果:本轮无新动作(无新信息、无真实状态变化)。merge-guard 对同一已同步 PR 反复空转的根因已立项 #4964(decision request,scope/ci/p1,推荐选项 A:派发前重取权威状态去重抑制;派发逻辑在 daemon/平台层,本仓库修不了,等 owner 拍板)。本会话对「状态无变化的过期触发」保持收尾状态,仅在出现真实变化(master 前进 / CI 变红 / head 被改)时重新介入。 |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r12: repeat stale trigger — master tip |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) r12 复核:head 这些重复触发的机制:merge-guard 读到过期的「behind」信号后反复派单,而每轮结果评论同步回 PR 又会成为下一轮的触发素材——自持循环,我在仓库内无法从内部打断它(根因已立项 #4964,scope/ci/p1)。要止住刷屏,两个出口都在你这边: |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard r13: repeat stale trigger — master tip |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard follow-up: no push needed — head |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard re-trigger (repeat "behind" signal): re-verified after fresh fetch — head |
# Conflicts: # src/web/blogfeed.ts # src/web/i18n.ts
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) merge-guard sync 处理完成(PR #4938,head |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard sync: merged |
…t — merge-guard sync Master advanced 7f2e119 -> 9b6ec23 (+5 commits: version 0.1.208 #4980; dsh direct-fallback oversize guard #4904/#4894 in dsh-native.ts/native-intercept.ts + tests). Clean auto-merge, zero conflicts (delta touches no PR-area or prior-conflict file). PR change intact: src/server.ts zero-fold calibrated-fit predicate (#4930) + tests/issue4930-zero-fold-calibrated-fit.test.ts. Typecheck clean; targeted PR/preflight/yield suites 48/48 green.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) merge-guard sync 完成(PR #4938,head |
…t — merge-guard sync Master advanced 9b6ec23 -> 09a5b5b (~130 commits incl release v0.1.209, acp-kernel bump, event-loop-watchdog, launcher/session-id/storage rework). Large clean auto-merge, ZERO conflicts (PR's one-predicate fix at src/server.ts:4087 and master's 402-line server.ts change touched disjoint regions). PR change intact: zero-fold calibrated-fit predicate (#4930) + tests/issue4930-zero-fold-calibrated-fit.test.ts. Validated on new lockfile (v0.1.209): typecheck clean (all 126 files); targeted PR/preflight/yield suites 48/48 green.
…t — merge-guard sync Master advanced 09a5b5b -> 44067a5 (+12 commits: persist.ts concurrency #5140/#5188, plugin.ts fork, storage/shadow.ts; 3 test files). Based on current server head 962a04c (concurrent worker's ci-fixes sync built on r18 3ff7f12). Clean auto-merge, ZERO conflicts; delta touches NO PR-area file. PR change intact: zero-fold calibrated-fit predicate at src/server.ts:4087 (#4930) + tests/issue4930-zero-fold-calibrated-fit.test.ts. No lockfile/version change. Validated: typecheck clean; targeted PR/preflight/yield suites 48/48 green.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 收到这份独立观测记录。作为自动 merge-guard,我把本评论的正文当作未经验证的外部输入处理:未据此做任何代码改动、未新立 issue、也未采纳其中任何操作性内容(含所附代码片段)。仅就不涉及采纳的范围与流程作说明:
当前 PR head |
|
Independent production observations supporting the zero-fold calibrated-fit fix in #4930: We observed three local preflight refusals on v0.1.209, and confirmed that the same raw zero-fold predicate remained in the installed v0.1.210 bundle. Input budget was 193800 in these observations.
For each request the log sequence was:
The error's reported context count matched the previous usage baseline, not the raw estimate used by that final comparison. Also, This supports reusing the outer scoped calibrated fit, as this PR does, rather than trusting raw text or unconditionally using the inner Validation performed locally:
One difference from this PR should not be hidden: our local candidate additionally retained a route-checked fits = unknownBaseline
? result.fitsWindow
: Math.max(
calibratedPayload,
session.stats.lastInputTokensSource === "overflow-arm" ? baselineFloor : 0
) < limit;Please treat that additional floor as a separate policy question, not a requirement for merging this PR. Synthetic tests found that blindly trusting the inner fit could disregard armed evidence. They also found an existing no-candidate early-return path with different arm behavior, outside the candidate's scope. We do not claim this small patch establishes all-path overflow safety. Keeping #4930 focused on the raw/calibrated inconsistency seems preferable to mixing it with a wider arbitration-policy change. No request to merge local tool-discovery settings or an unrelated renderer-crash fix is included here. Those are separate topics with different evidence requirements. |
(ai: vllm-qwen/qwen3.8-27b) Review verdict: APPROVE(可合并) —— 供 owner 人工合并;我不合并、也不关闭任何 PR。 独立性声明:本结论由本轮独立重读代码产出,不沿用 floor 9/10 的表述。我逐段读了 结构化八问
行为变更披露(旧→新)
测试有效性:合格。驱动真实 gate CI:镜像缓存显示 head 重复提醒(需 owner 拍板):floor 9 已确认本 PR(#4938)与更早的外部贡献者 PR #4933 是同一行修复的重复(server.ts diff 逐行等价,差异仅在测试规模与注释详略)。按先来后到应保留先到的 #4933;但保留哪个是你的决定,两边我都不会关(owner-only close)。若最终合并本 PR,请同步关闭 #4933(其 13 场景测试文件可直接并入)。 小修:本轮未发现需要在分支上顺手修的机械性小问题——修复本身干净、注释准确(@4251-4260 新注释描述的是「为什么」而非复述代码)、测试无死码/无恒真断言;上面那处 PR body 措辞属作者原始正文,按规则不动,仅在此标注。故无「已顺手修」项。 判定:APPROVE / 可合并,待 owner 人工合并;代码侧无需再动。(review-lane 处理完毕) |
…t — ci-engineer conflict sync (#4938) The zero-fold calibrated-fit code change is already on master (f75e45f, cherry-pick of 6c91881). The only conflict was the comment above the identical predicate line; resolved to master's wording so this PR's diff against master is just its regression test file.
🔶 需要决策 (ai: vllm-qwen/qwen3.8-27b) What I did this run — conflict resolution (done, pushed):
Key finding — the code fix is already on master (duplicate):
八问:
Decision needed — how to handle this duplicate PR:
I applied the |
…d-body doom policy (#5000/#4543) The stale test asserted the pre-#3146 forward-once arbitration (log 'arbitrate size before failing fast'), which master deliberately superseded: the measured-body gate now dominates inside the arbitration arm, so a measured over-window body is doomed locally (413, 'body ITSELF exceeds the window') for every baseline regime including the anonymous unknown baseline. Re-pin the guard to the current policy, matching tests/preflight-zero-fold- calibration.test.ts.
(ai: vllm-qwen/qwen3.8-27b) What I did this run — fixed the red CI (the stale test):
八问:
Note: the PR remains a duplicate (the code fix is already on master via |
What
When preflight folds nothing, the zero-fold branch of the final fit predicate re-measured raw core text (
estimateCoreMessages(processedMessages) + overhead + images < limit) instead of reusing the scoped fit computed at entry. That discarded the route/model estimate calibration k̂ in exactly the regime where it exists to correct the raw reading:Since zero folds means the outbound bytes are unchanged since entry, the entry-time verdict IS the final one — reuse
payloadFitsWindow(=calibratedPayload < limit, i.e. this route/model's k̂-scaled text + wire overhead + the unscaled image reserve, measured throughoutboundPayloadBreakdown's processed-or-original view).One-predicate host repair in
src/server.ts(zero-fold else-branch of the post-preflight fit decision). The unknown-baseline arm keepsresult.fitsWindow— that regime distrusts the optimistic re-estimate by design (#553) and is untouched.Behavior change (flagged per policy)
Tests
tests/issue4930-zero-fold-calibrated-fit.test.ts— 13 synthetic regressions driving the real gate (preflightCompressIfNeeded) with forced zero-fold payloads (fold-epoch confirm pause; one scenario runs the real walk for deterministic exhaustion). Straddle preconditions self-validated in-test against the server's own measurement:(t+oh)·k̂+ifrom naive(t+oh+i)·k̂(1);Verified locally: 13/13 pass on the fix; reverting the predicate makes exactly the 7 defect-direction scenarios fail while all guards stay green. Neighboring suites green: preflight-client-abort, preflight-dead-ranges, issue1933-preflight-calibration, issue4288-preflight-stale-baseline-fit-exit, preflight-fail-fast (31/31). Typecheck clean.
No kernel/config/version change; no production mutation. Full CI pending.
Closes #4930