Repository navigation
[PR] EN | compress: reject overlapping ranges atomically instead of silently skipping one - #5545
ranxianglei wants to merge 10 commits into
Conversation
…ping (#5541) applyCompression previously warn+skipped later overlapping ranges (earliest wins, legacy ISSUE-42 / dog/billion-context-pi#21), partially applying the batch. The model had already written both summaries, so the skipped range's summary was silently discarded and cross-references in the surviving block dangled; the event was also invisible in bili.log on the external-summary probe path. Overlapping (incl. nested) ranges now reject the WHOLE batch before any fold — zero commits, no prefix rewrite — naming each conflicting pair, consistent with the all-or-nothing contract #3003/#3939 established for every other failure class. The dead skipSpecs plumbing is removed. Consumed-range skips and unknown-ref per-range errors keep their existing semantics. kernel-change: owner-requested behavior change in issue #5541 — the overlap decision lives inside kernel applyCompression (resolved boundary indices), so the host side cannot express atomic validation without duplicating boundary resolution.
stream.ts gate classification gains gate:overlap for the new kernel rejection (previously it would have been mislabeled gate:summary-length). The external-summary probe path now carries the kernel's own conflict text into its refusal receipt instead of the generic 'no selected range passed' message, so the event is greppable in bili.log on every lane.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11150-pr.5545.f0ea3f0This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5545.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 检索 open+closed 的 issue/PR(overlap / partial-apply / skipSpecs / silent skip 多组关键词)均无同机制既有工作;这是把 overlap 归并进 #3003/#3939 已确立的 all-or-nothing 契约的独立行为变更。 这是 agent-authored PR(带 ① 是什么问题:一次 compress 批次里两个 range 重叠时,旧行为是「最早者赢、后者 warn+skip」,批次部分落地——被跳过 range 的模型已写好摘要被静默丢弃,存活块里留下悬空交叉引用,浪费一轮。本 PR 改为整批原子拒绝。 ② 什么原因导致的:legacy(ISSUE-42 / dog#21)的 warn+skip 早于 all-or-nothing 契约存在,overlap 是当时唯一漏网的「部分应用」路径。根因是与既有原子性契约不一致,属 owner 请求的有意行为变更,不是旧代码的 bug。 ③ 影响范围与严重程度:任何「一个批次内两个 range 共享至少一条消息」(含嵌套)的场景。旧:部分折叠 + 摘要被丢 + 悬空引用(静默数据质量退化,非崩溃)。新:干净原子拒绝 + 点名冲突对。严重度=正确性/质量提升,无可用性影响;kernel 层,plugin/proxy 两模式都覆盖。 ④ 怎么修复的: ⑤ 是否有回归问题(逐项过既有行为):
⑥ 是否破坏缓存:不涉及。无 wire/prefix/cache-key 变化,纯决策面 + 日志分类改动,不触发缓存失效。 ⑦ 是否改了设计方向:无架构转向;是把 overlap 收敛进既有 all-or-nothing 契约(收敛,非分叉)。 ⑧ 是否引入新配置:不涉及。无新 env/config/knob。 测试有效性:有牙、非恒真。核心断言钉住零提交纯度(
判定:代码质量达标,行为变更合理且已按规范披露(旧 warn+skip → 新原子拒绝 + 理由),测试有牙含负向守卫;改动区本地验证通过。可合前提两条:① CI 出绿(当前 head f4bf2e4 所有 check run 均为 skipped、分支 behind master——建议 rebase 后让 CI 真正跑一遍再合);② 修正上面那个串档的 |
# Conflicts: # kernel/package.json # package-lock.json # src/external-summary-compress.ts
(ai: vllm-qwen/qwen3.8-27b) CI-engineer run report — both blockers cleared; head 1) Merge conflict (was
Everything else auto-merged cleanly ( Verification: typecheck clean (kernel + pi-subagents rebuilt at 0.0.193); targeted suites green — kernel regression-bugfixes + protect-recent 38/38; host compress-reject-reasons + no-visible-context + external-summary 33/33; loop-breaker + wire-contract 33/33. Final PR diff vs master = exactly the 8 intended files. 2) Red CI on the new head — Status: no conflicts remain, checks fully green — awaiting human review/merge (§7.4: kernel changes stay human-only tier). 八问(中文审核清单)
判定:可合 —— 冲突已解、CI 52/52 全绿,按 §7.4 含 kernel 变更留人工 review/merge。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) The full run report is already posted above in this thread ("CI-engineer run report — both blockers cleared"). Final state, verified live this run: merge conflict resolved (merge commit |
…6150 fold-point removal) Master independently bumped the kernel to 0.0.193 for the compressAtFoldPoint removal; this PR's overlap atomic-reject changes now sit on top of that, so the version must move again (max+1, same precedent as #5609 sync). Both lockfiles regenerated; diff vs master is only the kernel version lines.
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) CI-engineer run report — stale "dirty" event; proactively re-synced with moved master; new head Live re-verification first (per status-freshness rule): the event reported merge state What I did:
Live state after push: head Behavior-change disclosure: the kernel version for this PR moves 0.0.193 → 0.0.194 relative to my previous report — forced by master consuming 0.0.193 for the unrelated fold-point removal; content of this PR is unchanged. 八问(中文审核清单)
判定:可合 —— 无冲突、分支已含 master 最新 tip,kernel 版本纪律满足;新 head |
[ework] CI fix verified green ✓ |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Findings-only review — kernel-gated, not approving.
Reviewed end-to-end: PR body, linked issue #5541, full diff (kernel/src/compress.ts, both host lanes, all tests), and every applyCompression call site. No blocking findings. I am not approving because this touches kernel/ and carries a kernel-change: declaration — the human-only kernel tier gates the merge (see the follow-up 🔶 comment).
Direction (issue #5541): correct root-cause fix. The reported harm was partial application of an overlapping batch → the surviving block's summary left dangling cross-references to a non-existent block, plus the skipped range's generated summary silently discarded with no log trace. The fix removes the producer (the warn+skip partial path) by validating atomicity BEFORE any fold, aligning overlap with the all-or-nothing contract (#3003/#3939) already used by every other failure class. Not a mask — if the same overlap surfaced differently tomorrow, the pre-fold gate still holds.
Correctness:
- Conflict sweep runs over resolved boundary indices (not messageIds) — correct, since block-ref spans carry empty messageIds yet occupy
[start,end]. - Shared-boundary (a message in two ranges) and nesting are both treated as overlap — correct, both pinned by tests.
- Rejection returns
blocksCreated=0/tokensCompressed=0and fires before any fold loop, so zero-commit purity holds;warnings: []leaves no partial-apply residue. classificationErrorsappended, so a batch mixing overlap with unknown/consumed refs reports both.
Regression surfaces examined (all safe):
src/stream.tsapplyRanges (~1448):gate:overlapadded FIRST in the reason chain; the #4521 no-op path requireserrors.length===0, so the reject (errors.length===1) is correctly returned asrefusedand classified greppably. Both-direction gate discipline satisfied.src/external-summary-compress.ts(~105): probe preview yields no blocks on reject →work.length===0; newoverlapErrorcheck fires BEFORE the generic #5558 refusal, surfacing the named conflict (fixes the reporter's empty-grep symptom).src/preflight.ts(4 sites: 322/2493/2628/2883): all single-range previews — cannot self-overlap; no impact.kernel/src/rebuild.ts:51: replays historical compress calls; already tolerates 0-block invocations (sumsblocksCreated, ignoreserrors). A pre-PR overlapping batch would now rebuild as 0 blocks instead of a partial fold — low risk (rare bug pattern being eliminated; no new overlapping batches can be created post-fix). Examined, acceptable.state.deadRefsmutation sits before the gate (new lines 460/464) — pre-existing and identical for the other two atomic rejections (summary-length ~802, apply-errors ~911); not introduced or worsened here.
Tests: strong, both directions per gate discipline (#3617). Positive: overlapping pair, nested range, input-order determinism (sorted vs shuffled deepEqual on the error list), disjoint-sibling-also-rejected ("1 of 3", disjoint range not blamed). Negative: adjacent block-boundary distillation must still fold (blocksCreated===2) — pins the gate does NOT over-suppress. Zero-commit purity asserted (state.blocks.length===0). protect-recent.test.ts reworked off the retired skip trick (legitimate adaptation). These catch both a regression to partial application AND an over-suppressing gate.
Version discipline: kernel/src changed → kernel/package.json bumped 0.0.192→0.0.193 (+ lockfile file-link sync). Satisfied.
Behavior change disclosed: yes — old warn+skip (earliest wins) → new atomic whole-batch reject, with rationale; consumed-range skips and unknown-ref per-range errors explicitly unchanged.
Verdict: clean and ready for the human/kernel-tier approval. Not self-approving (kernel gate applies).
八问结论(中文,供人工评审)
- 是什么问题:一次 compress 调用里传了两个互相重叠(或嵌套)的范围时,内核只折了先到的那个、静默跳过另一个——被跳过范围已生成的摘要整块丢弃、存活块摘要里留下指向不存在块的悬空引用,且日志里 grep 不到这条事件。
- 什么原因导致的:重叠范围走的是 ISSUE-42 遗留的「warn+skip(earliest wins)」部分应用路径,早于 #3003/#3939 确立的全有全无契约,是最后一处仍会部分应用的失败类。
- 影响范围与严重程度:任何在单次 compress 批次里发出重叠/嵌套范围的会话都会触发(模型批量提交时的偶发误用);严重度=特定条件下有问题——不丢原始消息(下轮重折自愈),但会浪费该轮全部摘要生成、留悬空指针、且无日志痕迹可排查。非 p1(可用、能自愈)。
- 怎么修复的:把「重叠」从部分应用改成应用前原子校验——按解析后的边界索引扫一遍,发现任意重叠/嵌套即整单拒绝(
blocksCreated=0、不改写前缀),并在错误里逐一命名冲突对;与其余所有失败类的全有全无契约对齐。宿主两条车道(stream.ts的gate:overlap、external-summary 的overlapError)把具名冲突透传到回执,事件可在 bili.log grep。 - 是否有回归问题:审过既有行为——consumed-range 跳过(refold)、unknown-ref 逐范围报错均保持不变(有意设计,PR 正文已披露);preflight 四处均为单范围预览不可能自重叠;rebuild.ts 重放历史 compress 调用本就能容忍 0-block 结果(累加
blocksCreated、忽略errors),历史重叠批次现在重建为 0 块而非部分折叠,属低风险(该 bug 模式正在被消除、修复后不会再产生新重叠批次)。高危模式逐项:无语义漂移(fail-fast 反而更彻底)、无阈值/时序意外漂移(错误文案变化是本次有意变更已披露)、无缓存/重试静默失效。 - 是否破坏缓存:否。拒绝发生在任何折叠之前,不做前缀改写,前缀缓存不受影响;模型改用不相交范围重发后正常折叠。实际比旧的部分折叠更安全。
- 是否改了设计方向:是(有意的行为变更,PR 正文已 old→new 披露)——重叠从「部分应用+告警」转为「整单原子拒绝」,统一到既有全有全无契约,未引入新架构/边界。
- 是否引入了新的配置:不涉及。无新 env/config/CLI/默认值。
判定:代码干净、测试双向齐全、回归面已清点,具备合入条件;因触及 kernel/ 并带 kernel-change: 声明,按人工专属档不自批,转 🔶 需要决策 等 owner 授权。
|
🔶 需要决策 This PR cannot be auto-approved: it modifies
@ranxianglei please confirm authorization to proceed with the human-tier review/merge. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review complete on PR #5545 (head What I did
Actions taken
Remaining: owner authorization for the human/kernel-tier merge ( |
…545-conflict # Conflicts: # kernel/package-lock.json # kernel/package.json # package-lock.json
[bot] 🏷 Conflict resolved and pushed — PR #5545 head is now Q1 — What was the blocker? Q2 — How did you fix it? Q3 — Did anything semantic need resolving? Q4 — Did you verify it? Q5 — Any behavior change introduced by THIS run? Q6 — Push discipline? Q7 — Live state now (verified against the mirror cache this run, not memory)? |
[ework] CI fix verified green ✓ |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Re-review at new head 86a678492 (was 6d4e3ecff) — findings only, kernel-gated.
The head moved since my last review. I isolated what actually changed:
What changed
- The branch was re-synced onto current master (
dc041dd1ab), pulling in unrelated master work that happens to touch the same files: #5765 (block retirement /acp_retire·acp_restore·acp_rewrite) and #6132/#6150 (removal of the experimentalcompressAtFoldPoint). Those carry their own reviews already — they are not this PR's contribution. - One new commit
b5b2c86c7c— version sync only.
What did NOT change (verified)
- The PR's own contribution is byte-identical to the state I reviewed last round. Confirmed two ways:
git diff 6d4e3ecff..86a678492aover the PR's files shows only the #5765/#6132/#6150 hunks (none of the overlap logic), and direct grep on the new head confirms every piece is present:kernel/src/compress.ts:535-561—overlapConflictssweep + atomic reject ("Batch rejected before folding any range … overlap another range … nesting counts as overlap").src/stream.ts:1436—gate:overlapfirst in the reason chain.src/external-summary-compress.ts:110-112—overlapErrorsurfaces the named conflict before the generic refusal.kernel/tests/regression-bugfixes.test.ts:374,441,575,614— the four overlap tests (pair, disjoint-sibling, nesting, adjacent-boundary negative guard).
- So every finding from my last review still holds: no blocking findings; direction is a correct root-cause fix (atomic pre-fold rejection replacing warn+skip partial application); tests are two-directional per gate discipline.
Version discipline (re-checked): kernel/package.json is now 0.0.196 = master's 0.0.195 + 1. Correct — master independently advanced the kernel for the fold-point removal, so this PR lands on top at max+1. Kernel Boundary rule 2 satisfied (kernel/src changed ⇒ version bumped).
Interaction with the newly-merged master changes (checked): the #5765 retired-block refusal throws inside applySingleRange (per-range apply phase), while this PR's overlap gate runs earlier (pre-fold, whole-batch). They compose cleanly — an overlapping batch rejects at the overlap gate first; a disjoint batch with a retired-consuming range rejects in the apply phase. No regression introduced by the merge.
Verdict: unchanged from last round — clean, ready for the human/kernel-tier approval. Not self-approving (kernel gate applies). Authorization still pending (see the 🔶 comment).
八问结论(中文,供人工评审 · 复审 @ 新 head 86a6784)
- 是什么问题:一次 compress 调用里传了互相重叠(或嵌套)的范围时,内核只折先到的那个、静默跳过另一个——被跳过范围已生成的摘要整块丢弃、存活块摘要里留下指向不存在块的悬空引用,且日志里 grep 不到这条事件。
- 什么原因导致的:重叠走的是 ISSUE-42 遗留的「warn+skip(earliest wins)」部分应用路径,早于 #3003/#3939 确立的全有全无契约,是最后一处仍会部分应用的失败类。
- 影响范围与严重程度:任何在单次 compress 批次里发出重叠/嵌套范围的会话都会触发;严重度=特定条件下有问题——不丢原始消息(下轮重折自愈),但浪费该轮全部摘要生成、留悬空指针、且无日志痕迹可排查。非 p1(可用、能自愈)。
- 怎么修复的:把「重叠」从部分应用改成应用前原子校验——按解析后的边界索引扫一遍,发现任意重叠/嵌套即整单拒绝(
blocksCreated=0、不改写前缀),并在错误里逐一命名冲突对;宿主两条车道(stream.ts的gate:overlap、external-summary 的overlapError)把具名冲突透传到回执,事件可在 bili.log grep。 - 是否有回归问题:本次复审重点核对了「master 重同步带入的同文件改动」与本 PR 的交互——#5765 退休块拒绝在
applySingleRange(逐范围应用阶段)抛错,本 PR 的重叠门在更早的折叠前整单拒绝,二者独立、顺序清晰,组合无回归;#6132/#6150 fold-point 移除与本 PR 无共享代码路径。既有行为(consumed-skip、unknown-ref 逐范围报错)保持不变;rebuild.ts 重放历史批次已能容忍 0-block。高危模式逐项:无语义漂移、无阈值/时序漂移、无缓存/重试静默失效。 - 是否破坏缓存:否。拒绝发生在任何折叠之前,不做前缀改写,前缀缓存不受影响;模型改用不相交范围重发后正常折叠。实际比旧的部分折叠更安全。
- 是否改了设计方向:是(有意的行为变更,PR 正文已 old→new 披露)——重叠从「部分应用+告警」转为「整单原子拒绝」,统一到既有全有全无契约,未引入新架构/边界。
- 是否引入了新的配置:不涉及。无新 env/config/CLI/默认值。
判定:本 PR 自身代码与我上轮审过的状态字节级一致,仅多了一次正确的内核版本 bump(0.0.196 = master 0.0.195 + 1)与 master 重同步;无新增发现。因触及 kernel/ 并带 kernel-change: 声明,按人工专属档不自批,等 owner 授权。
|
🔶 需要决策 Re-confirmed at new head
@ranxianglei please confirm authorization. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review complete on PR #5545 at new head What changed since last review
Verified
Actions taken
Remaining: owner authorization for the human/kernel-tier merge. No open ends, no parked debt. |
[ework] CI fix verified green ✓ |
[bot] 🏷 Conflict resolved and pushed — PR #5545 head is now Q1 — What was the blocker? Q2 — How did you fix it? Q3 — Did anything semantic need resolving? Q4 — Did you verify it? Q5 — Any behavior change introduced by THIS run? Q6 — Push discipline? Q7 — Live state now (verified against the mirror cache this run, not memory)? |
[ework] CI fix verified green ✓ |
[bot] 🏷 Q1 — What was the problem? Q2 — What caused it? Q3 — Scope and severity? Q4 — How was it fixed? Q5 — Any regression risk? Q6 — Push discipline? Q7 — Live state now (verified against the mirror cache this run)? |
[bot] 🏷 Already fixed — no further work this run. This event reports |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Re-review at new head 5cd7b7b2ca (was 86a678492) — findings only, kernel-gated.
The head moved again. I isolated what actually changed:
What changed
- Master advanced (
dc041dd1ab→faf0af61a6), pulling in unrelated master work that touches the same files: the compresscontentparameter format change (now ONE string holding every range, array form still accepted as a fallback), the #5608-DpendingLedgerAlignre-arm fix, and a few perf refactors (array→Map, lazyrequestText). Those carry their own reviews on master — they are not this PR's contribution, and none of them touch the overlap logic. - One new PR commit
5cd7b7b2ca— purely mechanical: fixes a 1-line version-indent drift inkernel/package-lock.json(the lock-sync CI check flagged it after the merge). No logic.
What did NOT change (verified)
- The PR's own contribution remains byte-identical to rounds 1 and 2. Confirmed two ways:
git diff 86a678492a..5cd7b7b2caover the PR's files shows only the master hunks above (none of the overlap logic), and direct grep on the new head confirms every piece is present:kernel/src/compress.ts:535-561—overlapConflictssweep + atomic reject ("Batch rejected before folding any range … overlap another range … nesting counts as overlap").src/stream.ts:1439—gate:overlapfirst in the reason chain.src/external-summary-compress.ts:111-113—overlapErrorsurfaces the named conflict before the generic refusal.kernel/tests/regression-bugfixes.test.ts— the overlap tests (pair, disjoint-sibling, nesting, adjacent-boundary negative guard) unchanged.
- So every finding from my prior reviews still holds: no blocking findings; direction is a correct root-cause fix (atomic pre-fold rejection replacing warn+skip partial application); tests are two-directional per gate discipline.
Interaction with the new master format change (checked): the content-as-one-string change is at the parsing layer (how content becomes ranges); this PR's overlap gate runs downstream on the already-parsed input.ranges. The overlap regression tests call applyCompression directly with parsed ranges, so they bypass the parser entirely — unaffected. CI green confirms the full parse→gate path holds.
Version discipline (re-checked): kernel/package.json is now 0.0.198 = master's 0.0.197 + 1. Correct (max+1 over master's current kernel). Kernel Boundary rule 2 satisfied.
Verdict: unchanged across all three reviews — clean, ready for the human/kernel-tier approval. Not self-approving (kernel gate applies). Authorization still pending (see the 🔶 comment).
八问结论(中文,供人工评审 · 第 3 次复审 @ 新 head 5cd7b7b)
- 是什么问题:一次 compress 调用里传了互相重叠(或嵌套)的范围时,内核只折先到的那个、静默跳过另一个——被跳过范围已生成的摘要整块丢弃、存活块摘要里留下指向不存在块的悬空引用,且日志里 grep 不到这条事件。
- 什么原因导致的:重叠走的是 ISSUE-42 遗留的「warn+skip(earliest wins)」部分应用路径,早于 #3003/#3939 确立的全有全无契约,是最后一处仍会部分应用的失败类。
- 影响范围与严重程度:任何在单次 compress 批次里发出重叠/嵌套范围的会话都会触发;严重度=特定条件下有问题——不丢原始消息(下轮重折自愈),但浪费该轮全部摘要生成、留悬空指针、且无日志痕迹可排查。非 p1(可用、能自愈)。
- 怎么修复的:把「重叠」从部分应用改成应用前原子校验——按解析后的边界索引扫一遍,发现任意重叠/嵌套即整单拒绝(
blocksCreated=0、不改写前缀),并在错误里逐一命名冲突对;宿主两条车道(stream.ts的gate:overlap、external-summary 的overlapError)把具名冲突透传到回执,事件可在 bili.log grep。 - 是否有回归问题:本次复审核对了「master 推进带入的同文件改动」与本 PR 的交互——compress
content改「单字符串」在解析层,本 PR 的重叠门在解析后的input.ranges下游,二者解耦;重叠测试直接喂已解析 ranges、绕过解析器,不受影响。既有行为(consumed-skip、unknown-ref 逐范围报错)保持不变;rebuild.ts 重放历史批次已能容忍 0-block。高危模式逐项:无语义漂移、无阈值/时序漂移、无缓存/重试静默失效。 - 是否破坏缓存:否。拒绝发生在任何折叠之前,不做前缀改写,前缀缓存不受影响;模型改用不相交范围重发后正常折叠。
- 是否改了设计方向:是(有意的行为变更,PR 正文已 old→new 披露)——重叠从「部分应用+告警」转为「整单原子拒绝」,统一到既有全有全无契约,未引入新架构/边界。
- 是否引入了新的配置:不涉及。无新 env/config/CLI/默认值。
判定:本 PR 自身代码与第 1、2 轮审过的状态字节级一致;本轮新增仅一次机械的 lockfile 缩进修正(5cd7b7b2ca)与 master 重同步;内核版本正确 bump 到 0.0.198(= master 0.0.197 + 1);无新增发现。因触及 kernel/ 并带 kernel-change: 声明,按人工专属档不自批,等 owner 授权。
|
🔶 需要决策 Re-confirmed at new head
@ranxianglei please confirm authorization. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review complete on PR #5545 at new head What changed since last review
Verified
Actions taken
Remaining: owner authorization for the human/kernel-tier merge. No open ends, no parked debt. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Closing the loop on the round-3 re-review of PR #5545 (head Status (unchanged across all three reviews):
Verdict: no blocking findings. The PR's own overlap-rejection code is byte-identical every round; the head only moved via master re-syncs plus one mechanical lockfile-indent fix ( Awaiting your authorization for the human/kernel-tier merge ( |
[bot] 🏷 Conflict resolved and pushed — PR #5545 head is now Q1 — What was the blocker? Q2 — How did you fix it? Q3 — Did anything semantic need resolving? Q4 — Did you verify it? Q5 — Any behavior change introduced by THIS run? Q6 — Push discipline? Q7 — Live state now (honest verification note)? |
[ework] CI fix verified green ✓ |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Re-review at new head cacb0578c (was 5cd7b7b2ca) — findings only, kernel-gated.
Fourth re-review of this PR. The head moved again via a master re-sync; I isolated what actually changed:
What changed
- The new head is a merge commit —
Merge branch 'master' into 2026-11-02_compress-overlap-atomic-reject (sync for #5545). No new PR-specific commits: the four PR commits (be309ca52fkernel,f4bf2e4352host surfacing,b5b2c86c7c+5cd7b7b2calockfile/version) are byte-for-byte the same as the previously-reviewed state. - Master advanced to
a446a3c1c8(Merge PR #6827 batch11-wave11), pulling in: #7105 (compress success-receipt wording: drop head/tail labels, fold timestamp, label the kernel-anchor quote as historical), #7083 (wire client-sidecars), and lock-sync of the kernel entry to0.0.199. Those carry their own master reviews — they are not this PR's contribution.
What did NOT change (verified on the new head)
- The PR's own overlap code is byte-identical to rounds 1–3. Confirmed three ways:
- The four PR commits are unchanged (merge-base = master tip, so the branch's only new commit is the sync merge).
git diff 5cd7b7b2ca..cacb0578cover the PR's files shows only master's hunks — inkernel/src/compress.tsat line 205 (numericBlockId) and line 1060 (createCore), and insrc/stream.tsinsideapplyRanges/helpers. None touch the overlap gate.- Direct read on the new head: the overlap "Batch rejected before folding any range … overlap another range … nesting counts as overlap" string is byte-identical (shifted 561→557 by the unrelated 4-line deletion above it);
src/stream.ts:1558still hasgate:overlapfirst in the reason chain; the#4521no-op guard is stillif (r.errors.length === 0)(so the overlap reject, which setserrors.length===1, still falls through to the refusal, not the no-op);src/external-summary-compress.ts:111,113still surfacesoverlapErrorbefore the generic refusal; the overlap regression tests are present.
- So every finding from my prior reviews still holds: no blocking findings; direction is a correct root-cause fix (atomic pre-fold rejection replacing the warn+skip partial application); tests are two-directional per gate discipline.
Interaction with the new master changes (checked): #7105 rewrites the compress success receipt (the applied path) — the overlap reject goes through the refused path (gate:overlap), so the two don't touch. #7083 adds sidecar handling inside applyRanges, but the gate:overlap chain and the no-op guard are intact. CI green on the pushed head confirms the full parse→gate→receipt path holds.
Version discipline (re-checked): kernel/package.json is now 0.0.200 = master's 0.0.199 + 1. Correct (max+1 over master's current kernel). Kernel Boundary rule 2 satisfied.
Verdict: unchanged across all four reviews — clean, ready for the human/kernel-tier approval. Not self-approving (kernel gate applies). Authorization still pending (see the 🔶 comment).
八问结论(中文,供人工评审 · 第 4 次复审 @ 新 head cacb057)
- 是什么问题:一次 compress 调用里传了互相重叠(或嵌套)的范围时,内核只折先到的那个、静默跳过另一个——被跳过范围已生成的摘要整块丢弃、存活块摘要里留下指向不存在块的悬空引用,且日志里 grep 不到这条事件。
- 什么原因导致的:重叠走的是 ISSUE-42 遗留的「warn+skip(earliest wins)」部分应用路径,早于 #3003/#3939 确立的全有全无契约,是最后一处仍会部分应用的失败类。
- 影响范围与严重程度:任何在单次 compress 批次里发出重叠/嵌套范围的会话都会触发;严重度=特定条件下有问题——不丢原始消息(下轮重折自愈),但浪费该轮全部摘要生成、留悬空指针、且无日志痕迹可排查。非 p1(可用、能自愈)。
- 怎么修复的:把「重叠」从部分应用改成应用前原子校验——按解析后的边界索引扫一遍,发现任意重叠/嵌套即整单拒绝(
blocksCreated=0、不改写前缀),并在错误里逐一命名冲突对;宿主两条车道(stream.ts的gate:overlap、external-summary 的overlapError)把具名冲突透传到回执,事件可在 bili.log grep。 - 是否有回归问题:本次复审核对了 master 推进带入的同文件改动与本 PR 的交互——#7105 改的是 compress 成功回执(
applied路径),本 PR 的重叠拒绝走 refused 路径(gate:overlap),二者不相交;#7083 在applyRanges里加了 sidecar 处理,但gate:overlap链与#4521no-op 门(errors.length===0)原样保留。既有行为(consumed-skip、unknown-ref 逐范围报错)保持不变;rebuild.ts 重放历史批次已能容忍 0-block。高危模式逐项:无语义漂移、无阈值/时序漂移、无缓存/重试静默失效。 - 是否破坏缓存:否。拒绝发生在任何折叠之前,不做前缀改写,前缀缓存不受影响;模型改用不相交范围重发后正常折叠。
- 是否改了设计方向:是(有意的行为变更,PR 正文已 old→new 披露)——重叠从「部分应用+告警」转为「整单原子拒绝」,统一到既有全有全无契约,未引入新架构/边界。
- 是否引入了新的配置:不涉及。无新 env/config/CLI/默认值。
判定:本 PR 自身代码与前三轮审过的状态字节级一致;本轮新增仅一次 master 同步 merge(cacb0578c);内核版本正确 bump 到 0.0.200(= master 0.0.199 + 1);无新增发现。因触及 kernel/ 并带 kernel-change: 声明,按人工专属档不自批,等 owner 授权。
|
🔶 需要决策 Re-confirmed at new head
@ranxianglei please confirm authorization. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review complete on PR #5545 at new head What changed since last review
Verified on the new head
Actions taken
Remaining: owner authorization for the human/kernel-tier merge. No open ends, no parked debt. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Closing the loop on the round-4 re-review of PR #5545 (head Status (unchanged across all four reviews):
Verdict: no blocking findings. The PR's own overlap-rejection code is byte-identical every round; the head only moved via a master-sync merge ( Awaiting your authorization for the human/kernel-tier merge ( |
[ework] CI fix verified green ✓ |
[bot] 🏷 4th conflict sync for PR #5545 — resolved and pushed. Q1 — What was done? Merged master Q2 — What conflicted, and why? Four files: the three version-echo files (kernel/package.json, kernel/package-lock.json, package-lock.json — master's release v0.1.216 window moved kernel 0.0.200→0.0.201 against the branch's 0.0.200) and one semantic conflict in Q3 — How was it resolved? Version files: took master's side, bumped kernel to 0.0.202 (above master's 0.0.201 — the merged tree carries both sides' kernel changes), then regenerated both lockfiles with Q4 — How was it verified? Union proof in both directions: worktree vs master = exactly the PR's 8-file changeset (5 code/test + 3 version); worktree vs branch = exactly master's 119-file changeset (same file set as master's 99-commit diff). typecheck clean, build clean, 1650/1650 targeted kernel tests — including master's new Q5 — Push discipline? Fetched before pushing: remote head was still Q6 — Live state? The mirror cache is stale for this PR (last fetch 2026-11-18, still showing the old head), so I cannot quote live check state for the new sha — saying so rather than guessing. Git-side verification instead: the new head Q7 — Anything pending or notable? Nothing pending on this lane. One behavioral note for reviewers: master's merge brought in its own model-facing wording change in |
[ework] CI fix verified green ✓ |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
Re-review at new head 1ae7a74b4 (was cacb0578c) — findings only, kernel-gated.
Fifth re-review. The head moved again via a master re-sync; I isolated what actually changed:
What changed
- The new head is a merge commit —
Merge branch 'master' into 2026-11-02_compress-overlap-atomic-reject (sync for #5545). No new PR-specific commits: the four PR commits (be309ca52fkernel,f4bf2e4352host surfacing,b5b2c86c7c+5cd7b7b2calockfile/version) are byte-for-byte the same as the previously-reviewed state. - Master advanced to
ba2e8198203(Merge PR #7428 fix-batch-seam-double-claim), pulling in: #7428 (batch-seam double-claim fix — refresh the apply-loop coverage snapshot so two adjacent ranges can't both claim a tool pair on their shared seam), #7357 (pf-window-ledger), #7430/#7379 (dsh-mneme known-conflict scan), and a model-facing text change (covered no-op warning no longer claims same-batch involvement). Those carry their own master reviews — they are not this PR's contribution.
What did NOT change (verified on the new head)
- The PR's own overlap code is byte-identical to rounds 1–4. Confirmed:
- The four PR commits are unchanged (merge-base = master tip, so the branch's only new commit is the sync merge).
git diff cacb0578c..1ae7a74b4over the PR's files shows only master's hunks —kernel/src/compress.tsat line 383 (a comment), line 831 (summary-length region), line 1917 (applySingleRange), andsrc/stream.tsat lines 737/780 (postCompressTail). None touch the overlap gate.- Direct read on the new head: the overlap "Batch rejected before folding any range … overlap another range … nesting counts as overlap" string is byte-identical;
src/stream.ts:1601still hasgate:overlapfirst in the reason chain; the#4521no-op guard is stillif (r.errors.length === 0)(so the overlap reject, which setserrors.length===1, still falls through to the refusal, not the no-op);src/external-summary-compress.tsstill surfacesoverlapErrorbefore the generic refusal; the overlap regression tests are present.
- So every finding from my prior reviews still holds: no blocking findings; direction is a correct root-cause fix (atomic pre-fold rejection replacing the warn+skip partial application); tests are two-directional per gate discipline.
Interaction with the new master changes (checked): #7428's fix refreshes the apply-loop preExistingCoverage snapshot to enforce the "no-overlapping-active-siblings" invariant (adjacent ranges double-claiming a tool pair on their shared seam). That is a different mechanism from this PR's overlap gate — this PR rejects message-overlapping ranges atomically before any fold; #7428 fixes a seam double-claim during the apply loop. The two are orthogonal and compose cleanly (the new comment even states the classification "feeds the overlap gate"). #7357/#7430/#7379 don't touch compress overlap. CI green on the pushed head confirms the full parse→gate→apply→receipt path holds.
Version discipline (re-checked): kernel/package.json is now 0.0.202 = master's 0.0.201 + 1. Correct (max+1 over master's current kernel). Kernel Boundary rule 2 satisfied.
Verdict: unchanged across all five reviews — clean, ready for the human/kernel-tier approval. Not self-approving (kernel gate applies). Authorization still pending (see the 🔶 comment).
八问结论(中文,供人工评审 · 第 5 次复审 @ 新 head 1ae7a74)
- 是什么问题:一次 compress 调用里传了互相重叠(或嵌套)的范围时,内核只折先到的那个、静默跳过另一个——被跳过范围已生成的摘要整块丢弃、存活块摘要里留下指向不存在块的悬空引用,且日志里 grep 不到这条事件。
- 什么原因导致的:重叠走的是 ISSUE-42 遗留的「warn+skip(earliest wins)」部分应用路径,早于 #3003/#3939 确立的全有全无契约,是最后一处仍会部分应用的失败类。
- 影响范围与严重程度:任何在单次 compress 批次里发出重叠/嵌套范围的会话都会触发;严重度=特定条件下有问题——不丢原始消息(下轮重折自愈),但浪费该轮全部摘要生成、留悬空指针、且无日志痕迹可排查。非 p1(可用、能自愈)。
- 怎么修复的:把「重叠」从部分应用改成应用前原子校验——按解析后的边界索引扫一遍,发现任意重叠/嵌套即整单拒绝(
blocksCreated=0、不改写前缀),并在错误里逐一命名冲突对;宿主两条车道(stream.ts的gate:overlap、external-summary 的overlapError)把具名冲突透传到回执,事件可在 bili.log grep。 - 是否有回归问题:本次复审核对了 master 推进带入的同文件改动与本 PR 的交互——#7428(batch-seam double-claim)刷新的是 apply 循环里的
preExistingCoverage快照(相邻范围在共享 seam 上重复认领 tool pair),与本 PR「折叠前对消息重叠范围做原子拒绝」是两个不同机制,正交且能组合(新注释明确说分类结果「feeds the overlap gate」);#7357/#7430/#7379 不碰 compress 重叠。既有行为(consumed-skip、unknown-ref 逐范围报错)保持不变;rebuild.ts 重放历史批次已能容忍 0-block。高危模式逐项:无语义漂移、无阈值/时序漂移、无缓存/重试静默失效。 - 是否破坏缓存:否。拒绝发生在任何折叠之前,不做前缀改写,前缀缓存不受影响;模型改用不相交范围重发后正常折叠。
- 是否改了设计方向:是(有意的行为变更,PR 正文已 old→new 披露)——重叠从「部分应用+告警」转为「整单原子拒绝」,统一到既有全有全无契约,未引入新架构/边界。
- 是否引入了新的配置:不涉及。无新 env/config/CLI/默认值。
判定:本 PR 自身代码与前四轮审过的状态字节级一致;本轮新增仅一次 master 同步 merge(1ae7a74b4);内核版本正确 bump 到 0.0.202(= master 0.0.201 + 1);无新增发现。因触及 kernel/ 并带 kernel-change: 声明,按人工专属档不自批,等 owner 授权。
|
🔶 需要决策 Re-confirmed at new head
@ranxianglei please confirm authorization. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Re-review complete on PR #5545 at new head What changed since last review
Verified on the new head
Actions taken
Remaining: owner authorization for the human/kernel-tier merge. No open ends, no parked debt. |
(ai: vllm-qwen/qwen3.8-27b) Closing the loop on the round-5 re-review of PR #5545 (head New action this run: the 🔶 decision comment has now been unanswered for 10 days (5 rounds, 2026-11-11 → 2026-11-21). Per the decision-escalation rule (2026-10-25), I've filed a p1 decision-request issue so the merge authorization is visible in the dashboard, not just in the PR thread: → #7436 — kernel authorization request: PR #5545 (compress: reject overlapping ranges atomically) — approve or reject It lists the gated diff, the disclosed behavior change (old warn+skip → new atomic reject), and the options: A — Approve and merge (recommended; fully reviewed, CI green, version discipline satisfied) / B — Reject and close. Status (unchanged across all 5 reviews): no blocking findings. The PR's own overlap-rejection code is byte-identical every round; the head only moved via master re-syncs plus mechanical lockfile fixes. Kernel version correctly at Awaiting your authorization for the human/kernel-tier merge ( |
kernel-change: owner-requested behavior change in issue #5541
The overlap decision lives inside kernel
applyCompression(resolved boundary indices); the host side cannot express atomic validation without duplicating boundary resolution. Requested and scoped in #5541.Closes #5541
Behavior change (old → new)
Old: overlapping ranges in one compress batch → later range(s) warn+skip (earliest wins, legacy ISSUE-42 / dog/billion-context-pi#21); the batch partially applies. New: any overlap (incl. nesting) rejects the WHOLE batch before any fold — zero commits, no prefix rewrite — naming each conflicting pair. Rationale: the model writes all summaries up front, so partial application silently discards the skipped range's summary (wasted turn) and leaves dangling cross-references in the surviving block; the model can now resubmit disjoint ranges and converge in one round. This aligns overlap with the all-or-nothing contract #3003/#3939 already established for every other failure class — overlap was the last remaining partial-application path.
Unchanged by design: consumed-range skips (refold machinery, rich diagnostics) and unknown-ref per-range errors keep their existing semantics — neither produced the reported harm.
Changes
kernel/src/compress.ts— replace the skipSpecs loop with conflict collection; atomic reject return carryingBatch rejected before folding any range — K of N requested range(s) overlap another range in the same batch: (a..b) overlaps (c..d)…; delete the now-dead skipSpecs plumbing (5 sites).kernel/tests/regression-bugfixes.test.ts— rewrite the three pinned overlap tests to assert atomic rejection (zero-commit purity, named pairs, order determinism); add nested-range case and an adjacent-block-boundary distillation guard (sequential block spans must NOT trip the gate).kernel/tests/protect-recent.test.ts— "warnings accumulate across multiple ranges" no longer relies on the retired overlap-skip trick; fixture now uses a consumed range + a zone-clipped live range for two distinct per-range warnings.kernel/package.json0.0.178 → 0.0.179 (+ lockfile file-link sync).src/stream.ts— gate classification gainsgate:overlap(before the genericgate:summary-lengthmatch).src/external-summary-compress.ts— refusal receipt carries the kernel's own conflict text on the probe path instead of the generic "no selected range passed" message; makes the event greppable in bili.log on every lane (the reporter's empty-grep symptom).Evidence
blocksCreated=1,errors=[], silent skip warning (summary of the larger range discarded).blocksCreated=0, single error naming the pair, e.g.(m00002..m00005) overlaps (m00001..m00003).