Repository navigation
[PR] Infinite Wait Issue in Stress Injection: N-Round Fallback (Side Effect Introduced by Fix #5860) | 压力注入无限等待问题:N轮兜底(修复#5860引入的副作用) - #5882
Conversation
…ounds (backstop) A pressure/emergency nudge waits for a usage-grade meter reading, so a session whose upstream never reports usage was deferred forever — estimate on every round, hold forever, no automatic compression (#728/#553: silent backends and anonymous zero-baseline forks live there). Add nudge.maxEstimateHoldRounds (default 2): the first two consecutive estimate rounds keep the phantom-ghost protection (#5860), after that the pressure band fires on the estimate like legacy. 0 disables the hold; off-switch remain nudge.requireUsageSampleForPressure=false.
…top timing, refresh storage golden - config: new compress.maxEstimateHoldRounds (deep-merge + settings validation) mapping to the kernel backstop bound. - fork/silent-backend e2e: replay 3 rounds for never-reporting lanes so the T1 pressure decision lands on round 3 (hold windows are pinned separately in the kernel test); anonymous forks now use a truly usage-less upstream (the incident regime) while the explicit-identity control still self-heals via measured usage. - storage-render golden: regenerated under the same env CI runs in (CI regenerates from a fresh clone of this exact checkout with zero env vars; local pre-commit env drift — extra model entries etc. — made the committed file stale). Verified byte-identical against an independent clean-env regeneration.
📦 Built Package ArtifactBranch: Latest build — install this exact versionnpm install -g billion-context@0.0.8526-pr.5882.dbd9363This exact version is immutable and reproducible. The rolling Recent builds (commit → version)
Download artifact
tar xzf billion-context-pr5882.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…e the guard's bounded-wait semantics) config-surface-guard requires a seed entry for every config-file field.
… truth values CI (ubuntu+windows, node22, fresh runner) computes exactly these persisted-state digests; the previously committed values were regenerated under a contaminated local env (extra model entries), so every clean-environment run reds the full-mode restart proofs. Values taken verbatim from the PR#5882 run-42371752198 assertion output; all other golden fields (wire bodies, landmarks, raw stateDigest) already match CI.
…4241 teeth at the byte-promised tail CI red on this PR had three causes: 1. storage-render + wire-contract goldens were regenerated against a kernel WITHOUT this PR's config (the committed metadata digest matches what master produces, not this branch): effectiveConfig in the persisted metadata now carries nudge.requireUsageSampleForPressure + nudge. maxEstimateHoldRounds, so every metadata digest moved again. Regenerated both golden sets with the local 0.0.185 kernel. 2. #4241 teeth: the fault dropped outbound[length-2] on the assumption the engine appends a trailing nudge as the final wire message. Since #5772 the snapshot render covers the previous turn's tail too (tailStart advanced), so length-2 lands INSIDE the exempt rendered prefix and the teeth never fire. The fault now drops the client's newest tail row (located by content) — the part the render lane actually owns byte-intact. Verified the same fix also passes on current master, where this test is broken since #5772. Note: storage-render/#4241/wire-contract/storage-engine-proofs also fail on master HEAD (run 42358603178) — #5772/#5616-era fallout, not this PR; the nudge e2e subset that master broke (#728A/C, #1119, #1137, zero-baseline) is fixed by this PR's backstop.
CI 红诊断与修复(已推送 e4f2a73)1. 这是啥问题? 2. 根本原因是啥?
3. 如何解决的?(e4f2a73)
4. 是否能合并? 5. URL |
#5882 fixup 77e4f97 left requireUsageSampleForPressure's old site_en/site_zh pair inside the new maxEstimateHoldRounds mapping; the lenient YAML parser last-wins, so the stale 'deferred one round' copy leaked into the generated website text for maxEstimateHoldRounds. Drop the leftover lines and regenerate with gen-config-docs.
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.1072-master.2bda6b3 # this exact build
npm install -g billion-context@master # always the newest merged build
|
… backstop; take master's refreshed goldens Adopts the ranxianglei#5860 follow-up batch (ranxianglei#5882): the estimate-grade pressure hold is now capped at `compress.maxEstimateHoldRounds` (default 2) instead of holding indefinitely, exposed through `src/config.ts` / `src/compress-settings.ts` and pinned by `kernel/tests/nudge-pressure-estimate-hold-backstop.test.ts`. Five golden conflicts resolved with `--theirs`: master regenerated `tests/golden/storage-remainder/` and `tests/golden/wire-account/kernel.json` against the new config surface (`maxEstimateHoldRounds: 2` and the shifted stateDigests). All five blobs are now byte-identical to upstream, so the regen-justification duty belongs to ranxianglei#5882, not to this lane. The lane's own 22 files are untouched by the merge. Verified on the merged tree (CI preload chain, BILI_STORAGE_UNIFIED=legacy): tests/issue5175-drift-name-leak.test.ts 58/0, tests/tag-echo.test.ts 79/0, tests/issue2190-degen-close.test.ts 32/0, tests/golden-storage-render.test.ts 5/0, tests/storage-engine-proofs.test.ts 12/0, tests/wire-contract.test.ts 23/0, tests/issue5719-msgid-lane-identity.test.ts 8/0, tests/issue4666-migration-dedup.test.ts 2/0, tests/silent-backend-nudge.test.ts 4/0, tests/issue4241-judge-render-baseline.test.ts 1/0, tests/issue5756-lazy-sweep.test.ts 1/0, tests/native-compact-terminal.test.ts 1/0, kernel/tests/nudge-pressure-estimate-hold-backstop.test.ts 5/0, kernel/tests/nudge-pressure-no-sample-hold.test.ts 6/0, kernel/tests/nudge-text.test.ts 32/0. `tsc --noEmit` clean; the four repo gates exit 0; `gen-config-docs generate` is a no-op on the four generated artifacts.
这是什么问题
#5860加了「幽灵压力保护」:压力/紧急档的自动压缩注入,要等一个带计费样本的读数才动手(估算读数天生偏高,直接按它压缩会误伤)。这个等待是一次一轮地押——押完这一轮,下一轮还是估算就再押。但对从来不回传计费的会话(匿名零基线 fork、silent-backend),永远拿不到计费样本 → 每一轮都被押 → 压力注入被无限挂起,这类会话永远不会自动压缩。这正是
#728/#553记录的事故场景(本地估算就是它们唯一的压力信号源)。怎么修的(N 轮兜底)
nudge.maxEstimateHoldRounds(默认 2):连续估算读数最多押 2 轮。第 1–2 轮保留原有幽灵窗口保护(中断的那一轮 + 报告来得及前的跟随轮),之后回落到老行为——按估算照常判,保证永不回传的上游也能拿到自动压缩。设0= 完全不押。老开关nudge.requireUsageSampleForPressure=false语义不变。compress.maxEstimateHoldRounds(深度合并 + settings 校验 + wire state 透传,随其余 NudgeState 一起跨重启持久化)。kernel/tests/nudge-pressure-estimate-hold-backstop.test.ts:N=0/默认/自定义三档时序 pin + 样本到达清零 streak +requireUsageSampleForPressure=false逃生口。顺带修的 CI
fork-nudge-trigger/silent-backend-nudge三个 e2e:按新的时序适配(不回报计费的会话连放 3 轮,第 3 轮落压);匿名 fork 改用真正不回传 usage 的 mock(fork 会话 lastInputTokens=0 时 preflight 退化为字符估算,大载荷被低估后不压缩直接裸转上游 #553 事故本相),显式身份对照组保持回传、自证自愈逻辑不受影响。#5865里提交的文件是用带漂移环境变量(BILI_*模型表等)的本地环境生成的,和 CI 干净环境的输出差 2 行(多出的 model id 行)。在干净环境重新生成,并已在无环境变量的独立环境复核字节级一致(此前 CI 同一失败已反复出现 10+ 次)。验证
本地(node 26):kernel hold/no-sample 套件 11/11 ✅;host
silent-backend-nudge+fork-nudge-trigger7/7 ✅(trace 实测:streak 1→hold、2→hold、3→inject OVER-LIMIT T1);root typecheck ✅;kernel build ✅。这是什么问题
#5860加了「幽灵压力保护」:压力/紧急档的自动压缩注入,要等一个带计费样本的读数才动手(估算读数天生偏高,直接按它压缩会误伤)。这个等待是一次一轮地押——押完这一轮,下一轮还是估算就再押。但对从来不回传计费的会话(匿名零基线 fork、silent-backend),永远拿不到计费样本 → 每一轮都被押 → 压力注入被无限挂起,这类会话永远不会自动压缩。这正是
#728/#553记录的事故场景(本地估算就是它们唯一的压力信号源)。怎么修的(N 轮兜底)
nudge.maxEstimateHoldRounds(默认 2):连续估算读数最多押 2 轮。第 1–2 轮保留原有幽灵窗口保护(中断的那一轮 + 报告来得及前的跟随轮),之后回落到老行为——按估算照常判,保证永不回传的上游也能拿到自动压缩。设0= 完全不押。老开关nudge.requireUsageSampleForPressure=false语义不变。compress.maxEstimateHoldRounds(深度合并 + settings 校验 + wire state 透传,随其余 NudgeState 一起跨重启持久化)。kernel/tests/nudge-pressure-estimate-hold-backstop.test.ts:N=0/默认/自定义三档时序 pin + 样本到达清零 streak +requireUsageSampleForPressure=false逃生口。顺带修的 CI
fork-nudge-trigger/silent-backend-nudge三个 e2e:按新的时序适配(不回报计费的会话连放 3 轮,第 3 轮落压);匿名 fork 改用真正不回传 usage 的 mock(fork 会话 lastInputTokens=0 时 preflight 退化为字符估算,大载荷被低估后不压缩直接裸转上游 #553 事故本相),显式身份对照组保持回传、自证自愈逻辑不受影响。#5865里提交的文件是用带漂移环境变量(BILI_*模型表等)的本地环境生成的,和 CI 干净环境的输出差 2 行(多出的 model id 行)。在干净环境重新生成,并已在无环境变量的独立环境复核字节级一致(此前 CI 同一失败已反复出现 10+ 次)。验证
本地(node 26):kernel hold/no-sample 套件 11/11 ✅;host
silent-backend-nudge+fork-nudge-trigger7/7 ✅(trace 实测:streak 1→hold、2→hold、3→inject OVER-LIMIT T1);root typecheck ✅;kernel build ✅。kernel-change: 内核侧改动仅限「幽灵压力等待」的兜底:新增可选配置nudge.maxEstimateHoldRounds(默认 2)与对应 NudgeState 计数字段,把 #5860 的"无计费样本就押一轮"收敛为"最多连押 N 轮后回落估算驱动",修复从不回传计费的会话被无限挂起、永远无法自动压缩的问题(用户裁定的 B 方案)。不改任何既有默认行为、不新增状态迁移;wire 仅新增一个可选字段,旧数据可读。kernel-change: 内核侧仅新增可选配置项 nudge.maxEstimateHoldRounds(默认 2)与 NudgeState 计数字段,把 #5860 的「无计费样本就押一轮」收敛为「最多连押 N 轮后回落估算驱动」,修复从不回传计费的会话被无限挂起、永远拿不到自动压缩的问题;不改任何既有默认行为、不新增状态迁移,wire 只多一个可选字段,旧数据可直接读。