Repository navigation
[PR] Image ids stop re-minting when an earlier image is folded away (#3751) - #3761
Closed
ranxianglei wants to merge 2 commits into
Closed
ranxianglei wants to merge 2 commits into
ranxianglei wants to merge 2 commits into
Conversation
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4449-pr.3761.1a7fe45This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3761.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
Every image part shared one base id (CANONICAL_IMAGE_TEXT in the seed) and the only discriminator was the ClusterCounter suffix — the Nth occurrence in THIS conversion pass. Fold/rewind/client-compaction of any earlier image shifted every surviving suffix: identity degraded from a function of content to a function of set membership. Each re-mint cost one prefix-cache break on the wire and one fresh wrapper blob + rc=0 orphan in the CAS (#3748: same image recorded 56×, 11.06× redundancy, ~17.8 GiB/day). Seed image cores by an exact payload fingerprint instead — sha256 over the declared media type + base64 bytes — across all four converters (anthropic/openai/responses/google), including the responses non-splittable fold path, so single-part and multi-part shapes of the same image mint the same id. Same pixels → same base id across membership changes; different pixels → different bases. Residual churn is confined to true duplicates of the SAME image inside one pass (cluster suffix still orders them). Unparseable parts (url/file sources, raw-only sidecars) keep the legacy constant seed so those ids never move. The core text field stays "[image]" — only the seed changed. Bump acp-kernel 0.0.134 -> 0.0.135 (kernel-guard rule 2).
ranxianglei
force-pushed
the
2026-10-18_issue3751-media-identity
branch
from
October 19, 2026 02:31
121a5ce to
8c07fab
Compare
Owner
Author
(ai: vllm-qwen/qwen3.8-27b) 审核进展(第一轮):
等 CI 全量结果出来后给八问结论。 |
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.
kernel-change: image core ids in kernel/src/wire/* now seed from a payload fingerprint (sha256 of media type + base64) instead of the shared "[image]" placeholder; bumps acp-kernel 0.0.134 → 0.0.135.
什么坏了(#3751)
同一会话里,只要更早的一张图片被压缩折叠(或客户端 rewind/删除),后面所有存活图片的内部 id 全部重新生成——内容一个字节没变,身份却换了。
原因:所有图片部件的身份种子是同一个常量(
"[image]"),全仓库的图片共享一个 base id,唯一区分符是"本次转换中的第 N 次出现"后缀。前面图片一退出,后面图片的后缀整体位移。每次重铸:该位置 wire 字节变化 → 每次折断一次 prefix-cache;存储层按整条消息 JSON 做内容寻址,id 在 JSON 里 → 重写一个全新 blob、留一个 rc=0 孤儿(这就是 #3748 里同一张图被记录 56 次、11.06× 冗余、约 17.8 GiB/天的上游机制)。修法
身份种子改为载荷指纹:sha256(media type + base64 字节),四个协议转换器(anthropic/openai/responses/google)统一,包括 responses 的单部件折叠路径(与多部件拆分路径铸造同一个 id)。
_N后缀区分(窄得多,需要彻底解决得做媒体级内容寻址存储——已单独立 issue 跟踪);"[image]",只有种子变了——存储 JSON 面除 id 外无任何变化。测试
kernel/tests/issue3751-image-payload-identity.test.ts(5 例):_1后缀区分;h_88b5433245c4751e),升级零迁移;Closes #3751(该 issue 标注的跨会话/跨消息字节级去重已拆分为后续 issue)。