Skip to content

[PR] feat(compress): compress-at-fold-point default on after real-model verification - #5483

Closed
ranxianglei wants to merge 4 commits into
masterfrom
2026-11-02_compress-foldpoint-default-on
Closed

ranxianglei wants to merge 4 commits into
masterfrom
2026-11-02_compress-foldpoint-default-on

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

#5471 已合并(opt-in 生效)。真实模型验证(含 01a195ec lane 全链路审计)与 owner 本地试用均通过,本 PR 把开关 A(compressAtFoldPoint)转正为默认开;开关 B(clearThinking)保持默认关。

改了什么

  • resolveCompressAtFoldPoint 兜底 false→true:env/文件都没配置时 = 开(重放视图里的 compress 调用对固定挪到它自己的折叠点,布局 [已折叠区]–[调用对]–[保护消息])。
  • 文档面同步:LIFECYCLE.md 行、website/config-reference/compress.yaml default "true"、CONFIGURATION.md / CONFIGURATION.zh-CN.md、website bundle(gen-config-docs 产物逐字节一致)。
  • 测试语义翻转:默认开断言 + resolveRequestConfig 门控(env=off 必须在零 compress 配置的 lane 上也能关掉默认;两项都为假时短路保持字节级不变)。
  • 无 kernel 改动。

回滚

  • env:BILI_COMPRESS_AT_FOLD_POINT=off,或配置文件 "compressAtFoldPoint": false → 回到旧版尾部布局,字节级一致。

验证

CI 修复(6ad3f0b)

