Repository navigation
[PR] fix: split unattributed cache-miss residual over forensics buckets and tag render-tag provider misses (#4397) - #4446
ranxianglei wants to merge 6 commits into
Conversation
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.10500-pr.4446.8708d6eThis exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr4446.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 查重: 不重复 —— 本 PR 是 #4397 的一个 facet(request 4:让 CACHE INVALIDATION 区分 provider eviction 与 bili 未记账的字节),与其他在途条目无重叠;#2483(render-tag 签名)与 #1847(ledger 措辞钉死)均已关闭,只作本 PR 的背景引用。#4397 其余 facet 留在原线程,本 PR 不关闭它。 标签: bug + scope/ui + p3(理由:本 PR 只改报告文本与观测数据,无用户可见行为变更;归账本统计/展示面) 审核进行中:已拉取分支 |
…the global knob (#4397) Review fix for #4446: both send chokepoints stamped noteForwardedBody's rt flag from the global renderNone knob, but the documented semantics is 'render tags were active on THIS body' — compaction-trigger requests force renderTags 'none' even with the knob off (prepare-responses), so such bodies would have been booked tag-active and inflated the taggedSide subset. Both chokepoints now stamp from the per-request strategy (prepared.renderTags / new LoopCtx.renderTags), falling back to the knob only where a lane carries no strategy (byte-faithful passthroughs) — behavior there is unchanged. Net behavior delta: only prepared trigger-form bodies flip from stamped to untagged; every other lane derives its strategy from the same knob, so old and new stamps agree. Regression: e2e E2 trigger-form test pinned both directions (tag-free body carries no rt flag with the knob off; the old knob stamp fails it). Cache/seam family green locally (236 pass); full-suite verdict comes from CI. Part of #4397
(ai: vllm-qwen/qwen3.8-27b) #4446 审核完成。审核中发现一处真实缺陷并已直接修掉推上分支(fceb2d5),结论按八问如下。 1. 是什么问题:本 PR 是观测面增强(#4397 request 4),不是缺陷修复——把 CACHE INVALIDATION 里不透明的 2. 什么原因导致的:grand-ledger 把 body forensics 的全部结果聚进一个桶,而下方 SEAM 段在样本级早已拆成命名桶(provider-side / TTL / client rewrite / rewind / orphan-sweep / suspect)——信息在手但报表层没对账;且主导残差警告在 forensics 实际怀疑 mid-history break 时仍无条件宣称 "NOT a bili bug"。 3. 影响范围与严重程度:纯宿主观测层(报表文本 + 持久化 agg key)。无出站字节变化、无配置面、kernel 未动;无 forensics booking 的会话输出逐字节不变。观测/体验级(p3)。 4. 怎么修复的:
5. 是否有回归问题:逐项审过——无 forensics booking 会话字节不变 ✓;警告措辞仅在已披露条件切换 ✓;两个新 agg key( 6. 是否破坏缓存:不涉及。不碰前缀缓存/重试/增量游标/去重键,rt 只是稀疏观测元数据。 7. 是否改了设计方向:没有。在既有 seam forensics → grand-ledger 观测链内扩展,无架构转向。 8. 是否引入了新的配置:没有(无新 env/config/CLI; 状态:修复已推 PR 分支(fceb2d5),远程 CI 全量回归运行中,结果出来我跟进;CI 绿即可合并(合并请你操作)。 |
(ai: vllm-qwen/qwen3.8-27b) CI 终判出炉:全绿,可合并。 最终 head
另更正一处归因:诊断期间看到的 dsh-persona-continuity 红属于并行 PR #4438 的 run(那个 PR 把 dsh auto-review 请求改走 stateless side passthrough,persona fork 自然不再发生),与本 PR 无关——本 PR 自己的 run 里 dsh-persona 每次都是 八问增量(相对 floor 5,只列状态有变的):
判定:可合并。 三个 commit(原始 |
ecf564c to
2c27b89
Compare
…the global knob (#4397) Review fix for #4446: both send chokepoints stamped noteForwardedBody's rt flag from the global renderNone knob, but the documented semantics is 'render tags were active on THIS body' — compaction-trigger requests force renderTags 'none' even with the knob off (prepare-responses), so such bodies would have been booked tag-active and inflated the taggedSide subset. Both chokepoints now stamp from the per-request strategy (prepared.renderTags / new LoopCtx.renderTags), falling back to the knob only where a lane carries no strategy (byte-faithful passthroughs) — behavior there is unchanged. Net behavior delta: only prepared trigger-form bodies flip from stamped to untagged; every other lane derives its strategy from the same knob, so old and new stamps agree. Regression: e2e E2 trigger-form test pinned both directions (tag-free body carries no rt flag with the knob off; the old knob stamp fails it). Cache/seam family green locally (236 pass); full-suite verdict comes from CI. Part of #4397
(ai: vllm-qwen/qwen3.8-27b) CI 修复完成 —— 已把 PR 分支 rebase 到最新 master 并推回(head 根因一句话:分支落后 master ~282 个提交(stale base)。CI 挂的两个存储测试早已被 master 上的 #4499/#4506 修过,而分支还带着修复前的旧版本测试——不是本 PR(#4397)代码引入的回归。 结构化八问
透明说明:rebase 基线为当时的 master 判定:修复已推回 PR 分支,CI 已重跑(mergeable=true)。本地验证充分,等远程 CI 全绿即可进入正常 review,无需 owner 额外决策。 |
2c27b89 to
5c49d03
Compare
…the global knob (#4397) Review fix for #4446: both send chokepoints stamped noteForwardedBody's rt flag from the global renderNone knob, but the documented semantics is 'render tags were active on THIS body' — compaction-trigger requests force renderTags 'none' even with the knob off (prepare-responses), so such bodies would have been booked tag-active and inflated the taggedSide subset. Both chokepoints now stamp from the per-request strategy (prepared.renderTags / new LoopCtx.renderTags), falling back to the knob only where a lane carries no strategy (byte-faithful passthroughs) — behavior there is unchanged. Net behavior delta: only prepared trigger-form bodies flip from stamped to untagged; every other lane derives its strategy from the same knob, so old and new stamps agree. Regression: e2e E2 trigger-form test pinned both directions (tag-free body carries no rt flag with the knob off; the old knob stamp fails it). Cache/seam family green locally (236 pass); full-suite verdict comes from CI. Part of #4397
(ai: vllm-qwen/qwen3.8-27b) CI lane — merge-conflict rebase complete (attempt 1/3). PR #4446 was Conflicts resolved (mechanical, union-of-intent):
Local targeted verification:
The 4 stale-base guard failures should re-evaluate on the rebased head (now on top of current master). If any persist after CI, that's a follow-up for a subsequent attempt — none of them are conflict-related. 八问
收工判定:合并冲突已解决,PR 现 |
…d tag render-tag provider misses (#4397) The grand-ledger 'unattributed' residual lumped every body-forensics outcome into one opaque bucket ('upstream TTL/eviction/wire rewrite'), and the dominant-residual warning declared 'NOT a bili bug' even when body forensics actually suspected a mid-history break. CACHE INVALIDATION now reconciles the residual over the seam buckets (provider-side / TTL / client / rewind / orphan-sweep / suspect, with a named remainder for sub-gate samples), and the warning reports the split instead of the blanket wording when suspects are material (>=10% of the residual). Provider-side misses are additionally stamped with whether bili's render tags were active on send (the #2483 stateful-relay signature) via a new sparse rt flag carried from both send chokepoints through the seam slot to the ledger line, counted into a new taggedSide subset and surfaced under the PROVIDER-SIDE MISS section. Pure observation layer: no outbound byte changes, no config surface, kernel untouched. Report-text behavior change: new reconciliation/line entries appear only when the respective buckets are non-empty; the #1847 warning keeps its exact old wording whenever no mid-history suspect is material. Part of #4397
…the global knob (#4397) Review fix for #4446: both send chokepoints stamped noteForwardedBody's rt flag from the global renderNone knob, but the documented semantics is 'render tags were active on THIS body' — compaction-trigger requests force renderTags 'none' even with the knob off (prepare-responses), so such bodies would have been booked tag-active and inflated the taggedSide subset. Both chokepoints now stamp from the per-request strategy (prepared.renderTags / new LoopCtx.renderTags), falling back to the knob only where a lane carries no strategy (byte-faithful passthroughs) — behavior there is unchanged. Net behavior delta: only prepared trigger-form bodies flip from stamped to untagged; every other lane derives its strategy from the same knob, so old and new stamps agree. Regression: e2e E2 trigger-form test pinned both directions (tag-free body carries no rt flag with the knob off; the old knob stamp fails it). Cache/seam family green locally (236 pass); full-suite verdict comes from CI. Part of #4397
) The rt flag added by 59e29cd rides settled ledger lines into persisted session metadata; the committed goldens predate it, so the metadata section digest drifted on every wire (state/blockContents/ stats unchanged). Regenerated via scripts/update-storage-render-goldens.ts; diff is digests-only — the additive rt field is the intentional render contract extension disclosed in the PR body.
…und client bundle (#4397) The '[fold-reconcile] system prompt changed' line measures the client's inbound system/developer bundle (pre-injection, pre-anchor-rewrite) on every lane, but read as if it were the wire system. In #4397 triage this mislabel cost a full analysis round: the observed 11360->11361 flips were attributed to bili's injected compress-protocol block (~11.3K chars) although the measured value does not include it at all — the flips were host-side recompositions of the DSH system bundle co-occurring with each history-drift episode. Log-text-only change; event semantics unchanged; the pinned test regex (/system prompt changed/) still matches.
5c49d03 to
fe3e4e0
Compare
(ai: vllm-qwen/qwen3.8-27b) CI lane — merge-conflict rebase complete (run 2, attempt 1/3). This run was triggered because master moved after run 1's push: it advanced from What I did:
The PR is now Local targeted verification (on the rebased head):
The 4 stale-base guard failures from run 1 ( 八问
收工判定:合并冲突已解决,PR 现 |
[ework] CI fix verified green ✓ |
Review: APPROVE ✅The code is correct and clean. I verified the reconciliation invariant, the render-tags stamping, the warning refinement, and the tests. No kernel/ changes, no config surface, no outbound byte change. What I verified:
One pre-merge item (PR body, not code): The body says "this PR does not close it" (#4397) — the other facets (per-route render control, residual-turn attribution) stay open — but the footer carries Verdict: APPROVE — code is correct, clean, and well-tested; address the one PR-body line above before merge.
8问
判定: 可合(代码正确干净、测试到位;合并前把 PR 正文 footer 的 |
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) Review complete — APPROVE. Full review posted above (verification + 8问 + one pre-merge item). Done & verified:
One pre-merge item (PR body, not code): footer carries |
Resolves one conflict in src/cache-ledger.ts (union of master's top-level recovery field and the PR's seam.taggedSide field). All other files auto-merged clean. Verified: typecheck clean, PR core tests green (issue4397-invalidation-reconciliation 11/11, golden-storage-render 5/5).
(ai: vllm-qwen/qwen3.8-27b) Conflict resolved and pushed. PR #4446 head branch Conflict resolution (one file):
Pre-existing test failure (NOT a merge regression): This failure is PRE-EXISTING: it fails identically on the PR head (fe3e4e0) in an isolated worktree, before the merge. It is the PR's own test (added by commit 03a1dd3). It requires deep understanding of the relay/seam/settle forwarding path — not a small mechanical fix. It needs the PR author's attention. 八问:
收工判定: 冲突已解决并推送,PR 可合并。test 6 是预先存在的失败(非合并回归),需要 PR 作者关注——compact 请求被转发到上游但没有经过 seam chokepoint( |
Part of #4397 — request 4 ("make CACHE INVALIDATION distinguish provider eviction from bytes bili does not account for"). The other facets of #4397 (per-route render control = owner decision; residual-turn attribution = awaiting user raw dumps) stay in the issue thread, so this PR does not close it.
What
The grand-ledger
upstream-ttl-or-client-rewrite (unattributed)line lumped every body-forensics outcome into one opaque bucket — even though the SEAM section beneath it already split those same tokens into named buckets (provider-side miss / TTL expiry / client mid-history rewrite / rewind / orphan sweep / suspected break) at sample level. And the dominant-residual warning declared "NOT a bili bug" even when body forensics actually suspected a mid-history break.Changes (all host observation layer):
N tok unattributedinto the per-bucket bookings (body forensics booked provider-side miss X · client mid-history rewrite Y · ...) plus an explicit remainder for samples below the forensics gate or on lanes without body capture. Buckets are subsets of the residual by construction (named-cause lines never reach detectSeam), so the line always reconciles.noteForwardedBody; sparsertflag rides seam slot -> ledger line). Provider-side misses carrying it count into a newtaggedSidesubset, surfaced under PROVIDER-SIDE MISS as "of which N sample(s) · M tok were sent WITH bili render tags active". This turns the suspected stateful-relay signature into measured data — exactly the [Cache miss] 0% prompt-cache hit on plain conversational turns — 1.27M tok stable-prefix re-bill with no attributable cause (v0.1.204, #1195) #4397 shape (0% hits for 20 turns on byte-stable bodies, recovery after the renderNone flip).Behavior changes (report text only)
suspects > 0 && suspectTokens >= 10% of residual; otherwise byte-identical.taggedSideMisses/taggedSideMissed: legacy ledgers normalize to 0 on load (tested).Tests
tests/issue4397-invalidation-reconciliation.test.ts(6 tests, both directions per Test Blind Spot Retrospective: Reinforcing Negative Assertion Discipline, Tightening Fake Upstream Strictness, Thin Inst | 测试盲区复盘:补反向断言纪律、假上游严格化、薄安装冒烟、形态矩阵与生命周期覆盖 #3617): reconciliation lists all three bucket shapes (provider-side / suspect / client) with correct counts; tag-marker positive + negative; warning refinement positive + negative (old wording pinned); legacy normalization.Fixes #4397
(孤儿认领:标题本已指向 #4397,补上关闭关键字 —— 第三批清理)