Repository navigation
fix: stop advertising DEAD refs as compressible in receipts and acp_status - #3195
Conversation
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3710-pr.3195.91b2482This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3195.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…tatus (#3192) The submit gate records refs as DEAD when the client rewrites/drops their messages and rejects any range citing them, but the eligibility view (buildCompressibleRanges) never reads state.deadRefs — so a failure receipt (and acp_status) could list exactly the doomed span it had just declared "cannot compress now or later", one self-contradictory message. Add excludeDeadRefRanges() and apply it at every host advertising surface that derives from nudge.compressibleRanges: liveCompressionRanges (feeds both the failure-receipt hint and acp_status) and the post-compress tail offer. A range whose [startRef..endRef] brackets a dead ref is dropped; when nothing remains the receipt falls through to the existing "continue the task without compressing" stop instruction instead of a doomed retry span. No-op when state.deadRefs is empty. Regression test reproduces the contradiction (a dropped middle message leaves a positional span that brackets the dead ref) and fails on unfixed code via the behavioral assertion, not an import error.
a7372e1 to
ead8640
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复。本条是 [PR] 审核任务而非新 bug 报告;关联项核对:#3192(源 issue,本 PR 的 Fixes 对象)、#3137/#3141(空视图误判 DEAD——不同症状不同机制,#3192 楼层已有判定)、#2638/#2660(preflight 产线,用户自划分的同类独立产线)。#3192 楼里「本 PR 需以 #3141 合并后的 master 为 base、文件有重叠」的担忧经实测不成立:rebase 到当前 master 零冲突。 审核方式: 独立重做——自己读了 gate/recommend/boundaries 源码判定过滤语义,试 rebase、本地定向验证、拉 CI 日志逐 shard 看了失败用例;未沿用 #3192 楼里作者 agent 的八问结论。 八问
验证证据(我本地跑的,rebase 后的头 ead8640 = 本 PR 提交 + 当前 master b2868ca)
附加发现(已立项,不塞进本 PR)
合并判定代码本身我这边验证通过(rebase 后头全绿 + 红测属实 + 既有行为无回归)。pushed head 的 CI 红已由我 rebase 消除根因(stale base),等 ead8640 上的 CI 转绿即可合;若仍红我再定向排查。无需改代码;建议顺手把 PR 描述第 1 条披露措辞改准(非阻塞)。 |
(ai: vllm-qwen/qwen3.8-27b) CI 结论(rebase 后 head ead8640,parent = 当前 master b2868ca): 判定:PR 相关信号全绿;剩余红灯是 master 级环境问题,与本 PR 无关。
附加动作:这 4 类失败已有跟踪单 #3206(伞)+ #3207(端口冲突机制),修复 PR #3197 在途。按查重规则未另开单,已在 #3206 补充本次排查证据(精确错误签名 EADDRINUSE 127.0.0.1:18787 / "hook attached to the user's daemon" / 0.8s 就绪超时 / 事件循环挂起 + rerun 系统复现 + master 连续红事实),并在 #3207 留了佐证。 最终判定(不变,证据链补全):代码本身无阻塞问题,可合并;合并时机受 master 级 CI 红灯风暴约束——等 #3197 修好红灯后 CI 自然转绿,或 owner 依据上述证据直接合并、环境问题留给 #3206/#3207 继续收敛。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.437-master.afed2aa # this exact build
npm install -g billion-context@master # always the newest merged build
|
…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.
…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.
What
A single compress failure receipt could be self-contradictory: it declared a ref
recorded as DEAD ... no range that includes them can compress now or later, then listedCurrent compressible ranges= the very span containing that dead ref. The model had to burn a round-trip on acp_status to discover the two statements disagreed.Root cause
Two independent computations:
kernel/src/compress.ts) readsstate.deadRefs, rejects any range citing a dead ref, and records the tombstone.buildCompressibleRanges,kernel/src/recommend.ts) never readsstate.deadRefs. Because it segments positionally (a dropped middle message leaves a numeric hole bracketed by one span), a dead ref ends up inside an advertised[startRef..endRef]even though no message backs it.This is a regression from #2800 (the #2778 shared-eligibility refactor): the pre-#2800 hint excluded dead refs; the shared-source rewrite kept only the protected/covered carve-outs.
Fix (host-side)
Add
excludeDeadRefRanges()insrc/acp-status.tsand apply it at every host surface that advertises ranges derived fromnudge.compressibleRanges:liveCompressionRanges()— feeds both the failure-receipt hint and theacp_statusranges section, so the two surfaces stay consistent by construction (Compression failure recovery hints advertise protected or already covered refs as immediately compressible #2778 promise).src/stream.ts, both prepare-time and live-recompute branches).A range whose
[startRef..endRef]brackets a dead ref is dropped. When nothing remains, the receipt falls through to the existingNo eligible message ranges are available now; continue the task without compressing.stop instruction instead of listing a doomed span. No-op whenstate.deadRefsis empty.Behavior change (disclosed)
Old → New: failure receipts /
acp_status/ nudge tail could advertise a range containing a dead ref → they now drop any such range (and emit the stop instruction when that empties the list). This only removes ranges the submit gate would reject anyway; it never adds or reorders live ranges.Scope / gates
kernel/untouched (nokernel-changedeclaration needed). The kernel-level hardening (splitting around a dead ref instead of dropping the whole span) is the more fundamental home but is owner-gated per the Kernel Boundary; filed as a follow-up note rather than bundled here.