You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Performance][dsh] Mega-sessions pay an ever-growing O(full-history) fold-reconcile tax every turn: expected host churn (one-shot carrier retirement, image/offload retroactive rewrites) misclassified as drift | 大会话每轮付不断增长的 O(全史) fold-reconcile 税:合法宿主变更(o… #5142
functionimageIdentity(ref){returnref.name===void0 ? String(ref.attachmentId) : `${quoted(ref.name)} (${ref.attachmentId})`;}functionnormalizedAccessText(ref,access){return` Normalized copy (read-only; may be resized or re-encoded): ${quoted(access.readonlyPath)} (${ref.width}x${ref.height}px, ${ref.mediaType}). Source dimensions, format, and byte size may differ. Copy to a writable path ending in ${extension(ref.mediaType)} before editing.`;}functionoffloadedImageText(ref,access){constidentity=`image omitted to fit request image limits; ${imageIdentity(ref)}.`;if(access===void0)return`[${identity} No local normalized image path is available; ask the user to attach it again if needed.]`;return`[${identity}${normalizedAccessText(ref,access)}]`;}
即模型实际收到的占位文本形如:
[image omitted to fit request image limits; "_final_spawn.png" (sha256:2e896b95…). Normalized copy (read-only; may be resized or re-encoded): "C:\…\normalized\_final_spawn.png" (1600x900px, image/png). Source dimensions, format, and byte size may differ. Copy to a writable path ending in .png before editing.]
另有两个同族模板可用于白名单登记:
// text-only 车道的变体`[image omitted because this model accepts text only; attachment sha256:${String(ref.attachmentId).slice(7,15)}]`// 未被 offload 的常规图片 handle 行(requestImageHandleText,含只读路径)
对 C1/C3 登记的建议
offload 占位有稳定前缀[image omitted to fit request image limits;(及 text-only 变体前缀 [image omitted because this model accepts text only;),适合做确定性识别;
Activity
[-][Performance][dsh] Mega-sessions pay an ever-growing O(full-history) fold-reconcile tax every turn: expected host churn (one-shot carrier retirement, image/offload retroactive rewrites) misclassified as drift | 大会话每轮付不断增长的 O(全史) fold-reconcile 税:合法宿主变更(one-shot carrier 退役、image/offload 追溯改写)被误判为 drift[/-][+][Performance][dsh] Mega-sessions pay an ever-growing O(full-history) fold-reconcile tax every turn: expected host churn (one-shot carrier retirement, image/offload retroactive rewrites) misclassified as drift | 大会话每轮付不断增长的 O(全史) fold-reconcile 税:合法宿主变更(o…[/+]ranxianglei commentedon Oct 29, 2026
(ai: vllm-qwen/qwen3.8-27b)
查重:不重复。 独立复核了 OP 的查重结论——按失败签名(one-shot carrier / ptc-mode / time-context / reconcile per-turn cost / image offload rewrite)在 open+closed issue 和 PR 里再搜一遍,无命中;相邻项与 OP 列的一致(#4388 judge 侧误报是不同组件、#3588/#3641 已关且方向在 D 车道、#2938 未实施、#1921/#1924 是实现本体+欠账 perf pin、#4788 性能总账未单列 reconcile 腿)。另核了一个前置事实:上一轮接手本票的会话只留了接单/运行中两条系统评论,没有分支、没有 PR(远端无 5142 分支),本票从零开工。
标签:bug / dsh / scope/kernel / p2(机制在 fold-reconcile 判决层,证据全部来自 dsh 车道,能用但逐日变慢、非停摆非泄露——沿用立项时标签,无需改动)。
审核结论(动手前三步)
planReconciliation(src/fold-reconcile.ts:812)只在missing.length === 0时早退保持近零稳态;缺失集合由「覆盖过的 id 不再出现在重发历史」构成,而载体退役(用后即退)和 offload 追溯改写都让 id 永久离开重发历史 → 每轮必跑完整多通道对齐(positional/toolCallId/twin/simhash/order-bracket/normalized/turn-key/image-variant/shape-census + [Bug][Prime/Responses] provider switch rewrites composite tool IDs and reintroduces compressed history #2396 嫌疑通道),工作量随会话年龄单调增长。local=1.8s→25s 就是这个斜率。判决面分类器确实没有「预期退役/预期改写」证据类别:truncationExplained只认端部截断+wireContinuity,offload 的部分残差落进 unmatched/truncation 桶,日志措辞「mutation … or client-side deletion」把排障引向外部插件/数据丢失([Bug][Codex] Temporary separator selected as compression endpoint, causing acp_status to silently fail to report ~180K t | [Bug][Codex] 临时分隔符被选作压缩端点,导致 acp_status 静默漏报约 18 万 token 可压缩历史 #5139 实际就被引偏了)。一个证据缺口(不阻塞开工,但需要补料):仓库内只有 time-context("Time sampled while preparing turn…",src/server.ts:4170)和 runtime-context("Current runtime context…",src/durable-message-guards.ts #2481)两个载体的 wire 文本样本;ptc-mode ×540、tool-jobs ×39 和 offload 的文件引用格式没有任何 wire 文本证据(source.kind 到不了代理线,CoreMessage 不带 metadata——durable-message-guards.ts 头部注释钉死了这一点,只能靠稳定文本标记识别)。v1 覆盖有证据的形状 + offload 走结构化通道(同位置 image 字节→非 image 短文本、计数不变,不依赖具体引用格式);@CelestNya 方便的话请贴这三类消息各一条原文(或 dsh 源码位置),到了之后往同一张登记表加行即可(同一 issue 同一机制,不开新票)。
行为变更预告(Deliverables 第 4 条):被识别为预期退役/改写的 covered id 从 drift 记账中移出——旧行为 = 每轮 drift warn/escalation 候选 + O(全史) 对齐;新行为 = 一次性 info 行说明「N 个 id 按预期宿主行为退役(K 载体 / M offload)」+ 近零稳态。真截断/真编辑/真替换的报警路径不变(双向测试钉住,#3617 纪律)。
开工:实现 + 合成 harness 验收形状(OP 建议的三条断言)→ 定向测试 → PR。进展在本线程跟进。
ranxianglei commentedon Oct 29, 2026
(ai: vllm-qwen/qwen3.8-27b)
方向 A 已实现并开 PR:**https://github.com/ranxianglei/billion-context/pull/5150**(Closes #5142)。perf pin(#1921 欠账)同 PR 交付。CI 全量判定以远程为准,本地定向验证全绿。
八问
missing.length===0早退重新可达,稳态回近零;账本级沿用 turn-separator 豁免先例过滤已记账 id,合法缺席不再拖僵尸 drift streak。判决面改为每 episode 一条 info 行点名数量与类别。证据缺口跟进:ptc-mode ×540 / tool-jobs ×39 / offload 具体格式的 wire 样本仍在等 @CelestNya 补充(floor 1 已请求)。v1 不受阻:offload 通道是结构性的、不依赖格式标记;拿到样本后按同一 registry 机制加条目即可(同一 issue、同一机制,不开新单)。
标签: bug/dsh/p2/scope/kernel(首条回复已打齐,本轮判定无变化)。
收工判定:开发完成,PR #5150 待远程 CI 全绿后人工合并;agent 不合并、不关单。
fix(#5142): account expected host rebases out of fold-drift
test(#5142): pin bounded per-turn reconcile cost under carrier retire…
CelestNya commentedon Oct 29, 2026
补充 #5142 立项时请求的三类 wire 样本(来源:dsh desktop 客户端,会话存档
session.v4.jsonl.zstd+ 客户端 app.asar 内置代码)。1. ptc-mode 载体(×550)
注意:所有 550 条 ptc-mode 的 content 形状完全一致,都是
(text, image)双块——它是「粘贴到上下文」功能的载体,每条都带一张内联图片,因此同时也是 image/offload 的潜在目标(本案中 seq 369 的 offload 目标就是一条 ptc-mode 消息)。journal 原文(
user/message事件,source.kind=ptc-mode):{ "type": "user/message", "seq": 369, "time": 1793060193865, "data": { "content": [ { "type": "text", "text": "<path>D:\\Projects\\VRChat\\preview\\_final_spawn.png</path>\n<type>image</type>\n<content>\nimage/png image, 1600x900 px, 1722627 bytes\n</content>" }, { "type": "image", "attachment": { "attachmentId": "sha256:2e896b95dec003df321788c6935fd3c2befec47c7e5cf05405711a441c1ab805", "mediaType": "image/png", "bytes": 1722627, "width": 1600, "height": 900, "name": "_final_spawn.png" } } ], "source": { "kind": "ptc-mode" }, "role": "user", "id": "625e30d0-7142-4c3b-aa8b-574e1f6ff0ce" } }稳定文本标记:text 块的
<path>…</path>\n<type>image</type>\n<content>\n…px, … bytes\n</content>模板(dsh 粘贴图片时生成)。2. tool-jobs 载体(×39,kind=
tool-jobs+form: "notice"){ "content": [ { "type": "text", "text": "background job bash-bbc9e99445404c85 (bash: \"D:/Program/Unity/2022.3.22f1g/Editor/Unity.exe\" -batchmode -quit -nographics -logFile \"C:/Users/CelestNya/AppData/Local/Temp/unity_lic_test.log\" -projectPath \"C:/Users/CelestNya/AppData/Local/Temp/unity_lic_test\" ; echo \"EXIT=$?\") finished [status: completed, exit code: 0]. Read its output with job_output." } ], "source": { "kind": "tool-jobs", "form": "notice", "summary": "bash \"D:/Program/Unity/2022.3.22f1g/Editor/Unity.exe\" -batchmode -quit -nographics -logFile \"C:/Users/CelestNya/AppData…" }, "role": "user", "id": "b0a6c9aa-87a3-473b-8a7c-8e0900ed97dd" }稳定文本标记:
background job <job-id> (...) finished [status: ..., exit code: N]. Read its output with job_output.3. image/offload 追溯改写的 wire 格式
关键事实:journal 里被 offload 的消息保留原始字节不变(seq 369 至今仍带完整内联图片附件)——改写发生在每次构建请求时,由 adapter 层投影完成。这就是 hash 失配的机制面。
执行器插件:
@deepseek-ai/dsh-compaction-image-offload(本机版本 0.2.1-rc.3)。它只做两件事:收到IMAGE_OFFLOAD_REQUIRED失败时给最老的 N 个未 offload 图片块打offloaded: true标记(append 一条image/offload事件,targets: [{seq, imageIndexes}],目标限user/message/tool/result);重试。占位文本模板在@deepseek-ai/dsh-llm的offloadedImageText,函数体逐字如下:即模型实际收到的占位文本形如:
另有两个同族模板可用于白名单登记:
对 C1/C3 登记的建议
[image omitted to fit request image limits;(及 text-only 变体前缀[image omitted because this model accepts text only;),适合做确定性识别;<path>…<type>image</type><content>模板 + content 必含 image 块的双重特征;background job前缀 +. Read its output with job_output.后缀。test(#5142): pin channel-3 slot-pairing hard gates with negative cases
fix(#5142): report post-accounting numbers in fold-drift verdicts and…
fix(#5142): register ptc-mode and tool-job one-shot carriers from rep…
ranxianglei commentedon Oct 29, 2026
(ai: vllm-qwen/qwen3.8-27b)
@CelestNya 样例收到,正好补上首条回复里缺的三块证据,已全部落进 PR #5150(新提交
d90368c80):<path>/<type>image</type>/<content>模板,×550):注册为 dsh 车道的确定性一次性载体分类器(C1 首见通道),记账原因oneshot/ptc-image。识别用模板里最独特的<type>image</type>标记——单标记、无模糊匹配,与 KDD release v0.1.2 #9 的证据白名单纪律一致;即使未来出现"持续存在"的同形消息,它不会消失、也就永远不会进缺失集合,对记账零影响。oneshot/tool-job-notice,前缀识别(大小写不敏感,与其他自动注入家族一致)。offloadedImageText输出形状):新增保真测试 T2c,把生产占位串原样(路径已脱敏)驱动过结构化的槽位配对通道验证可认领。通道本身保持无标记、纯结构判定(同位置+其余不变+新侧为纯文本),不依赖占位文本前缀——跨车道通用,且插件版本演进改文案时结构门比文本前缀耐用。两点说明:
perf pin(T1)现在每轮在三个一次性家族间轮换注入,覆盖全部 C1 通道。定向测试 128/128 绿(含全部回归套件),CI 在跑,等人工合并。
ranxianglei commentedon Oct 29, 2026
(ai: vllm-qwen/qwen3.8-27b)
来源: #5139 分析「I2 violation 后 0 字节静默挂起」时发现 —— 补一条成本后果与一个待分类症状(不另立项,同失败域):
#5139 用户今晚的后续现场(v0.1.208,同机器):三个 mega 会话出现持久 fold damage(341–1045 covered ids missing、no anchor match → mutation verdict)后,每个 turn 的确定性同步成本已进入分钟级——一次 turn
local=4991ms转交后,上游(ccproxy)完整应答并计费(input 193222 tok / output 244 tok),但客户端 0 字节收到、连接被持有到 dsh 344s 超时放弃;dsh 原样重试同一 turn → 再次同样结局。每次重试全额重付 ~193k input tokens,零进展——本 issue 跟踪的 O(全史) reconcile 税是这条「token 燃烧重试环」的生产源之一(另一候选腿 = post-forward 持久化重活,#4788/#4792)。澄清一处误归因(已在 #5139 回复中给出代码证据):
[invariant-judge/main] I2 violation行不是 0 字节挂起的原因——v0.1.208 的 judge 是纯 advisory(src/invariant-judge.ts:255-260"never mutates the body or throws out"),且在请求发出前于 send chokepoint 运行(src/server/relay.ts:724),结构上看不到响应。它是 fold damage 的法医报告,不是闸门。待分类症状(等用户提供窗口日志):14:30:04→14:47:13 窗口内进程是否还有其他日志(keepalive/其他会话请求)?全进程静默 = wedge(既有域,#4784 兜底);有其他流量 = per-stream 停滞,属新 bug,届时再定归属。选项 A/B/C 不受影响——无论哪条腿是主犯,「每轮重活封顶」都是共同解。
10 remaining items
fix(#5142): keep channel-2 negative results out of persisted state
fix(#5142): allow the mode-dependent rebase memos in cross-mode state…
fix(#5142): complete the #5109 overlap resolution — time-context join…
Merge pull request #5150 from ranxianglei/2026-10-29_5142-fold-drift-…
fix: classify the dsh request-image handle as a one-shot carrier (ran…
fix: classify the dsh request-image handle as a one-shot carrier (ran…
Merge pull request #5752 from suyeku1/2026-11-05_image-handle-carrier
Merge upstream/master (be611a8): adopt dsh injection-slot exclusion, …
Merge upstream/master (be611a8): adopt dsh injection-slot exclusion, …
fix(#5458): account folded plan-mode notice retirement as expected re…
Merge origin/master into PR #4928 head — resolve fold-reconcile clean…
fix: dsh lane — protect instruction-file revision notices from folds (#…
fix: key the #4920 fold-drift record on realUnmatched, not plan.unmat…
fix(#5458): account folded plan-mode notice retirement as expected re…