Repository navigation
[PR] kernel: screen drops units that consume a retired block (#8014) - #8022
ranxianglei wants to merge 7 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.13217-pr.8022.483cdc6This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr8022.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) 查重: 发现并行 PR — #8019 (resec, 2026-11-30 06:19Z, 先于本 PR) 修同一个 #8014;本 PR (#8022) 是第二个。两者代码现已等价(见下),需要你拍板合哪个、关哪个。agent 无权关闭 PR。 Reviewed PR #8022 (head now ① Source issue — direction verified independently.
② Regression review — existing behaviors on the touched paths:
③ Code review. The new check mirrors the apply guard's judgment byte-for-byte ( ④ Test validity. Real tests with teeth, both directions (#3617 gate discipline): retired case asserts no spanning unit AND every advertised unit applies cleanly (the #3236 contract itself); control asserts the same stretch stays advertised when unretired AND applies cleanly. Verified: fails on master (reproduces), passes on the branch. Existing issue3236 + issue5765 suites: 14/14 pass locally. ⑤ Diff cleanliness. 5 files, every line on-purpose: fix (+24/-2), new test (+198), version bump, two lockfile syncs (required by the lock-sync job — the first head ⑤b Code cleanliness. Naming mirrors the apply side ( Kernel Boundary: CI (verified live): green on 顺手修 (extra fix, commit The duplicate — your call (both PRs are open, I cannot close either):
标签: 本环境镜像 label 端点未实现(已尝试 API,返回 endpoint not implemented),无法打标;意图标签: 八问:
判定:可合并——修复正确、最小、测试有牙(含移植的退化角落用例),CI 绿,Kernel Boundary 合规。合并权在你(kernel 变更永远 human-gated);并行 PR #8019 的取舍也等你拍板。 |
…ommendation is no longer a guaranteed apply rejection (#8014); kernel 0.0.220 The recommend/nudge screen had no retired judgment: after a block was retired (acp_retire / blockOps.enabled), screenRecommendedUnits kept advertising fold units that span it, while the apply lane refuses any range that would consume a retired block ('their summaries are out of the resident view by explicit user decision'). The top recommendation was therefore a guaranteed rejection on every turn — the #3236 contract ('every advertised range must apply cleanly') violated through its last shape: the screen never looked at retired, while applySingleRange threw on it. Mirror the apply guard (compress.ts retiredConsumed) in the screen: drop a unit whose consumedBlockIds contains a retired block, with a budgeted warnScreenDrop reason. Unconditional (no refold carve): in apply the retired guard fires BEFORE the refold route, and a refold can only target restoredInline blocks — a retired block is not restoredInline — so a legitimate refold never consumes a retired block and this drop cannot break the refold route. Non-spanning units stay advertised. Regression test: every advertised unit applies cleanly with a retired block mid-history, plus a control that the same stretch is still advertised when nothing is retired.
The kernel version bump (0.0.217 -> 0.0.218) propagates to both lockfiles: kernel/package-lock.json (its own version field) and the root package-lock.json (the file:./kernel reference). The lock-sync CI job fails on any drift, so the bump and its lockfile sync ship together.
…t (ported from parallel PR #8019) The parallel #8014 PR's suite carries a fourth case this thread's test lacks: a block that is BOTH retired and restoredInline. A unit spanning it also consumes the restored-inline neighbour, so evaluateRefold classifies it "refold" — the exact shape a refold carve-out in the screen would have kept advertised. Apply's retired guard runs before its refold route, so the unit is a guaranteed rejection and must not be advertised. Ported in intent (adapted to this file's helpers); verified it fails on master and passes on the fix.
083f862 to
d12a138
Compare
(ai: vllm-qwen/qwen3.8-27b) Merge conflict resolved — PR #8022 rebased onto current master, force-pushed. What I did this run:
Note: the PR body's line "kernel 0.0.217 → 0.0.218" is now stale — the actual bump on the rebased head is 0.0.219 → 0.0.220. I did not edit the PR body (lane rule); flagging it here instead. The 八问
判定:冲突已解除并推送(最终 head |
…sion conflict to 0.0.221 Both this PR (#8014) and master (#8153) independently bumped acp-kernel 0.0.219 -> 0.0.220, so the merge auto-resolved the version line to 0.0.220. The merged kernel now carries BOTH the #8014 recommend-screen change and master's #8153 band-nudge/hide-consumed changes, so it needs a fresh version: bumped 0.0.220 -> 0.0.221 in kernel/package.json, kernel/package-lock.json, and the root package-lock.json (acp-kernel file: dep). kernel-guard Rule 2 (src changed requires a version bump vs master) and lock-sync (lockfile matches npm regen) both pass. No code conflicts: master's kernel changes (compress/config/hide-consumed/nudge-text/types) and the PR's recommend.ts + test touch disjoint files. Verified locally: kernel typecheck, #8014 test (3/3), #8153 tests (20/20), root typecheck all green.
…nt with master Master advanced past the previous sync (f09a487) by #8195 (ledger-window-guard) and #8198 (data-dir-channel), both host-only (src/, tests/, scripts/, docs/) — no kernel/ changes, so the acp-kernel version stays at 0.0.221 (PR's bump; master is still 0.0.220). No conflicts: the new master commits and the PR's kernel changes touch disjoint files. This clears the 'behind' state so the PR merges cleanly against the latest master.
ranxianglei
left a comment
There was a problem hiding this comment.
(ai: sglang-gpu0/qwen3.8-27b)
Review: #8022(kernel:recommend 屏掉跨越 retired block 的单元,#8014)—— 机制正确(#3236 单投影纪律的正确落地)、双向+角落钉住,可合(留人,kernel 一律人工)。
独立核对
- 病灶成立:
screenRecommendedUnits对 retired 零判定(base 的 recommend.ts/unit-projection.ts 无retired字面命中),而 apply 侧retiredConsumed守卫会拒任何消费 retired block 的区间 → 退役块存活期间,顶层推荐每回合必然被拒——#3236「每个被宣告的区间必须能干净应用」契约的最后一个漏形。宿主侧修不了(屏与 apply 守卫都在 kernel),在屏上镜像 apply 判定是正解,不是堵。 - 无条件屏掉(无 refold 豁免)的论证我核过:apply 侧 retired 守卫在 refold 路由之前触发;refold 只能打
restoredInline块,retired 块不是 restoredInline → 合法 refold 永不消费 retired 块。第三个测试专门钉了 retired+restoredInline 角落(会被 classify 成 "refold" 的形状)也照屏——豁免论的死角被测试占掉了。 warnScreenDrop有预算(与屏上其他 drop 同一诊断通道),字符串是宿主日志,非模型可见——body 的「无 MODEL-FACING 变化」属实(diff 里唯一新字符串就是这条)。- 无 retired 块的会话字节级不变(新检查找不到任何东西);对照组钉住「active 块的同一跨度仍被宣告」——无过度屏除。
本地实证(worktree @ 2c4d123):
- GREEN:
issue8014-retired-recommend(3)+issue3236-recommend-apply-consistency+issue5765-retire-rewrite合计 17/17 绿。 - RED(
kernel/src/recommend.ts回退到 base 7d29483):1 绿/2 红——红的恰是 retired 主用例与 retired+restoredInline 角落,绿的恰是 active 对照(修前就成立,方向完美)。
合并前两件事
- CI:head
2c4d1236的 check-runs 只有 gate/lane/docs 类 25 个,没有 test 分片——全套判决缺失。base 7d29483 是 master 祖先(之后 master 前进 94 个 commit,未动 recommend.ts),rebase 到当前 master 重跑 CI 拿 test 分片全绿再合。 - 版本堆积:本 PR bump 0.0.220→0.0.221,与 #8017(同 0.0.221)、#8001、#8085、#8223、#7946 撞号;#8018 只 bump 到 0.0.220(=master 现值)。这几个 kernel PR 谁后合谁 kernel-guard 红,需要依次再 bump——建议 owner 排合并顺序(本 PR 与 #8017 互相独立,无先后依赖)。
结论:内容正确、双向+角落钉住;rebase+重跑 CI 全绿后合,留人。
…nt with master Master advanced past the previous sync (7d29483) by a large host-only batch: #8055 (gate-regression-p0, the 824-cell gate matrix + host drivers + gate ledger), #8207 (rescue-kernel-decisions host-side fix + test), #8175 (circuit skipped-proxy hint), and assorted gate/CI/test commits. None touch kernel/ or the dependency manifests — the acp-kernel version stays at 0.0.221 (PR's bump; master is still 0.0.220). No conflicts: the new master commits and the PR's kernel changes touch disjoint files. Clears the 'behind' state.
…sion collision to 0.0.224 Master advanced past the previous sync (922c38e) with a large batch that DID touch kernel/: #8015 (autosplit span), #8016 (default warn sink per-core), #8242 (egress block coords), #8218 (compress prompt pricing), render-refs strategy, sync.ts fresh-fold, responses notifications, plus many host-only PRs. Two kernel version bumps landed on master (0.0.220 -> 0.0.222 -> 0.0.223), colliding with this PR's 0.0.221. kernel/src/recommend.ts auto-merged cleanly (PR's retired-block screening and master's changes touch disjoint regions). Resolved the version collision by bumping the merged kernel to 0.0.224 (above master's 0.0.223), keeping kernel-guard Rule 2 satisfied. Lockfiles regenerated-consistent.
kernel-change: the recommend/nudge screen (kernel/src/recommend.ts) had no retired judgment — after a block was retired it kept advertising fold units that span it, while the apply lane (compress.ts retiredConsumed) refuses any range that would consume a retired block. The top recommendation was a guaranteed rejection on every turn, violating the #3236 contract "every advertised range must apply cleanly". The host side cannot solve this: the screen and the apply guard both live in the kernel, and the fix is to make the screen mirror the apply judgment (the #3236 one-projection discipline).
Closes #8014.
What
After a block is retired (
acp_retire/blockOps.enabled),screenRecommendedUnits(kernel/src/recommend.ts) kept advertising fold units whose span consumes the retired block. The apply lane (applySingleRange, kernel/src/compress.ts) refuses any range that would consume a retired block — "their summaries are out of the resident view by explicit user decision" — so the top recommendation was a guaranteed rejection on EVERY turn. The screen had no retired judgment at all (noretiredreference in recommend.ts / unit-projection.ts), whileapplySingleRangethrew on it: the #3236 contract violated through its last shape.Fix
Mirror the apply guard in the screen:
screenRecommendedUnitsnow drops a unit whoseprojection.consumedBlockIdscontains a retired block, with a budgetedwarnScreenDropreason. Unconditional (no refold carve): in apply the retired guard fires BEFORE the refold route, and a refold can only targetrestoredInlineblocks — a retired block is notrestoredInline— so a legitimate refold never consumes a retired block and this drop cannot break the refold route. Non-spanning units stay advertised.Behavior change
No model-facing text change: the new string is a
warnScreenDrophost-log diagnostic, not model-visible.Tests
kernel 0.0.217 → 0.0.218.