默认开翻转后全量套件红了 14 个测试,全部是"字节稳定型"断言撞上新的合法重排,分三类处理:

  1. storage-render goldens + storage-engine 重启 parity(共享 tests/golden/storage-render/*.json):用 scripts/update-storage-render-goldens.ts 重新生成——golden 钉的是"实际发出去的字节",默认开就是新出厂布局;新 stateDigest 与翻转后的管线逐位一致。属该文件头声明的"deliberate render contract change"regen。
  2. e2e-compress-cascade 零配置断言:契约更新——零配置 lane 现在拿到 stamped 配置(compressAtFoldPoint:true+clearThinking:false),不再 identity base;断言精确到"base 加且仅加这两个键"。
  3. cache-proof / cache-seam-probes / fold-round2-shape:这些证明器逐元素对比相邻请求、尚未把 carrier 挪位登记为期望差异 → 固定 BILI_COMPRESS_AT_FOLD_POINT=off 继续证明保守布局的字节稳定性;新默认的确定性已由 kernel relocate 测试覆盖,专门的 default-on 字节稳定证明列为 follow-up(不削弱现有证明)。

另有 host compaction(anthropic) decimation 用例在本机 master 上也失败、CI 四个 wire 全过 = 本地环境特有,不在本 PR 范围。

编号说明

#5470 = issue 号,#5471 = 已合并的实现 PR 号;commit/正文里两处都出现是正常的,非笔误。(评审 bot 提醒项。)

Follow-up(不进本 PR)

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-11-02_compress-foldpoint-default-on (3a20ebd)

Latest build — install this exact version

npm install -g billion-context@0.0.7901-pr.5483.80601ee

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
3a20ebd billion-context@0.0.7901-pr.5483.80601ee build
6ad3f0b billion-context@0.0.7818-pr.5483.82740b4 build
2369ee6 billion-context@0.0.7788-pr.5483.65273d5 build
66bf4f9 billion-context@0.0.7771-pr.5483.b2d23fc build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5483.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title feat(compress): compress-at-fold-point default on after real-model verification [PR] feat(compress): compress-at-fold-point default on after real-model verification Nov 1, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

review

…e with the new default-on

Review follow-up on the default-on flip: the interactive web panel and two comments still described the pre-flip default-off behavior.

- web panel toggle (client.ts cafRow): mirror the message-ts default-on row — checked-by-default when unset; uncheck writes an EXPLICIT false instead of deleting the field (deleting would silently resolve back to on, so the panel could no longer disable the feature).
- web help text (i18n zh/en): default off -> default on.
- plugin-render.ts: refresh the KNOWN-ASYMMETRY note whose ships-off-by-default justification no longer holds; the divergence now bites mainly on a per-tier opt-OFF.

Config-panel representation only; no change to the compression pipeline.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复 —— 本 PR 是已合并的 #5471(compress-at-fold-point opt-in)的「转正」延续,不是重复造轮子。我通读了 diff 与 compressAtFoldPoint 的全部消费点(src/knobs.ts、src/compress-settings.ts、src/server/relay.ts、src/plugin-render.ts、kernel/src/compress.ts、web 面板),没有第二个 PR/commit 在动同一个开关。

做了什么:独立审了这个默认翻转(方向/回归/代码/测试/diff 整洁度),并在 PR 分支就地修掉 3 处翻转后遗留的 UI/文案不一致,已推送 commit 2369ee6c6(远端分支 2026-11-02_compress-foldpoint-default-on 已更新到该 sha)。本地无依赖环境,未跑全量;靠通读全部消费路径 + 对照仓内既有模式核验,CI 会在推送头上跑 typecheck/build/全量套件把关。

核心翻转本身:正确 ✅

  • 单点兜底 resolveCompressAtFoldPoint fallback false→true(src/knobs.ts),env > 文件 > 默认 分层不变。
  • resolveRequestConfig 的「零配置短路」同步修正(src/compress-settings.ts:439):现在要求两个 fold-point 旋钮都解析为假才短路。效果自洽——零配置时映射会跑并 stamp true;BILI_COMPRESS_AT_FOLD_POINT=off 显式关时仍返回 base(字节级旧布局)。两条路都对。
  • 两种压缩模式一致:proxy 走 relay loop(loopConfig.compressAtFoldPoint)、稳态轮走 kernel node(if (!cfg.compressAtFoldPoint) return io),都由 host 侧 applyCompressSettings stamp 具体布尔 → 默认值确实住在 host,kernel 无需改动,「无 kernel 改动」成立。
  • 文档面齐:CONFIGURATION.md(zh/en)、LIFECYCLE.md、config.yaml seed、website bundle 一致;有 docs-gen CI gate 兜一致性。测试断言语义翻转到位(含「env=off 必须在零 compress 配置的 lane 上也能关掉默认」这条关键负向断言)。

发现的 3 处遗留(已就地修,pushed 2369ee6c6):

  1. web 面板无法关闭该功能(src/web/client.ts cafRow):翻转后它仍沿用「默认关」的行模式——uncheck 是「删字段」,而删字段会落回默认=开;初始态显示未勾选(看着像关)实际是开。等于面板把这开关变成「只能开不能关」。已改成镜像紧邻的 message-ts「默认开」行(uncheck → 写显式 false),现在能正常关。
  2. 帮助文案过时(src/web/i18n.ts zh/en):cfg.q_cafp 仍写「默认关 / default off」→ 已改为「默认开 / default on」。
  3. 注释与事实不符(src/plugin-render.ts KNOWN-ASYMMETRY):原句「the feature ships off by default」翻转后不再成立 → 已更新。

残留(非阻塞,建议排个后续):src/plugin-render.ts 的 S4 快照渲染路径只读 env + 全局 compress 段、不走完整 cascade(#5471 就登记的 v1 已知不对称)。翻转后它在「按 provider/model 层做 per-tier opt-OFF」这种新场景下更容易踩中(稳态轮 off、S4 路径 on)。纯 view-only、窄触发、已有 follow-up 注记,不在本 PR 范围——要不要并进本 PR 或单列,听你。

两点小提醒(可不处理):① commit message 和代码注释引的是 #5470,正文写「#5471 已合并」——大概率 issue/PR 号配对或笔误,不影响功能,提一句核对。② 非标量文件值(如 "compressAtFoldPoint": "yes" 这种字符串)现在落到默认=开(之前=关),属「malformed → 默认」,合理,知会一下。

八问

  1. 是什么:把 compress-at-fold-point(把仍可见的 compress 调用对挪到它自己的折叠点的纯视图变换)从默认关转正为默认开;clearThinking(B)保持默认关。产品决策,不是修 bug。
  2. 什么导致:[PR] relocate compress pair to its fold point | feat(compress): 压缩后把 compress 调用对挪到它自己的折叠点(+可选清未签名思考),两个默认关闭的实验开关 (#5470) #5471 已落地 opt-in,真实模型验证(owner 本机多日 + 01a195ec lane 全链路审计)通过,owner 决定把「没配置」的人也移到同一状态。
  3. 影响范围/严重度:所有未显式配置该开关的会话(proxy + plugin 两模式)。出站重放视图里可见 compress 对从贴尾部挪到折叠点处。非破坏性(纯视图变换、refs/state 不动、每轮确定性重算),有字节级回滚;属体验优化类默认变更,非 p1/p2 缺陷。
  4. 怎么改的:host 侧单点兜底翻转 + 同步修正零配置短路条件 + 文档面全量同步 + 测试断言翻转;kernel 不动(默认值住 host)。
  5. 回归:核心管线无回归(短路逻辑、双模式一致;高危模式逐项过——仅按预期翻一个默认值,无顺带语义漂移 / fail-fast 变化 / 阈值时序漂移)。翻转后新暴露的 3 处 UI/文案不一致已就地修复;S4 per-tier 不对称残留为非阻塞后续。
  6. 缓存:不破坏——每轮确定性重算的视图变换,不动 refs/state,不碰 prefix-cache 头部锚定;回滚字节级还原。
  7. 设计方向:未转向,只是把已存在已验证的视图变换默认位从关拨到开。
  8. 新配置:无新增 key/env;复用既有 BILI_COMPRESS_AT_FOLD_POINT / compress.compressAtFoldPoint,仅缺省值 false→true。想回旧行为:BILI_COMPRESS_AT_FOLD_POINT=off 或文件 "compressAtFoldPoint": false。

判定:可合 —— 核心翻转正确、文档/测试齐、无 kernel 改动;我补的 3 处是表示层对齐(不改压缩管线),已 push 待 CI 绿。当前 mergeable=true、mergeable_state=behind(落后的是无关的 web/blog 提交,无冲突,非阻塞)。等你拍板合并。

…default-on fold-point (#5483)

- cache-proof / cache-seam-probes / fold-round2-shape: pin BILI_COMPRESS_AT_FOLD_POINT=off — these provers compare adjacent bodies element-wise and do not yet declare the carrier move as an expected divergence; they keep proving the conservative layout (its determinism is covered by kernel/tests/relocate-compress.test.ts) until a dedicated default-on byte-stability proof lands (follow-up).
- e2e-compress-cascade: zero-config contract flipped — resolveRequestConfig now stamps compressAtFoldPoint:true/clearThinking:false instead of returning the untouched base; assert exactly base+those two stamps.
- storage-render goldens: regenerated via scripts/update-storage-render-goldens.ts — intentional render-contract change (default-on is the shipped layout), new stateDigests match the post-flip pipeline.
@ranxianglei

Copy link
Copy Markdown
Owner Author

收到,三点确认:

  1. 你推的三处表示层修复(web 关不掉的行模式、i18n「默认开」文案、S4 注释):都合理,已保留在分支上(2369ee6)。
  2. CI 全红的根因与修复(commit 6ad3f0be):不是管线 bug,是默认翻转后 14 个"字节稳定型"测试的契约过期——storage-render goldens 已按 deliberate render-contract change 重新生成(e2e 零配置断言更新为"base + 且仅加两个 stamp 键");cache-proof / cache-seam-probes / fold-round2-shape 逐元素比较器尚未把 carrier 挪位登记为期望差异,暂时固定 BILI_COMPRESS_AT_FOLD_POINT=off 继续证明保守布局,新默认的专门 byte-stability 证明进 follow-up。详见正文新增的「CI 修复」节。另:host compaction(anthropic) 用例本机 master 上也挂、CI 四 wire 全过,属本地环境问题,不在本 PR。
  3. 两点提醒:① [Feature][experimental] After compression, relocate the compress call pair to its own fold point (weak-attention models | [Feature][experimental] After compression, relocate the compress call pair to its own fold point (weak-attention models | [Feature… #5470 是 issue 号、[PR] relocate compress pair to its fold point | feat(compress): 压缩后把 compress 调用对挪到它自己的折叠点(+可选清未签名思考),两个默认关闭的实验开关 (#5470) #5471 是已合并 PR 号,两处引用都对,已在正文加说明;② "yes" 这类非标量落默认开 = 既有 malformed→default 语义,知悉不改。

S4 per-tier 不对称:同意单列 follow-up,不并进本 PR(v1 行为不变、已有注记)。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

三点都收到,谢谢确认。我独立审了你新推的 CI 修复 commit 6ad3f0be(叠在我那笔 2369ee6c 之上,分支头现为 6ad3f0be)。

对 6ad3f0be 的独立判断

  • 三处 off 固定(cache-proof / cache-seam-probes / fold-round2-shape)= 有记录的覆盖顺延,不是遮丑。 注释诚实、指明了新默认的覆盖在哪(storage-render goldens);env 在模块顶层设、node --test 每文件独立进程,无跨文件污染;保守布局的字节稳定性证明仍然有效(顺带钉死了回滚路径)。
    • 但要把残留说透:这三条恰是「prefix-cache 跨折叠轮逐字稳定」的直接证明者,固定到 off 后,新默认(on)下这条核心保证目前没有一条回归测试直接钉住——只靠 storage-render goldens(单帧快照)+ kernel/tests/relocate-compress.test.ts(变换确定性;注意确定性 ≠ 前缀稳定)+ 真实模型多日观察支撑。这是已知、已跟踪的缺口,不是静默缺口(见下方立项)。
  • e2e-compress-cascade 改得好:零配置断言从「返回原 base」翻成「deepEqual(base 去 undefined + 恰好两个 stamp 键)」,是严格断言——resolveRequestConfig 多改/漏改任何字段都会红。新契约钉得准。
  • storage-render goldens 重生成 = 合法且形状正确:非 digest 的结构变化只有各轮 "bytes" 计数按一致增量上涨(20805→20991、29515→29788…),正是「调用对挪到自身折叠点」随折叠累积产生的位移;其余全是 stateDigest/shaCiteNorm 哈希滚动。无新增/删除消息角色、无正文文本改动、无 schema 漂移——没有借重生成掩盖任何意外变更。
  • host compaction(anthropic) 本地挂:同意排除——本机 master 也挂、CI 四 wire 全过,属本地环境问题;按 §7.2 本地全量本就不作数,CI 才权威。不在本 PR。

已立跟进 issue:#5503(你已同意单列,我把两处收尾合并进一个清单管理):

八问

  1. 是什么:把 compress-at-fold-point 从默认关转正为默认开(clearThinking 保持关);本轮追加的是让 CI 与翻转对齐的测试/golden 调和。
  2. 什么导致:opt-in([PR] relocate compress pair to its fold point | feat(compress): 压缩后把 compress 调用对挪到它自己的折叠点(+可选清未签名思考),两个默认关闭的实验开关 (#5470) #5471)经验证转正;CI 全红根因是 14 个字节稳定型测试契约过期(非管线 bug),用「goldens 重生 + 三条比较器暂固定 off + e2e 契约翻转」调和。
  3. 影响范围/严重度:所有未显式配置该开关的会话(proxy+plugin 两模式)。体验优化类默认变更,非 p1/p2 缺陷;有字节级回滚。
  4. 怎么改的:host 侧单点兜底翻转 + 短路条件修正 + 文档面同步 + 测试断言翻转;kernel 不动。CI 修复:goldens 按 deliberate render-contract 重生、三条逐元素比较器固定 off、e2e 严格断言 base+两 stamp。
  5. 回归:核心管线无回归;高危模式逐项过(仅按预期翻一个默认值,无语义漂移/fail-fast 变化/阈值时序漂移)。翻转后暴露的 3 处 UI/文案不一致已在 2369ee6c 修掉;唯一实质残留 = 子项 B 的新默认字节稳定证明缺回归钉,已知情决策、非阻塞、已入 Finish compressAtFoldPoint default-on rollout: S4 per-tier resolution + dedicated byte-stability proof #5503 跟踪。
  6. 缓存:渲染布局变化即特性本身(调用对挪位),回滚字节级还原,goldens 已按新布局钉住;待补的是「跨轮前缀逐字稳定」的回归证明(Finish compressAtFoldPoint default-on rollout: S4 per-tier resolution + dedicated byte-stability proof #5503 子项 B),当前靠真实模型证据支撑。
  7. 设计方向:未转向,只是把已验证视图变换的默认位从关拨到开 + 让测试跟上。
  8. 新配置:无新增 key/env;复用既有 BILI_COMPRESS_AT_FOLD_POINT / compress.compressAtFoldPoint,缺省 false→true。想回旧行为:BILI_COMPRESS_AT_FOLD_POINT=off 或文件 "compressAtFoldPoint": false。

判定:可合 —— 核心翻转正确、文档/测试已调和、无 kernel 改动;我那 3 处表示层修复 + 你这笔 CI 修复都在分支上(头 6ad3f0be)。唯一开放线程是 #5503(非阻塞,不影响本次合并)。mergeable_state=behind 落后的是无关 web/blog 提交,非阻塞。等你拍板合并。

…n + guard the regenerator (#5483)

The 6ad3f0b goldens were regenerated with a bare 'node --import tsx' run,
which resolves XDG state roots to the developer's REAL production tree.
CI runs every suite under tests/preload-test-env.mjs (hermetic mkdtemp
roots), so its persisted-state bytes (nudge/tsStamps/stats/metadata) never
match machine-baked digests — stateDigest 345645bd... vs baked b641a076...,
reproduced byte-exact locally only when the preload chain is attached.

- regenerate all four pins under the full ci.yml PRELOAD_ARGS chain
  (new chat pin == the digest CI itself computed at 6ad3f0b)
- guard scripts/update-storage-render-goldens.ts: refuse to run unless an
  isolated tmpdir root is active, print the canonical command
- point both failure hints at the guarded regenerator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant