Repository navigation
[PR] fix: pin the headroom judge denominator to a stable output ceiling (#3017) - #3328
ranxianglei wants to merge 3 commits into
Conversation
9da298c to
8db7ad1
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4316-pr.3328.14fb250This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3328.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b)
结构化八问
收工判定:冲突已清,head |
79aa1a9 to
fcee2dd
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复 —— open+closed 的 issue/PR 里按失败签名(headroom 分母漂移、stable output ceiling、effectiveContextLimit 钉死)检索,无其他条目;仅原始 #3017。 对 PR #3328 做了独立复审(未照抄原报告),并在复审中修掉了两个阻塞项,分支已推新 head fcee2dd:
结构化八问
行为变更(old → new,必报)
判定本地定向验证 + typecheck 全绿;守卫类 CI job 在新 head 上已全绿(docs-sync 待翻转,本地漂移检查已确认干净)。全量 test 套件正在远程 CI 跑 fcee2dd,绿了即可合(合并请人工操作)。CI 结果出来我再跟一条。 |
(ai: vllm-qwen/qwen3.8-27b) CI 跟进(fcee2dd):全量 test 套件抓到 3 个确定性失败 + 1 个疑似 flake,已定位并修复,新 head 5bb499d。 3 个确定性失败 = 本 PR 披露的行为变更在测试侧的连带
验证过程(先定版本再归因):三个文件在纯 master(d8c0e50,独立 worktree + build)上 34/34 全绿,在本 PR head 上恰好这 3 例红 → 是本 PR diff 引入,不是 master 存量红。 机制:这三个测试的模型 修法(与 PR 已改的 preflight-fail-fast/issue2096 同款处理):给测试 harness 的模型声明补上稳定的输出上限,算术与改前逐位一致,被钉住的机制不变——
本地:这三个文件 34/34 绿,typecheck 干净,原定向 8 文件 36/36 仍绿。 1 个疑似 flake(未修,观察)
状态5bb499d 已推,等全量 CI。守卫类 job 上一轮已全绿(docs-sync 修复已确认)。CI 结果出来我再跟一条最终判定。 |
(ai: vllm-qwen/qwen3.8-27b) 最终判定:可合并(等 rerun 的 Windows shard 转绿即可;我无合并权限,请你合)head 5bb499d(已 rebase 到当前 master d8c0e50,分支原先落后 469 个提交,冲突按意图并集解决)。CI:全部守卫 job 绿(含 docs-sync)、ubuntu 全 shard 绿、e2e lane 正常;唯一红 = 结构化八问
审核过程备注(独立于 issue 文本)
本地验证(rebased head):typecheck 干净;定向测试 8 文件 36/36 + 3 个修复文件 34/34 全绿;全量套件以 CI 为准。 |
|
冲突 |
5bb499d to
8f2224d
Compare
(ai: vllm-qwen/qwen3.8-27b)
结构化八问
收工判定:冲突已清,head |
|
失败冲突 |
…3017) The nudge/preflight judge denominator was seeded from the PER-REQUEST wire max_tokens, so the wall it measures drifted between requests (the #3004 incident logged four walls in one session, two within one second). Pin it to the client-configured / model-declared output scale via resolveKnownOutputCeiling (runtime-info > launcher > configured > registry — no wire value), decided once per session/model and published through the same single point as before. The outgoing max_tokens clamp still caps against the full native window independently (budget.ts), so overflow safety never depended on this denominator and is unchanged. Behavior change (old -> new): - Models WITH a declared/configured output ceiling: reservation magnitude unchanged (min(ceiling, cap*window)), but it no longer wobbles when the client asks for a different amount each turn — the wall is now constant per session/model. - Models with NO stable ceiling anywhere (unknown to config/registry/runtime-info/ launcher): the reservation now drops to 0 (full-window denominator) even when the request body carries max_tokens; such sessions compress slightly LATER than before. Overflow is still prevented by the independent clamp.
…relied on wire max_tokens (#3017) #453 escalation and the two #2155 self-heal integration tests asserted nudge behavior at 72% of a window reserved from the per-request wire max_tokens. #3017 moved the reservation to the stable declared/configured output ceiling, so model m now declares output 20_000 to keep the exact pre-change arithmetic (reserved = window - 20k) that pins those mechanisms.
8f2224d to
f9209f8
Compare
(ai: vllm-qwen/qwen3.8-27b)
结构化八问
收工判定:冲突已清,head |
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #3017 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
是什么 / What
#3004 事故里,同一会话的 headroom judge 分母(nudge/emergency 阈值所度量的那堵"墙")在请求之间漂移——甚至同一秒出现两个分母(1036971 vs 984464)。根因:判定分母 =
窗口 − 预留,而预留被喂的是逐请求 wire max_tokens;coding agent 每次调用要的输出量不同,墙就跟着动。修法 / Fix
把判定分母固定到每会话/模型定一次的稳定输出预算:复用
restoreOutputBudget已在用的同一解析resolveKnownOutputCeiling(runtime-info #955 > launcher #971 > configured > registry #853,不含 wire 值),单点发布到session.metadata.effectiveContextLimit(发布点没变)。逐请求 wire max_tokens 不再驱动分母,但仍喂 outgoing clamp——clamp 独立地对完整 nativeWindow 封顶(budget.ts),溢出安全从来就不依赖这个分母,未受影响。净删 ~49 行:删掉原内联的三段 fallback 链 + 5 个孤立 import + 一个 dead Set(
headroomFallbackLogged)。行为变更(old → new,必报)
min(ceiling, cap×窗口)),但不再随客户端每轮要的量抖动——墙现在每会话/模型恒定。验证 / Verification
npm run typecheck干净(kernel + pi-subagents 构建通过,tsc over src+tests 无错)。tests/issue3017-stable-headroom-denominator.test.ts(同会话不同 wire max_tokens → 分母恒定;未知模型 → 完整窗口 == 今日行为)。全量套件交 CI。Closes #3017