Repository navigation
[PR] kernel: bridge span-safe gaps at the merge gate so mega-turn islands … - #6345
guowenjie1992 wants to merge 3 commits into
Conversation
…survive minCompressRange (production 2026-11-09 no-ranges incident) Production shape (acp host, 2026-11-09 night): a mega-turn with a protected-tool exchange every ~4 rounds + a mid-turn block cut mid-group fragmented the compressible surface into 3-5K-char islands. Every island sat below compress.minCompressRange (5000 chars), mergeRangesToThreshold dropped them all, recommendedRanges=[] reached the host, and the emergency lane fell back to irreversible physical pruning three times in one night — while the host's message-level diagnostic still counted 84-149 'collectible' messages. 28 spine-cut no-range diagnostics same day, other sessions. Two independent killers, both fixed: 1. mergeRangesToThreshold closed its batch at every index gap, so sub-gate islands could never accumulate. It now bridges across gaps buildCompressibleRanges marks span-safe (bridgeableGapBefore): protected-tool exchanges (apply carves them via filterProtectedToolMessages, 'Bug 39') and integrity-withdrawn members (apply withdraws them again, they stay visible — ranxianglei#564 reverse-split semantics). The per-CALL ranxianglei#847 gate sums chars over all ranges in the request, so a bridged span clears the gate each island missed. Hard gaps (blocks, carriers, media, dead refs, unrefed, soft zone — whose interior hits truncate the fold at the first protected message, ranxianglei#3953) still close the batch, and sub-gate remnants still emit nothing. buildCompressibleRanges tracks gap composition (hardGapSinceCompressible) and chains it across withdrawals. 2. Ranges ending adjacent to a mid-group block cut died at screening regardless: the pair-boundary adjustment widened the span across the coverage boundary, dragging the block in as nested/consumed, and the merge-integrity path resolved the unit to fold-nothing (fatal=null, filteredIds=0). projectUnit now clamps the ADJUSTMENT's widened head/tail at the coverage boundary (clampAdjustmentAtCoverage) — safe because covered halves are invisible to the integrity judge (ranxianglei#5531); the requested span itself is never clamped, so refold candidates keep resolving. The clamp reuses the shared index map so the ranxianglei#5337 O(units x n) discipline holds. Observability (the incident was undiagnosable from the host side): screenRecommendedUnits warns (budgeted) for every silent drop class — fatal, empty projection, refold-guard — and the recommend node warns with stage-by-stage numbers when the funnel zeroes with material present. Tests: tests/megaturn-protected-gap-bridging.test.ts pins the incident shape end-to-end (bridge + clamp + full-chain advertise, plus a negative for hard gaps). issue5531 closed-loop updated: the recovery block is found by coverage now that the clamp keeps the seed block active instead of dragging it into a merge. Full suite 1626/1626.
…gaturn gap-bridging source change)
…the version literal made lock-sync drift)
|
All 3 remaining failing
Everything this PR touches is green: all guard jobs, static gates, the kernel suite (1636/1636), and the other 3,705 tests in the affected shards. (3 个失败的 test 作业都是 master 上既有的红,不是本 PR 引入——已在干净的 origin/master 上本地复现同样失败。本 PR 触及的一切全绿。) Happy to adjust anything per the kernel review — thanks! |
(ai: vllm-qwen/qwen3.8-27b) 查重 (dedup): the PR's mechanism (sub-gate islands dying at the merge gate) is the same family as open issue #4356 ("Small fragments below the single-fold minimum never get reclaimed"); the PR does not reference it. No dedicated issue exists for the 2026-11-09 production incident. Thanks for the PR. I have to push back on the "pre-existing on master" claim — the evidence points the other way. All 3 failing shards fail on one test, and that test passes on master.
Why the clamp breaks the #1592 geometry (from a diagnostic dump of the actual wire bodies): In the test, fold 2 requests range
Consequence beyond the test: the consuming machinery is exactly what the clamp disabled, so a subsumed block (fold 1) stays alive indefinitely. In long sessions with repeated refolds, redundant subsumed summaries accumulate — context bloat, and the model sees overlapping summaries. The #1592 invariant (a fold's re-render must match the steady path's shape) is a pinned regression for exactly this class of shape drift; the steady path never emits two stacked subsumed summaries. So the clamp needs to handle both geometries: trim the widening so the incident geometry (range ending adjacent to a mid-group block cut) resolves, while still letting a range that overlaps an existing block consume/merge the subsumed block (preserving master's behavior for that geometry). Other review notes (the rest is in good shape):
Verdict: blocked. Fix #1 (bridging) is sound and isolates clean; fix #2 (clamp) regresses the refold-overlap geometry and must be refined to preserve the consume-on-overlap behavior. 结构化八问
判定:拦下(block)。 桥接(fix #1)成立且隔离干净;clamp(fix #2)在 refold 重叠几何上造成确定性自引入回归,须细化到同时保住"覆盖重叠时消费旧块"的行为后重推。 |
[bot] (ai: vllm-qwen/qwen3.8-27b) Progress report (restarted after a 35-min stall). I was handling this PR's CI red items; here's the current state and where I'm blocked. All checks below are single-shot remote reads (no local full-suite runs, no polling loops — that's what stalled me). What I verified:
The technical problem (the clamp regression) — 八问:
Delivery blocker (🔶 needs your call): the fix is an additive commit to the PR branch, but the head branch is in the contributor's fork and the ranxianglei identity has no push access (collaborator check → HTTP 403) — the same wall as #4902 / #5777 (since 10-27). The technical fix (and its impact/regression profile above) is identical across all options — only the delivery path differs:
Verdict: red items are triaged and root-caused (3 test shards = self-introduced clamp regression, not inherited; kernel-guard/lock-sync = cancelled, not failed). The fix is well-defined but delivery is blocked on fork push permission. I have not pushed anything; the branch is untouched. Awaiting your A/B/C call. |
…survive minCompressRange (production 2026-11-09 no-ranges incident)
Production shape (acp host, 2026-11-09 night): a mega-turn with a protected-tool exchange every ~4 rounds + a mid-turn block cut mid-group fragmented the compressible surface into 3-5K-char islands. Every island sat below compress.minCompressRange (5000 chars), mergeRangesToThreshold dropped them all, recommendedRanges=[] reached the host, and the emergency lane fell back to irreversible physical pruning three times in one night — while the host's message-level diagnostic still counted 84-149 'collectible' messages. 28 spine-cut no-range diagnostics same day, other sessions.
Two independent killers, both fixed:
mergeRangesToThreshold closed its batch at every index gap, so sub-gate islands could never accumulate. It now bridges across gaps buildCompressibleRanges marks span-safe (bridgeableGapBefore): protected-tool exchanges (apply carves them via filterProtectedToolMessages, 'Bug 39') and integrity-withdrawn members (apply withdraws them again, they stay visible — Compression breaks Responses assistant history ordering, causing repeated invalid_assistant_history 400s #564 reverse-split semantics). The per-CALL 出现持续压缩失败,无法自动恢复 #847 gate sums chars over all ranges in the request, so a bridged span clears the gate each island missed. Hard gaps (blocks, carriers, media, dead refs, unrefed, soft zone — whose interior hits truncate the fold at the first protected message, [Bug] compress range straddling the protected latest user message: summary of the reply is anchored BEFORE that user message (causal order inversion) #3953) still close the batch, and sub-gate remnants still emit nothing. buildCompressibleRanges tracks gap composition (hardGapSinceCompressible) and chains it across withdrawals.
Ranges ending adjacent to a mid-group block cut died at screening regardless: the pair-boundary adjustment widened the span across the coverage boundary, dragging the block in as nested/consumed, and the merge-integrity path resolved the unit to fold-nothing (fatal=null, filteredIds=0). projectUnit now clamps the ADJUSTMENT's widened head/tail at the coverage boundary (clampAdjustmentAtCoverage) — safe because covered halves are invisible to the integrity judge (Context compression leak — rose to 350k | 上下文压缩泄露 涨到 35w #5531); the requested span itself is never clamped, so refold candidates keep resolving. The clamp reuses the shared index map so the decision request: O(n²) per-turn recommend screening in acp-kernel starves the event loop on long sessions (#5304) #5337 O(units x n) discipline holds.
Observability (the incident was undiagnosable from the host side): screenRecommendedUnits warns (budgeted) for every silent drop class — fatal, empty projection, refold-guard — and the recommend node warns with stage-by-stage numbers when the funnel zeroes with material present.
Tests: tests/megaturn-protected-gap-bridging.test.ts pins the incident shape end-to-end (bridge + clamp + full-chain advertise, plus a negative for hard gaps). issue5531 closed-loop updated: the recovery block is found by coverage now that the clamp keeps the seed block active instead of dragging it into a merge. Full suite 1626/1626.
kernel-change: bridge span-safe gaps at the merge gate so mega-turn islands survive minCompressRange + clamp merge-integrity adjustment at the coverage boundary; adds regression tests; no config surface change.