Repository navigation
[PR] fix(boot): drop redundant synchronous corpus decode on pre-listen path (#4515) - #4539
ranxianglei wants to merge 5 commits into
Conversation
…t path At maxSessions==0 (the #2803 default) the bounded boot decoded+parsed a 64MB-decode window of the newest state files synchronously only to pop every candidate - pure waste on the path that gates listen() and, on big stores, a leading contributor to cold starts blowing the native spawn budget (#4515). In unified mode the whole corpus alias/canonical bookkeeping is already covered by seedIndexedAliases (index rows) plus the post-boot background scan, so the sync window is skipped entirely when nothing is warmed. Also add per-phase startup timing (store open vs bounded boot; walk / parseWindow / indexUnion) so a slow cold start names which phase ate the budget instead of dying silently under it. Behavior change (flagged): at maxSessions==0 the returned warm set is identical (empty), but label-resume of an UNRECORDED file (no index row) that previously landed in the sync window now resolves only after the background scan reaches it (sub-second, async) rather than synchronously at boot. Recorded sessions are unaffected (always index-seeded). Warm path (maxSessions>0) and legacy mode are untouched. Regression test pins: nothing decoded synchronously at maxSessions==0, recorded labels resolve from the index, unrecorded labels fill in via the background scan. Negative-controlled (re-enabling the window fails the assertion). References #4515
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.6179-pr.4539.dd8ae30This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4539.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。 本 PR 是 #4515(大 store 冷缓存启动超 60s spawn 预算 → 静默直连)的修复切片 1,与 #4515 线程 floor 2/3 已核实的机制一一对应;无同症状同机制的并行修复条目。检索范围:open+closed issue/PR,按失败签名(bootBounded 同步解码窗口 / pre-listen I/O / SPAWN_BUDGET_MS)。 标签:bug / pi / scope/storage / p1(与 #4515 对齐:p1 = 「出网前必压缩」核心承诺在大 store 冷重启下被静默整段关闭;pi 为复现车道,机制对所有 native 车道通用;scope/storage = persist/session 启动路径)。 开始按 PR Review 规范独立审核本 PR(审原 issue 方向 → 回归清点 → 代码 → 测试有效性 → CI),结论稍后按八问体例回贴。另注意 #4515 floor 5 的新证据(报告者两次失败阻塞在 index.db 打开阶段或更早)——本切片的分阶段计时正是为钉死该卡点,我会在审核结论里评估这一片对报告者实际故障的覆盖度。 |
(ai: vllm-qwen/qwen3.8-27b) 独立审核结论(按结构化八问)。审核对象:head 1. 是什么问题:默认配置( 2. 什么原因导致的:热窗口解析在 3. 影响范围与严重程度:p1 可用性类(压缩能力对宿主整体不可用,直到宿主重启)。触发条件:大会话存储 + 冷启动 + unified 模式。本切片消除的是默认配置下的同步解码;warm 路径与 legacy 模式不受影响。注意:#4515 floor 5 的证据表明报告者的两次真实失败卡在更早的 index.db open/WAL 阶段(60s 内零日志行)——本切片单独不能恢复他的启动,但新增的 4. 怎么修复的:把同步热窗口解析 gate 到 5. 是否有回归问题:无。逐项审过的既有行为:
6. 是否破坏缓存:不涉及。前缀缓存/重试/增量游标均不受影响;boot 期 alias 表只影响 label 解析时机。 7. 是否改了设计方向:本切片不改架构,是明确标注的 no-decision 部分。结构性根修(Decision A:full-mode 只从 index 行枚举会话、legacy walk 降为 degrade-only)与 8. 是否引入了新的配置:本切片无新 env/config/默认值。(Decision B 若通过会带来配置面变更,届时需按 config-surface 纪律单独说明。) 验证证据:
判定:切片 1 代码质量通过(LGTM),负控制有牙、披露完整、CI 绿。按作者声明的计划,合并应等 Decision A/B 在同一 PR 内落地 + rebase 之后。两个待 owner 决策(A/B)我已在此线程外 #4515 有完整上下文,这里不重复选项对比,等你拍板。 |
master window commits 293ae65/de5e03659 bumped kernel/package.json to 0.0.165 without regenerating the lockfiles; lock-sync re-resolution then rewrites the stale recorded versions (root 0.0.163, kernel 0.0.164) and fails. Pure recorded-version sync via npm install --package-lock-only; no dependency or semantic change.
|
方案被后续实现取代:启动路径的重复解码问题已由 C 类整合(#5198)与常驻最小化(D2)覆盖。冗余关闭。 |
(ai: vllm-qwen/qwen3.8-27b) 收到,按此收工。引用已对照 git 核实:C 类整合 = 已合并的 PR #5198( 留一条事实记录(不影响你的决策,只是别让账目失真):当前 master 的 关闭由你执行(规则:agent 不关单)。本 PR 我不再触碰。 |
What
Slice 1 of the #4515 fix (a full-scan of the historical corpus on the pre-listen boot path blows the 60 s native spawn budget → silent direct-connect on big cold stores). This PR ships the no-decision parts; the structural root-fix and config-surface parts are gated on owner decisions (see Remaining) and will land in this same PR before merge.
Changes
maxSessions==0(src/persist.tsbootBounded). At the Bound startup session loading and preserve historical recovery #2803 default (sessionWarmMax()==0) nothing is warmed, yet the old code decoded+parsed a 64 MB-decode window of the newest state files synchronously only to pop every candidate. In unified mode that bookkeeping is already covered byseedIndexedAliases(index rows) plus the post-boot background scan, so the window is skipped entirely when nothing is warmed.src/session.tsinitSessions,src/persist.tsbootBounded). Splits pre-listen cost into store open (index.db open / WAL recovery) vs bounded boot, and within boot into walk / parseWindow / indexUnion. A slow cold start now names which phase ate the budget instead of dying silently under it.lastBootSyncParsedFilesForTest()exposes how many state files the last bounded boot decoded synchronously (already-trackedparsedFiles.size).Behavior change (flagged)
At
maxSessions==0the returned warm set is identical (empty). One nuance: label-resume of an unrecorded file (no index row) that previously landed in the sync window now resolves only after the background scan reaches it (sub-second, async) rather than synchronously at boot. Recorded sessions are unaffected (always index-seeded). Warm path (maxSessions>0) and legacy mode are untouched.Tests
tests/issue4515-boot-no-sync-warm.test.ts: pins nothing-decoded-synchronously atmaxSessions==0, recorded-label resolves from the index, unrecorded-label fills in via the background scan. Negative-controlled (re-enabling the window makes the assertion fail).bounded-storage-scale,bounded-storage,issue3199-overview-cold-scan,issue404-restore-timestamps(+ new). Full-suite verdict = CItestlanes on this head.Remaining (same PR, gated on owner decision)
SPAWN_BUDGET_MSconfigurable (env > config > default 60000) + stage-aware timeout log. New config surface → owner sign-off.References #4515