Skip to content

[PR] fix(#5596): stop refused dsh compaction replays from pinning the output budget at 4096 - #5603

Open
ranxianglei wants to merge 2 commits into
masterfrom
2026-11-03_dsh-refusal-floor-clamp
Open

ranxianglei wants to merge 2 commits into
masterfrom
2026-11-03_dsh-refusal-floor-clamp

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

中文摘要:dsh 车道被拒压缩回放的字节数(#1729 守卫的粘性高水位记账)被 #2490 规划下限拿去规划输出预算,把健康会话整段踩死在 4096 max_tokens。修复:clamp 只按本请求实测输入规划;记账降级为诊断水印(acp_status 单列展示)。详见下方 Behavior change。

What this fixes

Closes #5596

The #1729 guard records the byte size of every dsh native-compaction replay it refuses (session.metadata.dshCompactionRefusedBytes, sticky high-water) and the #2490 planning floor converted that into a lower bound for output-budget planning (gated since #3384 by "request >= 25% of window or view at wall"). But refused bytes are never forwarded upstream — they are not a future input. In the field incident (window 256000, requested 128384) one transient ~867KB replay set floor 216690 → cap floor(256000 − ceil(216690×1.12) − margin) = 1172 < 4096 → wire max_tokens = 4096 (#3071 capability floor), model cut off mid-sentence at exactly 4096 output tokens, lane stuck there until it ended.

Fix

The clamp (src/server/budget.ts) now plans against the measured input of THIS request only; per-request defenses own overflow (preflight / egress fuse #4079/#4185). The record stays as a diagnostic watermark:

  • recording path untouched (src/server/handle.ts code unchanged);
  • acp_status shows it on its own DSH COMPACTION REPLAYS REFUSED — raw-ledger high-water N tok … diagnostic only line instead of the old planning floor N tok from the refused dsh compaction replay (#2490, sticky…) clause;
  • clampOutgoingOutput ctx drops ledgerFloorTokens; the three prepare call sites stop passing it; lastOutputClamp type drops the field.

Behavior change (old → new)

  1. Lanes with refusal records: max_tokens rises from floor-crushed values (field incident: 4096 on the sublane, 62797 on the main session) to measured-input-honest values up to the requested budget. This is the intended recovery.
  2. Disclosed tradeoff — the dsh压缩与bili压缩冲突 #2490 monster-replay shape itself: floor ≈ 900K vs 1M window previously shrank the budget to 55K; post-fix it follows the measured value (no clamp when headroom suffices). True overflows in that regime are handled LOUDLY by preflight/egress fuse instead of being silently clamped — and the original dsh压缩与bili压缩冲突 #2490 kill chain (un-foldable turn → doomed probe 502) remains covered by bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733's authored compaction answer plus the fuse.
  3. acp_status wording: one combined line becomes two separate lines (clamp event + diagnostic watermark), per the contract above.

Measured-input clamping itself is byte-pinned unchanged: near-wall inputs still clamp (e.g. est 240K / window 256K → 4096 capability floor), sub-floor shapes still surrender to preflight.

Config surface

None. No new env vars, config keys, or defaults. dshCompactionRefusedBytes stays internal session metadata (diagnostic only now).

Tests

Coordination note

In-flight branch 2026-10-31_ledger-floor-authored-decay (#5289) changes what the AUTHORED path stamps (snapshot vs envelope bytes); this change removes the CLAMP-side consumption entirely. Orthogonal; possible comment-only overlap around the record site — rebase if needed.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-03_dsh-refusal-floor-clamp (62e4369)

Latest build — install this exact version

npm install -g billion-context@0.0.10889-pr.5603.92d0f88

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
62e4369 billion-context@0.0.10889-pr.5603.92d0f88 build
05ab965 billion-context@0.0.9133-pr.5603.d045cb6 build
8d60668 billion-context@0.0.9116-pr.5603.957d6df build
eea49bf billion-context@0.0.9007-pr.5603.8c57e97 build
d6db7fc billion-context@0.0.7985-pr.5603.3ecd174 build
e809888 billion-context@0.0.7983-pr.5603.490474d build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5603.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title fix(#5596): stop refused dsh compaction replays from pinning the output budget at 4096 [PR] fix(#5596): stop refused dsh compaction replays from pinning the output budget at 4096 Nov 3, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重: 不重复 —— 本 PR 是 #5596 的唯一在途修复;在途 2026-10-31_ledger-floor-authored-decay(#5289)改的是 AUTHORED 路径记什么(与本次删除 CLAMP 侧消费是另一侧),正交、无冲突。
标签: #5596 已带齐 bug / p2 / dsh / scope-wiring,无需补打。

Review 结论(八问)

  1. 是什么问题:dsh 原生压缩被 bili 拒收后,该车道输出预算被钉死在 4096——模型每轮在恰好 4096 token 处截断,车道降级直到结束。
  2. 什么原因导致的:三个机制叠加:nudge 死锁无检测:同一 session 交替收到两种结构互斥的请求流(巨型单消息 ↔ 多轮)时不告警 #1729 守卫把被拒回放字节数记成会话粘性高水位(dshCompactionRefusedBytes)→ dsh压缩与bili压缩冲突 #2490 把它换算成输出预算规划的 planning floor(bytes/4)→ dsh native compaction guard refuses 100% → client ledger never shrinks → every step fails from turn 8, last 4 turns output empty | dsh 原生压缩守卫 100% 拒绝 → 客户端本地账本只增不减 → 会话第 8 轮起每步失败、后 4 轮输出全空 #3384 的门(request ≥ 25% 窗口或折叠视图已抵目标位)让它在巨型请求区精确生效。核心缺陷:被拒的字节从不上行、永远不会成为未来的输入,拿它预留输出空间是系统性过度预留(现场数字:窗口 256000、被拒 866760B → floor 216690 → cap 1172 → 线上 max_tokens=4096)。
  3. 影响范围与严重程度:仅 dsh 车道,且需同时满足「压缩被拒过 + request ≥25% 窗口(或视图抵目标)」;现场案例真实存在。严重度:能用但明显坏、会话数据完好、无不可恢复损伤、无缓存泄露 → p2 成立。
  4. 怎么修复的:把 ledger floor 从 CLAMP 决策路径移除——规划输入只取「本请求实测输入」;记录路径保留但降级为纯诊断水印(acp_status 明示 "diagnostic only");真实溢出交给 preflight/egress 熔断(Context Window Overflow Issue Summary: Raw Requests Sent Directly to Upstream Rejected + Local Intercept Cooldown Lockin | 上下文超窗问题汇总:请求裸冲上游被拒 + 本地拦截冷却锁死会话(统一分析入口) #4079/413 Deadlock: When an authenticated session exceeds the reservation window with zero collapsibles, the #3146 forwarding | 413 死锁:带身份会话超预留窗口且零可折叠时,#3146 转发门因 anonymous 条件不触发,会话从首条消息起永久不可用 #4185)显式处理,替代原先的静默 clamp。
  5. 是否有回归问题:逐项过既有行为,无无意回归——① 拒绝记录路径逐字节未动;② 近墙实测输入仍会 clamp(新负向行:实测 240K/256K → 4096);③ sub-floor 让位行不变;④ 能力地板 4096 仍由实测输入钉住;⑤ fail-fast 语义未变吞错;⑥ 无 kernel 改动、wire 形状无变化。有意行为变更(已披露):旧 dsh压缩与bili压缩冲突 #2490 怪物回放形态(floor≈900K vs 1M 窗口)原先会把预算预先缩到 55K,现跟随实测输入(headroom 够则不 clamp),溢出走熔断显式路径——CHANGELOG 已列旧值→新值。
  6. 是否破坏缓存:不涉及(未触碰缓存/重试/增量游标/去重键)。
  7. 是否改了设计方向:没有——在既有 clamp 机制内做消费侧移除,观测面(记录 + 状态行)保留。
  8. 是否引入新配置:没有。

测试有效性:门控双向齐全(#3617 纪律:该触发时触发——近墙实测输入仍 clamp;不该触发时不触发——事故形态直通);另有真 e2e(~320KB 信封 → 422 拒收 + 高水位落账 → 次回合 30K 预算原样上行)。断言钉的是精确 wire 值,回归时抓得住。四个旧 pin 文件(issue2490/3384/3071/3148)按新契约重新锚定,重锚理由写入各文件。本地定向验证 34/34 绿 + typecheck 干净。

CI 处置:静态门禁全绿(kernel-guard/config-surface-guard/static-gates 等);6 个红 test 分片 = 继承性 master 红(master d244fff,#4599 已列档:#5556 落 master 未重生成 golden → storage-render 漂移,今日 #5597/#5601 同签名)。我拉了一个红分片日志核实:该分片 4 条失败全部是 storage-render golden (chat/anthropic/responses/google),本 PR 区域零失败。已把 origin/ci-fixes(4809a83,golden regen)merge 进分支并推送,新 head d6db7fc,等重跑(已在 #4599 留一行)。

结论:代码面 ready;建议 d6db7fc 全矩阵转绿后合并。

@ranxianglei

Copy link
Copy Markdown
Owner Author

说明:GitHub 禁止作者对自己的 PR 提交正式 APPROVE 评审(API 返回 422 "Can not approve your own pull request")。本评论承载完整 review 与合并建议——建议 APPROVE(可合)。

(ai: vllm-qwen/qwen3.8-27b)

结论:APPROVE —— 修复打在根因上,既有行为逐项审过无意外回归,双向测试 + 真 e2e 钉死,行为变更已披露。CI 全绿(30 check,0 红,mergeable_state=blocked 仅待 review)。

按八问:

  1. 是什么问题:dsh 车道被 bili 拒发的原生压缩回放,其字节数被记成会话级粘性高水位,又被 dsh压缩与bili压缩冲突 #2490 规划下限拿去抬高输出预算规划——但被拒的字节从不发出、不是未来输入。一次 ~867KB 的瞬时回放把一条健康的 256K 窗口车道整段踩死在 wire max_tokens=4096,模型在恰好 4096 output tokens 处句中截断,直到泳道结束。

  2. 什么原因:根因是「拿永不发出的字节当未来输入来规划」。nudge 死锁无检测:同一 session 交替收到两种结构互斥的请求流(巨型单消息 ↔ 多轮)时不告警 #1729 守卫拒发时记 dshCompactionRefusedBytes(粘性高水位),clampOutgoingOutput 取 planningInput = max(实测输入, floor);而 dsh native compaction guard refuses 100% → client ledger never shrinks → every step fails from turn 8, last 4 turns output empty | dsh 原生压缩守卫 100% 拒绝 → 客户端本地账本只增不减 → 会话第 8 轮起每步失败、后 4 轮输出全空 #3384 的 giant-request 门控是 raw >= 25%×窗口,常见默认请求(≥25%)恒真,门控形同虚设,floor 永远生效。修的是「误把拒绝字节计入规划」的会计错误本身,不是表面现象。

  3. 影响范围与严重程度:所有 dsh 车道、且会话内出现过一次被拒压缩回放的会话;触发条件=请求 ≥25% 窗口(常态)。严重度:该车道此后所有长回答只剩 4096 预算(体验毁灭级,但对话不损坏、部分输出保留)→ p1 可用性缺陷。

  4. 怎么修复:clamp 只按本请求实测输入规划(clampOutputBudget(raw, inputEstimate, …)),彻底移除 floor 消费(ledgerFloorTokens ctx 字段、giant/viewAtTarget 两门控、OUTPUT_LEDGER_FLOOR_GIANT_REQUEST_PCT 常量全删);记录保留为诊断水印(acp_status 单列 DSH COMPACTION REPLAYS REFUSED 行,明标不参与规划);溢出防御交还逐请求的 preflight/egress fuse(Context Window Overflow Issue Summary: Raw Requests Sent Directly to Upstream Rejected + Local Intercept Cooldown Lockin | 上下文超窗问题汇总:请求裸冲上游被拒 + 本地拦截冷却锁死会话(统一分析入口) #4079/413 Deadlock: When an authenticated session exceeds the reservation window with zero collapsibles, the #3146 forwarding | 413 死锁:带身份会话超预留窗口且零可折叠时,#3146 转发门因 anonymous 条件不触发,会话从首条消息起永久不可用 #4185)。记账写入路径(handle.ts)一字未动。

  5. 是否有回归(逐项过):① 输出预算钳制基准 max(实测, floor)→ 仅实测。健康车道恢复=预期修复;实测近墙输入仍钳到 4096([bug] 0.1.195 输出预算三路饿死仍复现:无 output 上限模型 restore 无下限(1→252、fork 原样转发 1)、#2490 planning floor 钳到 1479–2623 → 3 会话 9 次 finish=length 空轮不重试(#546/#1665/#1840/#2904/#2756 残留) #3071 能力地板,math 复核 est 240K/窗 256K→4096)、超墙仍 surrender 给 preflight(est 252K→不钳)——负向方向已钉。唯一语义漂移(已披露):dsh压缩与bili压缩冲突 #2490 怪物请求形状(floor≈900K/窗 1M)此前预算被压到 55K,现跟随实测值不再静默预缩,真实溢出改由 preflight/fuse 大声处理(fail-fast 4xx,非吞错)——有意且已披露的方向选择,非静默回归。② acp_status 文案:一行合并行拆成两行(clamp 事件 + 诊断水印),纯展示、无决策路径读它,issue3148 已按新串钉住。③ lastOutputClamp 类型去掉 ledgerFloor 字段:纯展示 stat(runtime 不强制类型,旧持久化数据多一字段读时忽略、新数据无字段,均不崩,无需迁移)。④ 被拒字节记账:写入不变,用途从「规划」降为「诊断」。⑤ dsh压缩与bili压缩冲突 #2490 (b) doomed-probe 半壁(seedStuckMeter / 413 fail-fast / Context Window Overflow Issue Summary: Raw Requests Sent Directly to Upstream Rejected + Local Intercept Cooldown Lockin | 上下文超窗问题汇总:请求裸冲上游被拒 + 本地拦截冷却锁死会话(统一分析入口) #4079 GROWN·REPEATED 日志 / Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 负向)完整保留、未削弱。既有行为清单审毕,无意外破坏。

  6. 是否破坏缓存:不。max_tokens 是输出参数,不进 prompt 前缀,改它不影响前缀缓存稳定性;不涉及任何缓存键/重试/增量游标/去重策略。

  7. 是否改了设计方向:是,且合理——溢出防御从「对粘性高水位静默预钳」转向「逐请求大声防御(preflight/fuse)」,符合项目「可用性大于性能」「疏而非堵」原则:floor 本质是对「永不发出字节」的过度保守掩码,移除即修掉生产端会计错误。

  8. 是否引入新配置:否。无新 env/config/默认值;dshCompactionRefusedBytes 仍是内部 session metadata(现仅诊断)。

测试有效性:新增 tests/issue5596-refusal-floor-no-planning.test.ts 双向钉(正向:事故形状 est 184K→39614 非 4096、main est 100K→full 128384;负向:实测近墙 240K→仍 4096、超墙 252K→surrender)+ 真 e2e(真实 server+假 upstream:拒发 ~320KB 信封记水印→下一回合 30K 预算原样通过,带 band-guard 证明此测修复前必红)。四个既有 pin(issue2490/3384/3071/3148)改锚合法——旧断言钉的正是被移除的行为,新断言钉新契约,且 clampOutputBudget 能力地板纯函数断言逐字保留、doomed-probe e2e 完整。非恒真、非 mock-only,bug 回归时抓得住。

diff 整洁度:核心修复(e809888)聚焦 budget.ts/handle.ts/acp-status.ts/session.ts/三个 prepare + 测试;storage-render golden 变更来自继承的 ci-fixes 合并(#5555/#5415 重生成),与本逻辑正交,走 AGENTS.md 认可的继承红收敛路径,非本 PR 噪音;无空行/重排淹没真实逻辑。

判定:可合(APPROVE)。无人工决策项(不碰 kernel/、无 kernel-change 声明、无 config surface 变更)。合并权在 owner。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Review 已完成,结论:建议 APPROVE(可合) —— 完整结构化八问审核见上一条评论,此处只给收口要点,不重复全文。

  • 方向对:修的是根因——被拒 dsh 压缩回放的字节(dshCompactionRefusedBytes)不再参与输出预算规划,clamp 只按本请求实测输入走;记账降级为 acp_status 诊断水印,写入路径一字未动。
  • 回归审毕:既有行为逐项过,唯一语义漂移(dsh压缩与bili压缩冲突 #2490 怪物请求形状不再静默预缩、改由 preflight/fuse 大声兜底)已在 PR 描述披露;近墙实测输入仍钳到 4096、超墙仍 surrender,负向方向已钉。dsh压缩与bili压缩冲突 #2490 doomed-probe 半壁完整保留。
  • 测试有牙:新增双向钉 + 真 e2e(带 band-guard,修复前必红);四个既有 pin 改锚合法,能力地板纯函数断言逐字保留。非恒真/非 mock-only。
  • CI:全绿(30 check,0 红,mergeable_state=blocked 仅待 review)。
  • 无人工决策项:不触碰 kernel/、无 kernel-change 声明、无 config surface 变更。

owner 可直接合并:#5603

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

冲突已解,PR 恢复可合状态,新 head CI 全绿。 本次只做了冲突 rebase + 验证,未改任何代码逻辑。

本轮做了什么

  1. Rebase 到当前 master:分支旧 head d6db7fcbb 基于 883 个提交之前的分叉点(4809a831c2)。rebase 后分支收敛为单个提交 eea49bf1e4(原 fix commit)直接坐在最新 master 58a879622 上。原第二笔提交(ci-fixes golden 重生成合并)被 rebase 自然丢弃——master 已含更新的 goldens,丢弃正确(逐文件核对过:rebase 后 goldens 与 master 逐字节一致)。
  2. 唯一冲突 = CHANGELOG.md(双方都在 Unreleased/Fixed 列表加条目):按 union-of-intent 保留双方全部条目——master 的 8 条在前,本 PR 的 max tokens 4096 dsh 4096 — from the "emergency output budget clamp" of the billion-context proxy, not from the DSH clien | max token 4096 dsh 4096 来自 billion-context 代理的「紧急输出预算钳制」,不是 DSH 客户端,也不是模型 #5596 条目紧随其后,无内容取舍。
  3. 语义保真核验(不只信 auto-merge):把「rebase 后树 vs master」的 diff 与原 PR 提交的 diff 逐文件比对——src 6 文件 + 测试 5 文件的内容行逐一相同,差异只有 hunk 行号偏移;handle.ts 的改动确认仍是纯注释(记录路径代码零改动);ledgerFloor 残留引用只剩 acp_status 诊断水印一行(设计内)。
  4. 本地门禁:typecheck 干净;定向测试 34/34(五个被触碰测试文件,含 e2e)+ 相邻 clamp 套件 32/32(clampOutputBudget 签名变了,把周边 7 个 clamp 行为套件都跑了一遍防漏)。全量留给 CI——已跑完,39 success + 15 skipped,0 failed。
  5. 推送:push 前 fetch 复核无人并发动分支/master,按任务授权 force-push(--force-with-lease,旧 head 校验匹配)。
  6. 继承红排查:CI Control Center: Centralized CI Failure Handling & Status Sync (Comment all CI issues here; do not open new issues) | CI 总控: CI 失败集中处理与状态同步(所有 CI 问题在此评论, 勿开新 issue) #4599 最新档(floor 1214)记录 master 在两条 gated e2e 车道(real dsh headless profile lane、real pi package-native lane)红、哨兵称修复收敛 ci-fixes——但远端 ci-fixes 现落后 master 85 个提交、0 ahead(最后提交早于 master tip),无可合并内容,故未 merge;且这两条车道对 PR 需 ci:full 标签才跑,本 PR 无该标签 → 本次 CI 中两者均 skipped,无继承红进入本 PR。master 侧那两条车道仍红的状态供总控参考,不在本 PR 范围内处置。

八问

  1. 是什么问题:PR [PR] fix(#5596): stop refused dsh compaction replays from pinning the output budget at 4096 #5603 与 master 冲突(dirty)不可合——分支停在 11 月 3 日的分叉点上,master 期间前进了 883 个提交。
  2. 什么原因导致的:纯时间漂移,非内容矛盾——冲突面只有 CHANGELOG.md 一处(双方各自往 Fixed 列表追加条目);代码文件虽有大量 master 侧改动(handle.ts +587 行等),但与本 PR 触碰区域不相交,auto-merge 直接成立。
  3. 影响范围与严重程度:仅本 PR 的可合性;不涉用户面。解除后 PR 回到待审可合状态。
  4. 怎么修复的:rebase 到最新 master(而非 merge),让分支保持单一线性提交、diff 最小;唯一文本冲突按 union 保留双方条目;丢弃的 ci-fixes 合并提交经核对已被 master 更新版本取代。
  5. 是否有回归问题:无——未改任何代码逻辑,rebase 后树相对 master 的 diff 与原 PR 提交逐内容行一致;既有行为零漂移;typecheck + 定向 66 用例 + CI 全矩阵绿。
  6. 是否破坏缓存:不涉及(未触碰任何缓存/重试/游标/去重路径)。
  7. 是否改了设计方向:没有(纯合并操作)。
  8. 是否引入了新的配置:没有。

判定:冲突已清,CI 全绿(39 success / 15 skipped / 0 failed),mergeable=true,ready 待 owner 审阅合并——#5603 。注:force-push 后原有 review 审批可能失效,需重新 approve。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei
ranxianglei force-pushed the 2026-11-03_dsh-refusal-floor-clamp branch from eea49bf to 8d60668 Compare November 11, 2026 10:03
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

第二次冲突已解(上一轮 rebase 后 master 又前进了 ~30 个提交),新 head 8d60668295 CI 全绿、mergeable=true。 本次仍是纯合并操作,未改任何代码逻辑。

本轮做了什么

  1. 发现新冲突来源:上一轮 rebase 的基底 58a8796224 之后,master 前进到 dc041dd1ab(~30 提交:Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765 acp block-ops 特性、Remove the compressAtFoldPoint feature — it reorders resent history and caused an authorship-misattribution incident in a live session #6132 compressAtFoldPoint 移除等,69 文件)。本 PR 13 个文件中有 4 个被 master 同时触碰(CHANGELOG.md、prepare-google/openai/responses.ts)。
  2. Rebase 到新 master tip:唯一文本冲突 = src/server/prepare-openai.ts 第 43-45 行 import 区——master 侧 Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765 在相邻行加了 effectiveBlockOpsEnabled import,本 PR 在同行区删了 dshLedgerFloorTokens import。按 union-of-intent 解决:删 dshLedgerFloorTokens(本 PR 意图:该文件的唯一使用点已被移除,留着是死导入)+ 保留 effectiveBlockOpsEnabled(Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765 新代码第 235 行在用)。本 PR 对函数体的改动(去掉 clamp 调用的 ledgerFloorTokens: 实参)auto-merge 干净落位。
  3. 语义保真核验:4 个重叠文件「新树 vs 新 master」的内容行 diff 与原 PR 提交逐行比对,全部 IDENTICAL;其余 9 个文件 master 未动过,rebase 平凡保真。CHANGELOG union 完整(max tokens 4096 dsh 4096 — from the "emergency output budget clamp" of the billion-context proxy, not from the DSH clien | max token 4096 dsh 4096 来自 billion-context 代理的「紧急输出预算钳制」,不是 DSH 客户端,也不是模型 #5596 条目在位)。dshLedgerFloorTokens 残留引用只剩 budget.ts 导出+注释与 acp-status 诊断水印(设计内)。
  4. 本地门禁:typecheck 干净;定向测试 34/34(五个被触碰测试文件)+ 相邻 clamp 套件 35/35(clampOutputBudget 签名变更波及面)。全量由 CI 裁决。
  5. 推送:push 前 fetch 复核无并发改动(远端分支仍在 eea49bf1e4),按任务授权 force-with-lease:eea49bf1e4 → 8d60668295(单提交坐在最新 master 上)。
  6. CI 实况(镜像缓存本次 ~18 分钟不刷新,按策略单次拉取实时状态):54 check runs 全部完成——39 success + 15 skipped,0 failed;两条 master 红车道(dsh headless / pi package-native)依旧 skip-gated(本 PR 无 ci:full 标签),无继承红。

八问

  1. 是什么问题:PR 再次与 master 冲突(dirty)——不是上轮没修干净,是上轮 rebase 之后 master 又合入了 Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765 等大改动,重新撞上本 PR 的 import 区。
  2. 什么原因导致的:时间漂移叠加热点文件——prepare-openai.ts 是 Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765(block-ops 工具面)与本 PR(clamp 记账)共同触碰的文件,双方改了相邻 import 行,git 无法自动合并。
  3. 影响范围与严重程度:仅本 PR 可合性;解除后回到待审可合状态,不涉用户面。
  4. 怎么修复的:再 rebase 一次到最新 master,唯一冲突按「双方意图并集」解(各自要的东西都保留、各自的删除都生效),不做任何语义取舍。
  5. 是否有回归问题:无——零逻辑改动;4 个重叠文件内容行与原 PR 逐一相同,CI 全矩阵绿(39 success/0 failed);Request two capabilities: compressed block "retirement" and summary "external rewrite". | 请求两个能力:压缩块「退役」与摘要「外部重写」 #5765 新代码(effectiveBlockOpsEnabled)使用点完好。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:没有(纯合并操作)。
  8. 是否引入了新的配置:没有。

判定:冲突已清,CI 全绿,mergeable=true,ready 待 owner 审阅合并——#5603 。注:两次 force-push 后原 review 审批大概率失效,需重新 approve;若 master 继续高速前进可能再现同类漂移冲突,届时同法处置即可。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

复审结论:APPROVE(可合) —— head 从我上次审过的 d6db7fc 前进到 8d60668(重新 squash 成单 commit 并 rebase 到最新 master 基线 dc041dd),核心修复与测试逐字节未变,只有基线漂移;我另顺手修了一处被本 PR 弄假的过时 changelog 表述(commit 05ab9655d1)。重排后的代码 CI 30/30 全绿。

本轮相对上次多审了什么(head 变化的核实):

  • 逐文件比对:src/server/budget.ts、handle.ts、acp-status.ts、session.ts、三个 prepare-* 的修复逻辑与我上次审过的版本完全一致;五个测试文件(issue5596/2490/3071/3148/3384)逐字节相同(diff 为空)。
  • 新基线本身仍带「修复前」的 ledger-floor 消费端(OUTPUT_LEDGER_FLOOR_GIANT_REQUEST_PCT / ledgerFloorTokens? / giantRequestedBudget),本 PR 在其上干净移除——无隐藏冲突。
  • 死引用清扫(grep 新树):OUTPUT_LEDGER_FLOOR_GIANT_REQUEST_PCT、ledgerFloorTokens、.ledgerFloor 全部 CLEAN,无遗留调用方/读者;dshCompactionRefusedBytes 仅剩记录路径(handle.ts)+ dshLedgerFloorTokens(诊断)+ 测试断言。master 漂移虽大量触碰这些文件(nudge/fastpath/context-analysis 等),但都不落在 clamp 逻辑区,无交互回归。
  • 不碰 kernel/、无 kernel-change 声明、无 config surface 变更。

八问:

  1. 是什么问题:dsh 车道被 bili 拒发的原生压缩回放,其字节数被记成会话级粘性高水位,又被 dsh压缩与bili压缩冲突 #2490 规划下限拿去抬高输出预算——但被拒字节从不发出、不是未来输入。一次 ~867KB 瞬时回放把一条健康的 256K 窗口车道整段踩死在 wire max_tokens=4096,模型在恰好 4096 output tokens 处句中截断,直到泳道结束。

  2. 什么原因:根因是「拿永不发出的字节当未来输入来规划」。nudge 死锁无检测:同一 session 交替收到两种结构互斥的请求流(巨型单消息 ↔ 多轮)时不告警 #1729 守卫拒发时记 dshCompactionRefusedBytes(粘性高水位),clampOutgoingOutput 取 planningInput = max(实测输入, floor);而 dsh native compaction guard refuses 100% → client ledger never shrinks → every step fails from turn 8, last 4 turns output empty | dsh 原生压缩守卫 100% 拒绝 → 客户端本地账本只增不减 → 会话第 8 轮起每步失败、后 4 轮输出全空 #3384 的 giant-request 门控是 raw >= 25%×窗口,常见默认请求(≥25%)恒真,门控形同虚设,floor 永远生效。修的是这个会计错误本身,不是表面现象。

  3. 影响范围与严重程度:所有 dsh 车道、且会话内出现过一次被拒压缩回放的会话;触发条件=请求 ≥25% 窗口(常态)。严重度:该车道此后所有长回答只剩 4096 预算(体验毁灭级,但对话不损坏、部分输出保留)→ p1 可用性缺陷。

  4. 怎么修复:clamp 只按本请求实测输入规划(clampOutputBudget(raw, inputEstimate, …)),彻底移除 floor 消费(ctx 字段 ledgerFloorTokens、giant/viewAtTarget 两门控、OUTPUT_LEDGER_FLOOR_GIANT_REQUEST_PCT 常量全删);记录保留为诊断水印(acp_status 单列 DSH COMPACTION REPLAYS REFUSED,明标不参与规划);溢出防御交还逐请求的 preflight/egress fuse(Context Window Overflow Issue Summary: Raw Requests Sent Directly to Upstream Rejected + Local Intercept Cooldown Lockin | 上下文超窗问题汇总:请求裸冲上游被拒 + 本地拦截冷却锁死会话(统一分析入口) #4079/413 Deadlock: When an authenticated session exceeds the reservation window with zero collapsibles, the #3146 forwarding | 413 死锁:带身份会话超预留窗口且零可折叠时,#3146 转发门因 anonymous 条件不触发,会话从首条消息起永久不可用 #4185)。记账写入路径(handle.ts)一字未动。

  5. 是否有回归(逐项过):① 输出预算钳制基准 max(实测, floor)→ 仅实测。健康车道恢复=预期修复;实测近墙输入仍钳到 4096([bug] 0.1.195 输出预算三路饿死仍复现:无 output 上限模型 restore 无下限(1→252、fork 原样转发 1)、#2490 planning floor 钳到 1479–2623 → 3 会话 9 次 finish=length 空轮不重试(#546/#1665/#1840/#2904/#2756 残留) #3071 能力地板)、超墙仍 surrender(est 252K→不钳)——负向方向已钉。唯一语义漂移(已披露):dsh压缩与bili压缩冲突 #2490 怪物请求形状(floor≈900K/窗 1M)此前预算被压到 55K,现跟随实测值不再静默预缩,真实溢出改由 preflight/fuse 大声兜底(fail-fast 4xx,非吞错)。② acp_status 一行拆成两行(clamp 事件 + 诊断水印),纯展示、无决策路径读它,issue3148 已按新串钉住。③ lastOutputClamp 类型去掉 ledgerFloor 字段:纯展示 stat,旧持久化数据多一字段读时忽略、无需迁移。④ 拒绝字节记账:写入不变,用途从「规划」降为「诊断」。⑤ dsh压缩与bili压缩冲突 #2490(b) doomed-probe 半壁(413 fail-fast / Context Window Overflow Issue Summary: Raw Requests Sent Directly to Upstream Rejected + Local Intercept Cooldown Lockin | 上下文超窗问题汇总:请求裸冲上游被拒 + 本地拦截冷却锁死会话(统一分析入口) #4079 GROWN·REPEATED 日志 / Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617 负向)完整保留、未削弱。既有行为清单审毕,无意外破坏。

  6. 是否破坏缓存:不。max_tokens 是输出参数,不进 prompt 前缀;不涉及任何缓存键/重试/增量游标/去重策略。

  7. 是否改了设计方向:是,且合理——溢出防御从「对粘性高水位静默预钳」转向「逐请求大声防御(preflight/fuse)」,符合项目「可用性大于性能」「疏而非堵」:floor 本质是对「永不发出字节」的过度保守掩码,移除即修掉生产端会计错误。

  8. 是否引入新配置:否。无新 env/config/默认值;dshCompactionRefusedBytes 仍是内部 session metadata(现仅诊断)。

测试有效性:新增 tests/issue5596-refusal-floor-no-planning.test.ts 双向钉(正向:事故形状 est 184K→39614 非 4096、main est 100K→full 128384;负向:实测近墙 240K→仍 4096、超墙 252K→surrender)+ 真 e2e(带 band-guard,证明此测修复前必红)。四个既有 pin(issue2490/3384/3071/3148)改锚合法——旧断言钉的正是被移除的行为,能力地板纯函数断言逐字保留,doomed-probe e2e 完整。非恒真、非 mock-only,bug 回归时抓得住。

diff 整洁度:核心修复聚焦 budget/handle/acp-status/session/三 prepare + 测试;storage-render golden 等变更来自继承的 ci-fixes/master 合并,与本逻辑正交,走 AGENTS.md 认可的继承红收敛路径,非本 PR 噪音;无空行/重排淹没真实逻辑。

已顺手修:CHANGELOG.md 里 #3733 条目末句「…so the #2490 output-clamp regimes keep planning against the raw scale」是被本 PR 弄假的过时表述(现在时态声称拒绝字节仍喂给输出 clamp,现已不成立)→ 改为过去式并补注「该规划消费端已在 #5596 移除,现为诊断水印」。commit 05ab9655d1(docs-only,1 行,零功能影响)。

CI / 可合性:重排后代码 8d60668 = 30/30 全绿;我的 doc 修复 05ab965 零功能影响(CI 在新 head 重跑中)。mergeable_state=blocked 仅为「待 review」(正是本评审提供),非 CI 失败。

判定:APPROVE(可合)。无人工决策项(不触碰 kernel/)。合并权在 owner:#5603

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] (ai: vllm-qwen/qwen3.8-27b)

状态汇报(进程曾被强制重启,现已恢复;后续已改用带超时的本地镜像读取,避免网络挂起复发):本 PR 复审已完成,完整八问 review 见上方评论,此处只报最终态,不重复全文。

最终状态:head 05ab9655d(即我顺手修掉过时 changelog 表述后的提交)CI 30/30 全绿(failed 0 / pending 0);其上的核心修复与测试相对我上次审过的版本逐字节未变,仅 rebase 到更新的 master 基线,死引用清扫干净、无第二处规划消费端。

mergeable_state=blocked 仅为「待 review」,正是本评审提供。合并权在 owner:#5603

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

1 similar comment
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

ci-check added 2 commits November 19, 2026 04:26
…ut budget

The #1729 guard records the byte size of every dsh native-compaction
replay it refuses (session.metadata.dshCompactionRefusedBytes, sticky
high-water) and the #2490 planning floor converted it into a lower
bound for output-budget planning (gated since #3384 by 'request >= 25%
of window or view at wall'). But refused bytes are never forwarded -
they are not a future input. One transient ~867KB replay pinned a
healthy 256K-window lane onto the 4096 capability floor for its whole
life (wire max_tokens 4096; model cut off mid-sentence at exactly
4096 output tokens).

The clamp now plans against the measured input of THIS request only;
per-request defenses own overflow (preflight / egress fuse
shows it on its own 'DSH COMPACTION REPLAYS REFUSED' line, explicitly
non-planning.

Behavior change (disclosed): lanes with refusal records get max_tokens
back from floor-crushed values (4096 / 62797 in the field incident) to
measured-input-honest values up to the requested budget. The #2490
monster-replay shape (floor ~900K vs 1M window) previously shrank the
budget to 55K and now follows the measured value - true overflows are
handled loudly by preflight/fuse instead of being silently clamped.

Tests: new tests/issue5596-refusal-floor-no-planning.test.ts (both
directions + e2e); re-anchored pins issue2490 / issue3384 / issue3071 /
issue3148; recording paths untouched.
@ranxianglei
ranxianglei force-pushed the 2026-11-03_dsh-refusal-floor-clamp branch from 05ab965 to 62e4369 Compare November 18, 2026 20:30
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

第三次冲突已解(上轮 rebase 后 master 又前进 ~637 文件),新 head 62e4369400 CI 全绿、mergeable=true。 仍是纯合并操作,零逻辑改动;另保留了他人在分支上补的一笔 changelog 修正。

本轮做了什么

  1. 现场核查:远端分支 head 已不是上轮我推的 8d60668295——其上多了一笔 ci-check 的提交 05ab9655d1(单行 CHANGELOG 修正:bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733 旧条目里「refusal bytes 仍参与输出 clamp 规划」的表述已过时,改为「该规划消费端已在 max tokens 4096 dsh 4096 — from the "emergency output budget clamp" of the billion-context proxy, not from the DSH clien | max token 4096 dsh 4096 来自 billion-context 代理的「紧急输出预算钳制」,不是 DSH 客户端,也不是模型 #5596 移除,记录现为纯诊断水印」)。修正正确,按规则保留为独立提交,不吞并。
  2. 冲突来源:master 从 dc041dd1ab 前进到 a446a3c1c8(637 文件:Output-budget restore is discarded by the watermark fastpath rebind, so the restored max_tokens never reaches upstream while the log reports success #6752 输出预算跨 watermark 重绑定、[PR] fix: un-show a nudge whose request the upstream rejected #6531 三车道 nudge 重武装、Feature: show nudge-recommended vs actually-folded tokens per fold (recovery rate) in the web panel chart and session report | 功能:web 折线图与 session 报告显示每次压缩「推荐 vs 实际折叠」回收率 #6729 恢复视图等)。唯一文本冲突仍是 src/server/prepare-openai.ts import 区:master 侧新增了 outputBudgetField/readOutputBudget/writeOutputBudget 三个 import(同区相邻行),与本 PR 删除 dshLedgerFloorTokens 撞在一起。
  3. 解决(union-of-intent):删 dshLedgerFloorTokens(本 PR 意图,该文件使用点已移除)+ 保留三个新符号(master Output-budget restore is discarded by the watermark fastpath rebind, so the restored max_tokens never reaches upstream while the log reports success #6752 代码第 153/156/167 行在用)。函数体 auto-merge 落位正确:本 PR 对 clamp 调用去 ledgerFloorTokens: 实参的删除生效,且 master 新增的预算恢复代码完好。
  4. 语义保真核验:13 个文件逐一比对——8 个 src 文件与 4 个改锚测试文件的内容行 diff 与原 PR 提交全部 IDENTICAL;两处「差异」均为预期:CHANGELOG 多出 ci-check 的 bili-authored client compaction: let the host's own compaction flow run, but bili writes the checkpoint #3733 修正行、prepare-openai import 行适配了 master 新符号。
  5. 关键交叉验证:master 的 Output-budget restore is discarded by the watermark fastpath rebind, so the restored max_tokens never reaches upstream while the log reports success #6752 新特性与本次修复改的是同一个 clampOutgoingOutput——合并后的 budget.ts 同时保住两边(read/writeOutputBudget 新 API + max tokens 4096 dsh 4096 — from the "emergency output budget clamp" of the billion-context proxy, not from the DSH clien | max token 4096 dsh 4096 来自 billion-context 代理的「紧急输出预算钳制」,不是 DSH 客户端,也不是模型 #5596 的 floor 移除与注释块),全树无残留 ledgerFloorTokens ctx 引用;并额外跑了 master 新增的 issue6752/issue2011 输出预算测试:5/5 绿,确认没踩坏 master 新特性。
  6. 本地门禁:typecheck 干净;定向 34/34(五个被触碰测试文件)+ 相邻 clamp 套件 35/35 + master 新预算测试 5/5。
  7. 推送:push 前 fetch 复核无并发改动(远端仍在 05ab9655d1);按新 ci-held 纪律,本次为最终 head 推送、不带 [ework:ci-held] 标记(分支唯一一次全量 CI),force-with-lease:05ab9655d1 → 62e4369400(两提交坐在最新 master 上)。
  8. CI 实况(镜像缓存中途又停刷 ~19 分钟,按策略单次拉取):54 check runs 全部完成——39 success + 15 skipped,0 failed;两条 master 红车道依旧 skip-gated(无 ci:full 标签),无继承红。

八问

  1. 是什么问题:PR 第三次与 master 冲突(dirty)——master 高速前进(637 文件)再次撞上本 PR 的 import 区,非上轮遗留。
  2. 什么原因导致的:prepare-openai.ts 是持续热点(Output-budget restore is discarded by the watermark fastpath rebind, so the restored max_tokens never reaches upstream while the log reports success #6752 输出预算、[PR] fix: un-show a nudge whose request the upstream rejected #6531 nudge 等接连改同一 import 区),与本 PR 的删除行相邻,git 无法自动合并。
  3. 影响范围与严重程度:仅本 PR 可合性;解除后回到待审可合状态。
  4. 怎么修复的:rebase 到最新 master,唯一冲突按双方意图并集解;他人在分支上的 changelog 修正提交原样保留。
  5. 是否有回归问题:无——零逻辑改动;13 文件内容行逐一核验与原 PR 相同;master 新特性(Output-budget restore is discarded by the watermark fastpath rebind, so the restored max_tokens never reaches upstream while the log reports success #6752)代码与测试完好并通过;CI 全矩阵绿。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:没有(纯合并操作)。
  8. 是否引入了新的配置:没有。

判定:冲突已清,CI 全绿(39 success / 0 failed),mergeable=true,ready 待 owner 审阅合并——#5603 。注:三次 force-push 后原 review 审批已失效,需重新 approve;master 若继续高速前进,同类漂移冲突会再现,同法处置即可。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

复审结论:APPROVE(代码审查通过) —— head 又前进了:被 rebase 到更新的 master 基线(a446a3c),核心修复与我的 changelog 修复两个 commit 都重新提交(core=1c1a027d33,changelog=62e4369400)。我在新 head 上逐项复核,修复逻辑逐字节未变,判定维持。

本轮在新 head 62e4369 上复核了什么:

既有行为回归:无新回归。唯一语义漂移仍是上次已披露的那条(#2490 怪物形状不再静默预缩、改由 preflight/fuse 大声兜底),本轮回 base 未引入任何新的行为变更。

CI:新 head 62e4369 上运行中(0 红 / 13 pending)。该代码与我上次审过的 30/30 全绿版本逐字节一致,新增仅 #6752 正交重构 + 我的 docs-only changelog 修复,不预期功能回归;按规范不轮询等绿,若翻红会再次触发复审。

判定:APPROVE(可合,待 CI 终绿)。无人工决策项。合并权在 owner:#5603

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

1 similar comment
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[ework] CI fix verified green ✓

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant