Repository navigation
[PR] fix: derived-parent decompress honors toFile and spills oversized restores (#5013) - #5038
ranxianglei wants to merge 1 commit into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.9539-pr.5038.a0d9058This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5038.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 PR 是 #5013「无决策依赖部分」的交付(正文已注明 Part of #5013);#5029/#4992 是发现该缺口的审计线(#5029 标为 #4992 重复)。open/closed 中无其他条目覆盖同一机制(derived-parent 路径漏建尺寸门)。相邻但不同机制:#4080(整块 spill 不置 restoredInline)——本 PR 未触碰该路径行为。 标签:bug / pi / scope/kernel / p3(缺陷修复;派生路径即 pi RLM 子会话车道 #1333;decompress 决策面,与 #5013 口径一致;严重度随父 issue p3)。标签接口当前不可用,未能落库,在此代报。 身份核对:head diff 核对(2 文件:src/decompress-shared.ts +69/-29,新增 tests/issue5013-decompress-derived-gate.test.ts +97;逐行与本 PR 目的相关,无跑题、无空白噪音):
既有行为回归审计(逐项结论):
测试有效性:新测试钉住闸门双向(超 cap→指针回执 + 临时文件内容==全文 + 原文不出现在 wire 文本;低于 cap→保持内联且无指针)+ full 视图 + 显式 toFile 生效 + 祖先 验证:head 上定向跑 8 个 decompress 套件 53/53 通过(与 PR 描述一致),typecheck 干净(均为定向运行,全量判定以 CI 为准)。CI 最新镜像快照(11:29Z):0 failed / 14 passed(kernel-guard、config-surface-guard、lock-sync、pi-subagents-guard 等守卫全绿)/ 11 skipped / 5 pending(test-import-graph、version-guard、lane-guard、docs-sync、plan),主 test 车道尚未入快照——最终判定等 CI 跑完。 八问
判定:可合(待 CI 收尾;当前快照 0 红、守卫全绿)。本 PR 只收 #5013 的无决策部分;预检阈值语义的决策请求(推荐 C+0.9)仍在 #5013 线程等你拍板,未被本 PR 抢跑。 |
[bot] (ai: vllm-qwen/qwen3.8-27b) 进度汇报(进程曾被强制重启一次,现恢复) 审查结论已在上一条给出(可合,待 CI 收尾)。补充 CI 终态与红腿定性进展:
|
[bot] (ai: vllm-qwen/qwen3.8-27b) CI 红腿定性完成:继承性 flake,非本 PR 引入
判定维持不变:可合。 若重跑后同签名在干净 runner 复发,再按在档口径升级——届时问题归属是 #4982 套件自身的 waitUntil 预算与僵尸 socket 处置,与本 PR 无关,另行跟进。 |
[bot] (ai: vllm-qwen/qwen3.8-27b) 进度汇报(进程再次被强制重启,现恢复) rerun-failed-jobs 已完成:
结论与判定不变,签名确认后在此与 #4599 各补一行。 |
[bot] (ai: vllm-qwen/qwen3.8-27b) 结案:红腿定性完成,审查判定维持「可合」
行为变更披露(重申自 PR):derived-parent restore 的 |
[bot] (ai: vllm-qwen/qwen3.8-27b) 最终状态确认(进程重启后补发,工作已全部完成、无待办) 本 PR 审查已结案,结论不变:可合。要点回顾(详见本帖上方各条):
剩余动作仅一项且归 owner:合并 https://github.com/ranxianglei/billion-context/pull/5038(待 w22s1 转绿或 override)。本 agent 侧无进一步动作。 |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard update-branch: merged origin/master (09a5b5b) into this PR branch -> new head 4741cdb (clean merge, no conflicts; master did not touch src/decompress-shared.ts), local typecheck green, pushed fast-forward. PR is now up-to-date with master and conflict-free (mergeable_state behind -> blocked, i.e. awaiting CI); CI is running on 4741cdb. |
|
(ai: vllm-qwen/qwen3.8-27b) Merge-guard update-branch (round 2): master had advanced again (09a5b5b -> 44067a5); re-merged into this branch -> new head 8958c69 (clean merge, no conflicts; master still did not touch src/decompress-shared.ts), local typecheck green, pushed fast-forward. PR is up-to-date with master and conflict-free (mergeable_state behind -> blocked = awaiting CI); CI running on 8958c69. |
(ai: vllm-qwen/qwen3.8-27b) Merge-guard update-branch for #5038 is complete — no further action needed. Two rounds ran because master advanced twice ( |
…tores (#5013) resolveDerivedDecompress was the only decompress route without the size gates its siblings carry (#5013, audited from #5029/#4992): an explicit toFile was silently ignored and an oversized parent block rode the wire unbounded into a near-full child window. - extract autoSpillReceipt (shared spill leg; filenames byte-identical for the existing whole-block and range paths) - wire the derived-parent path through toFilePointer + autoSpillReceipt like its siblings - tests/issue5013-decompress-derived-gate.test.ts pins both gate directions plus the read-only ancestor invariant
e0defe2 to
0e4906e
Compare
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 — 本条是 PR #5038 的指定冲突处理车道(auto-fix lane attempt 1/3),该 PR 无其他在途冲突/修复工作。 本次操作: 把 PR 分支 冲突解法(关键点): 两处冲突同一机制——本 PR 把三条 decompress 恢复路径的 spill 逻辑抽成共享 验证: typecheck 通过;本地跑全部 7 个 decompress 相关测试文件(含本 PR 新增的 八问:
判定: 冲突已解决,分支为最新 master 之上的单一线性 commit,本地 typecheck + 46 个定向测试绿,CI 在新 head 上运行中;CI 转绿后 PR 即可合并(合并仍由人执行)。 |
(ai: vllm-qwen/qwen3.8-27b) 重启后状态:工作已全部完成,无待办 强制重启未影响结果——重启前冲突处理已完成、八问总结已发帖(本帖上一条,11:28Z)。要点:
最新 CI 状态(镜像缓存 11:30Z,新 head 本车道无进一步动作;合并由 owner 执行: #5038 |
[ework] CI fix verified green ✓ |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 收工判定:冲突已解、CI 全绿,PR 可合(合并由 owner 执行) 本次 CI 工程师车道(auto-fix attempt 1/3)处理完毕,无待办: 做了什么
结果(镜像缓存 11:30Z,新 head
八问
判定:可合。 合并动作按系统规则由 owner 执行: #5038 |
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: vllm-qwen/qwen3.8-27b)
APPROVE — clean, well-scoped fix; the last ungated decompress route is now aligned with its siblings.
resolveDerivedDecompress (the read-only #1333 fallback serving parent blocks to derived/child sessions) was the only decompress route without the size gates its siblings carry. The PR extracts the shared spill leg (autoSpillReceipt + INLINE_RESTORE_CHAR_CAP) and wires the derived-parent path through toFilePointer + autoSpillReceipt.
Correctness — traced all three inline restore paths against the refactor:
- Whole-block & range (pure refactor): behavior-identical. Filenames byte-identical (
acp-decompress-<tag>-<uuid>.txt); control flow equivalent (≤10000 → inline, >10000 → spill, write-fail →exportFailureReceipt,toFilechecked first). The twobody.length > 10000sites are now consolidated intoautoSpillReceipt; no stray sites remain. - Derived-parent (the fix): explicit
toFilenow honored (was silently ignored); body >10000 spills to a tracked 0600 temp file (was unbounded inline); ≤10000 stays inline (unchanged). Receipt format matches the siblings exactly. - Read-only ancestor invariant holds: neither
toFilePointernorautoSpillReceipttouches ancestor session state (norestoredInlineflag, no cache write, nomarkDirty) — they only write delivery files, the same as the sibling paths.
Tests — tests/issue5013-decompress-derived-gate.test.ts has teeth: over-cap → pointer receipt with the raw body absent from the wire text and the full body in the spill file; full: true serves the full view; explicit toFile honored on the derived path; under-cap stays inline (no written to: pointer); and the ancestor's block is never flagged restoredInline. Both gate directions + the invariant are pinned.
Regression (existing behaviors the diff touches): whole-block restore → preserved; range restore → preserved; derived-parent restore → intentional change (disclosed old→new in the PR body); read-only ancestor invariant → preserved (test-pinned). No fail-fast→swallow, no threshold/timing/output-format drift beyond the disclosed derived-path change, no cache/retry impact.
Conventions: no kernel/ change, no config-surface change, no new env var, no as any/@ts-ignore; the 10000 magic number is now a named constant (improvement); comments carry issue refs per house style.
CI green on head 0e4906e0b (all test shards + static-gates success via mirror cache).
八问
- 是什么问题:派生父会话的 decompress 回退路径(
resolveDerivedDecompress)是三条恢复路径里唯一没有大小闸门的一条——显式toFile被静默忽略、超大父块(>10000 字符)无界地骑线进接近满的子窗口。 - 什么原因导致的:该路径在 #1333 实现时只做了"读父块 + 内联返回",没有像整块/区间路径那样接
toFilePointer与自动溢出闸门;是覆盖缺口,不是机制错误。 - 影响范围与严重程度:仅影响派生/子会话(pi RLM child)对父块做 decompress 的场景;超大父块会无界内联进子窗口,是 #5029/#4992 审计指出的"decompress 上下文爆炸"症状族之一。属特定条件问题(派生会话 + 超大父块),非全量不可用。
- 怎么修复的:抽出共享溢出腿
autoSpillReceipt(三条路径共用,文件名逐字节一致),把派生路径接进toFilePointer+autoSpillReceipt,与兄弟路径对齐;整块/区间路径为纯重构、行为不变。 - 是否有回归问题:无。整块/区间恢复行为逐项核对保持(文件名、控制流、失败回执均一致);派生路径为有意变更且已在 PR 披露旧值→新值;只读祖先不变量保持(测试钉死
restoredInline永不置位);无 fail-fast 变吞错、无阈值/时序/输出格式漂移、无缓存/重试影响。 - 是否破坏缓存:否。派生路径仍不写祖先缓存、不
markDirty;溢出文件走既有 reaper 有界保留,不引入新的缓存失效。 - 是否改了设计方向:否。只是把一条路径补齐到既有设计(三条恢复路径统一闸门),未改架构/边界/数据流。
- 是否引入了新的配置:否。10000 字符上限由内联魔法数提为具名常量
INLINE_RESTORE_CHAR_CAP,非新配置;窗口相对阈值语义仍待 owner 决策(本 PR 只关无决策依赖的缺口,PR 正文已注明)。
判定:可合(APPROVE)。 单模块、纯 fix、回归测试到位、rebase 后 CI 绿、不触 kernel/配置/线协议。
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review lane done: PR #5038 (fixes #5013) reviewed end-to-end at head What I verified:
No small findings to fix (clean). Verdict posted as a comment review on the PR (GitHub forbids self-approval from the PR's own account) — ready for human merge. One-line report posted to #4599. 八问
判定:可合(APPROVE)。 单模块、纯 fix、回归测试到位、rebase 后 CI 绿、不触 kernel/配置/线协议。 |
What this changes
resolveDerivedDecompress(the read-only #1333 fallback serving parent blocks to derived/child sessions) was the only decompress route without the size gates its siblings carry — confirmed by the v0.1.208 audit in #5029/#4992:toFileargument was silently ignored (always inline);Changes
autoSpillReceipt()as the shared spill leg for all three inline restore paths (whole-block, range, derived-parent); filenames stay byte-identical on the two pre-existing paths (acp-decompress-<tag>-<Date.now()>.txt, 0600, reaper-tracked);toFilePointer()+autoSpillReceipt()like its siblings.Behavior changes (old → new)
toFileTests
New
tests/issue5013-decompress-derived-gate.test.tspins both gate directions:full: trueserves the full view; explicittoFilehonored on the derived path;written to:pointer);restoredInlinenever flagged).Targeted local run: 53/53 across the 8 decompress suites (new file + proxy-decompress-cache / issue2204-to-file-outcome / fix-decompress-tofile / fix-decompress-reaper / decompress-empty-range / decompress-image-ref-dispatch / issue1333-derived-inheritance); typecheck clean. Full-suite verdict = CI on this head.
Part of #5013 (window-relative threshold semantics for the preflight gate still await owner decision — this PR closes only the decision-free gap). Audit thread: #5029 (duplicate of #4992).
Base: current master b0b0e66 (already includes the #5017 ci-fixes convergence).