Repository navigation
[PR] fix: egress judge render-lane tail-fidelity (snapshot-render I2 false positive) - #4243
Closed
ranxianglei wants to merge 1 commit into
Closed
ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
On a session where snapshot render (BILI_ROLLOUT_SNAPSHOT_RENDER) served the outbound prefix, the invariant judge compared raw inbound bytes against the server-rendered view and false-positived I2 mid-history-rewrite on the intentionally-replaced covered region. Plumb the client-tail join index (clientJoin) out of maybeSnapshotView via session.metadata["snapshotRenderTailStart"] into the judge. When set, I2 validates only entry[renderTailStart..] against the outbound (the rendered prefix is exempt); I2 stays armed on the byte-intact live tail. The legacy inbound-vs-outbound path is unchanged when the field is absent.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.5040-pr.4243.56b7765This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr4243.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
[bot] 🏷 查重: 不重复。本 PR 对应 #4241(出站判官对快照渲染车道误报 I2 的原始 bug 报告),检索 open/closed issue 与 PR 无其他同机制条目;PR 以 标签: 已取分支 |
This was referenced Oct 22, 2026
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
快照渲染(
BILI_ROLLOUT_SNAPSHOT_RENDER,引擎 #3759/#3756)开启的会话上,出站判官(#3944/#3939)误报 I2mid-history-rewrite @0 — inbound[0] ... absent from outbound frozen prefix。判官拿入站原始字节逐位对照出站前缀。渲染车道有意把被折叠块覆盖的入站区域替换成服务端渲染视图(正史行 + 摘要锚),所以「入站[0] 从出站前缀消失」是引擎定义行为,不是重写事故。
根因
judgeInboundOutbound的 I2 冻结前缀模型假设:出站前缀 == 入站前缀(字节稳定)+ 折叠追加 carrier。渲染轮破坏了这个假设:出站布局是[服务端正史行][摘要 carrier][客户端尾部],而入站是[覆盖区][客户端尾部]。覆盖区的入站消息被服务端行替换 → 与出站前缀对不上 → 误报。修法
让判官感知渲染车道的尾部边界,而不是关掉 I2:
maybeSnapshotView(src/server/snapshot-render.ts)在 live 成功路径把客户端尾部起点clientJoin记到session.metadata["snapshotRenderTailStart"];函数入口先无条件清除该键,保证「存在 ⟺ 本轮渲染了 live 视图」——所有 early-return / degrade / shadow 路径都不设它,此时出站就是原始客户端字节,走 legacy。relay.ts判官调用点读取该边界并传入maybeRunInvariantJudge({ renderTailStart })。entry[renderTailStart..](客户端逐字尾部)按序出现在出站里;服务端渲染前缀豁免于冻结前缀规则。I2 对尾部保持武装——尾部真被改 / 丢 / 乱序仍会红。跨轮前缀稳定性归 seamLcp/shadow(出站 vs 上轮出站),职责不重叠、覆盖不丢。行为变更(有意,需披露)
测试
tests/invariant-judge.test.ts新增 6 例:renderTailStart= 绿,直接钉住本 issue 的假阳性);renderTailStart经maybeRunInvariantJudge端到端生效。本地定向验证:judge 32/32、snapshot 相关 5 套 27/27、typecheck、build(dist-import-annotations / dist-external OK)全绿。全量回归交 CI。
Closes #4241