Repository navigation
[PR] kernel: preserve lifetime ref floor against dead-ref reuse (#5485) - #6904
ranxianglei wants to merge 3 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.11017-pr.6904.2a29ddcThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr6904.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) lock-sync already fixed by an earlier wake — no further work needed. Verified against live sources this run (not from memory / earlier comments):
Nothing to push — the fix is already committed and the check is green. Stopping without further work. 八问:
|
(ai: vllm-qwen/qwen3.8-27b) 查重: 同家族但机制不同。 本 PR 是 #5233 (qiangu2020) 的 kernel core cherry-pick,修 #5485 (ref floor against dead-ref reuse)。与在途 #5235 (#5196 slot-retirement / superseded quarantine) 同属 ref-identity 家族:症状对比——都是 ref 号被错误复用/归属;机制对比——#5196 是 slot 退役 + superseded 隔离(host 侧),本 PR 是 allocator floor + tombstone(kernel 侧)。不重复,各自独立。无其他 PR 针对 #5485。 Review:修复正确,但 PR 不完整——我已补一个 host grounding 测试 re-pin commit ( 代码审查(kernel core 逐行读):
发现并修复的回归(PR 不完整): CI 两 lane 红(ubuntu-24-shard2、windows-22-shard1),同一测试 lock-sync: 作者已自修( CI: 刚推 grounding fix,CI re-run 中(30 checks);绿后我给最终判定。 结构化八问:
判定:修复正确,PR 已补全(grounding re-pin)。等 CI 绿后建议合入。kernel change = human-only review,不 auto-merge。 |
(ai: vllm-qwen/qwen3.8-27b) CI 已全绿。 head 最终判定:可合入。
kernel change = human-only review,不 auto-merge。请 owner 合入:#6904 |
Cherry-picked from #5233 (qiangu2020) kernel core, rebased onto current master. The deadRefs tombstone infrastructure already landed via #5360; this adds the missing ref floor: - highestIssuedIndex: byRef orphans whose byRaw owner is gone still count - assignRefs: cursor clamped to max(requested, historicalHighWater+1) - ledger stamp accepted only above the floor and outside tombstones - allocateFreeRef skips tombstoned indices - both restamp paths seed nextIndex from the unified floor Prevents lifetime ref reuse after pruning (the #5485 defect). Cherry-picked-from: 3e137c4 (qiangu2020/2026-10-30_ref-safety)
The #5485 ref floor clamps the assignRefs cursor above the highest issued ref (a pruned number is never reissued), so a gap below the highest issued is skipped rather than claimed. The grounding test pinned the pre-floor behavior (gap below cursor is the first free slot); re-pin it to the floor behavior (m00006 / nextIndex 7). This is the host-side consequence of the kernel floor; it does not change the kernel.
Rebase onto master (kernel 0.0.200) resolved the kernel version to 0.0.201; the two lockfile-sync commits were skipped by the rebase as previously applied, so regenerate both lockfiles to match: kernel/package-lock.json 0.0.200 -> 0.0.201, root package-lock.json kernel ref 0.0.200 -> 0.0.201 (root stays 0.1.216).
98bd22a to
0fb805e
Compare
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved and pushed. The PR was What I did this run:
Verified locally before pushing:
The PR is now 八问
判定:冲突已解决并推送,本地验证全绿;等新 head 的 CI 跑完确认即可合并(合并仍由人工执行)。 |
Root-cause fix: identity-msgid — kernel ref floor against dead-ref reuse
Fixes #5485
What this fixes
The
identity-msgidroot-cause batch (aggregation #6893) aggregates two issues:The fix — kernel core of #5233, rebased onto current master
The
deadRefstombstone infrastructure already landed via #5360. This adds the missing ref floor so a pruned number is never reissued:highestIssuedIndex— a byRef orphan whose byRaw owner is gone still counts toward the floorassignRefs— cursor clamped tomax(requested, historicalHighWater + 1); a ledger stamp is accepted only when it lands above the floor and outside the tombstonesallocateFreeRef— skips tombstoned indicesrestampRefsToLedgersettlement paths seednextIndexfrom the unified floorCherry-picked from #5233 (qiangu2020) kernel core with authorship preserved. The host-layer hardening in #5233 (cold-load restamp retirement + async load fence) is a separate concern and is deliberately not included here — it stays in #5233 for its own review.
The ref floor clamps the
assignRefscursor above the highest issued ref, which changes how a caller-suppliednextIndexbelow the historical high-water mark is handled:nextIndexand claims the first free slot below it (a gap below the cursor is claimable).historicalHighWater + 1; the gap below the mark is skipped, not claimed.byRefwould be reissued).tests/cache-theorem.test.ts[grounding:g1]re-pinned to the floor behavior (m00006 / nextIndex 7 instead of m00004 / nextIndex 5). This is the host-side consequence of the kernel floor; it does not change the kernel.In practice the cursor is always
highestUsedIndex + 1(never below the mark), so this only affects the artificial low-cursor state the floor is designed to guard.kernel-change: ref floor against dead-ref reuse (#5485)
The host side cannot solve this: the ref floor is an invariant of the kernel's ref allocator (
assignRefs/restampRefsToLedger), which the host only calls. The defect is a design gap in the kernel — the allocator trustedhighestUsedIndexalone, ignoring byRef orphans and tombstones — not a host-side workaround. Dedicated approval issue: #5485.Verification