Repository navigation
kernel: split compressible ranges around recorded-dead refs so receipts never bracket them (#3192 #3205) - #3230
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4136-pr.3230.c7afad8This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3230.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。 本 PR 是 #3192 的 owner 定向根治实现(#3205 已由你关闭并入 #3192,见 #3205 floor 4)。检索 open+closed(dead ref / compressible range / kernel split / buildCompressibleRanges):无其他在途 issue/PR 覆盖「内核分段围绕 DEAD ref 切分」这一改动;#3195(已合入的宿主侧止血)与 #3204(宿主侧姊妹面)与本 PR 分工明确、互不重叠。本条为 [PR] 跟踪 issue,我按 PR review 处理,不重做。 这是 kernel 变更(Kernel Boundary):human-only review,不自动合并。我按八问体例做完整审核——方向关(#3192/#3205)、回归关(recommend/nudge-text/types 既有行为逐项清点)、代码关、测试有效性关、diff 整洁度关,本地只跑定向套件,全量以 CI 为准。结论稍后。 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) PR #3230 审核结论(kernel 变更,human-only tier)审核证据(全部独立执行,非转述)方向关(①原 issue):#3192 的自相矛盾(回执宣告 DEAD 的 ref 同时出现在可压 span 里)已由 #3195 宿主侧止血消除;本 PR 按你在 #3205 floor 4 的定向(「为什么不默认覆盖区间」→ DEAD ref 当分段间隙、断组后另起新组)修在源头。我逐层核对了所有 span 出口:可操作面只有三条产线—— 代码关(③):逐行读过 recommend.ts / nudge-text.ts / types.ts 改动。关键正确性点我都验证过:
测试有效性关(④):测试有牙,我在 master(未修复基线 effd544)上叠了新测试实测:kernel 5 例中 3 例红(internal split / multiple holes / no-rebridge 正是钉修复的三例;control 与 trailing-dead 双基线绿,符合预期)、bili #3192 例红。修复头本地定向跑:kernel 全套件 1302 pass / 0 fail(PR 正文说的 167 是子集数)、bili 四个 deadRefs 相关文件 27 pass / 0 fail。展示层(formatRanges 不重桥)虽无独立 kernel 单测,但被 bili 回执端到端测试钉住(回执文本走 formatRanges,若重桥会解析出罩洞 span 而断言失败)。 回归关(②):逐项清点既有行为——covered/pruned/carrier/unrecoverable-media 四类既有 gap 判据未动;merge/format 两条合并路径对无 flag 输入行为不变(1302 例含既有 recommend/merge/nudge/formatRanges/consistency 矩阵全绿);types.ts 纯加性可选字段;golden wire-contract 无需变更(config/prompt/tool schema 零触碰,CI golden 门绿);持久化格式不动;bili 根 package.json 版本未碰。 diff 整洁度(⑤):6 文件全部与本 PR 目的相关,无私货、无空行洪水。Kernel Boundary 合规: 我顺手修掉的一个 CI 红(已推独立标注 commit)原 head 结构化八问
残留观察(均非阻塞,留你拍板):① 上述 report.ts 展示面;② 回执错误文案 “no range that includes them can compress now or later” 对「手搓的内部罩洞 span」技术上不准确(这类 span 其实能压成功)——#3205 floor 2 第 6 点已列过,属 owner 决策项,本 PR 范围外。 判定:审核通过,可合(kernel 变更按 Kernel Boundary 由你人工合并;我不代合)。分支当前 head |
77fbc6e to
bf574ce
Compare
|
冲突 ci失败 |
|
冲突 ci失败 |
…ub-spans (#3192 #3205) A client-dropped message leaves NO array slot, so array-adjacency segmentation plus both position-based mergers (mergeRangesToThreshold, formatRanges) each bridge across it and re-emit one span bracketing the recorded-dead ref — the self-contradictory receipt from #3192. Treat the dead ref as a segmentation gap (same level as covered/pruned/carrier): break the group at the hole in buildCompressibleRanges, then tag the following range noMergeBefore so neither merger can re-bridge across it. Supersedes the host whole-span-drop from #3195/#3204 at the source: the surviving sub-spans are now advertised instead of the whole doomed span being dropped. The host excludeDeadRefRanges filter stays as a no-op safety net. Strict no-op when state.deadRefs is empty. kernel package.json 0.0.124 -> 0.0.125; new kernel/tests/dead-ref-split.test.ts; updated tests/compress-recovery-ranges.test.ts #3192 to assert the split sub-spans.
bf574ce to
acdd814
Compare
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.526-master.94e0fe0 # this exact build
npm install -g billion-context@master # always the newest merged build
|
kernel-change: owner-directed root fix for #3192 — treat recorded-dead refs as segmentation gaps so range emitters stop producing spans that bracket a dead ref. The host-side whole-span-drop (#3195/#3204) cannot express the surviving sub-spans because it sees only aggregated{startRef,endRef}spans without per-message token accounting; onlybuildCompressibleRanges(which has per-message stats in hand) can split correctly. Human-only review required.What
Follow-up to the merged host-side fix (#3195) and its sibling surface fix (#3204). Per owner direction, this folds #3205 into #3192 and fixes the bug at the source instead of masking it at the host.
The user-visible self-contradiction (a receipt declaring a ref DEAD while listing a range containing it) is already gone on master via
excludeDeadRefRanges. What remains — and what the owner asked ("为什么不默认覆盖区间?") — is that the host filter drops the entire span bracketing a dead ref, silently withholding the perfectly-live messages on both sides of the dropped message.Mechanism
A client-dropped message leaves no array slot, so its neighbours become array-adjacent. Three independent range layers each bridge across array-contiguous neighbours:
buildCompressibleRangessegmentation (array adjacency),mergeRangesToThreshold(index-gap check),formatRangesdisplay merge (position adjacency).Covered/pruned gaps don't have this problem because a folded message is replaced by a summary node occupying an array slot (a real index gap); a dead hole has no such slot.
Fix: break the group at a recorded-dead hole in
buildCompressibleRanges, then tag the following rangenoMergeBeforeso neither merger re-bridges across it. Same level as the existing covered/pruned/carrier skip criteria. Strict no-op whenstate.deadRefsis empty.Behavior change (old → new)
excludeDeadRefRangesdrops it entirely. In the The compress failure receipt is self-contradictory: the same message first declares the ref permanently DEAD, then lists the range containing that DEAD ref as the "current compressible range." | compress 失败回执自相矛盾:同一条消息先宣告 ref 永久 DEAD,再把含该 DEAD ref 的区间列为「当前可压缩范围」 #3192 shape (m1..m12,m5dropped+dead,m8..m12protected) the only compressible span wasm1–m7→ dropped → nothing advertised → "continue the task without compressing". The livem1–m4andm6–m7were withheld.buildCompressibleRangessplits at the hole →m1–m4+m6–m7advertised and compressible immediately; only the dropped message's own slot is excluded. Recovers the live sub-span content the old path discarded.The host
excludeDeadRefRangesfilter is kept (it is load-bearing for #3204'splugin.ts/prepare-*surfaces) and now acts as a no-op safety net.Tests (both layers green on rebased head)
dead-ref-split.test.ts(new, 5 cases: interior split + flag, non-dead control stays bridged, multiple holes, trailing dead, no-rebridge throughmergeRangesToThreshold) + full recommend/merge/nudge/formatRanges/consistency matrix = 167 pass.compress-recovery-ranges.test.ts#3192(now asserts the two surviving sub-spans, none crossing the dead ref) +issue3204-dead-ref-nudge-panel+ success-tail/acp-status/span-hint/plugin-nudge = 54 pass. Every test file that assignsstate.deadRefsis covered.No config/env/CLI surface added. Kernel
acp-kernel0.0.124 → 0.0.125.