Repository navigation
docs: explain compaction timing — growth-gated first compaction & the ~200k landing zone - #2226
Conversation
Add the large-window compacting narrative (worked example: 262,144 window + max_tokens 131,072 -> reserve 65,536 -> effective 196,608 -> default 75% band fires at ~147k ~= 56% of the full window; flat 50k growth step) with remedies (measure with /acp or web UI, raise compress.nudgeGrowthTokens to 100k+, slim the boot with promptPack lean) to CONFIGURATION.md/.zh-CN.md before the soft-target section, plus one cross-linking FAQ entry in each README. Docs only: no code or config changes. Closes #2225
…ix from #2225) The Soft-target section still described the pre-#379/#380 shape: adaptive step clamp(round(window*5%), 20k, 50k) with a window-dependent growth floor. Current kernel constants (golden-pinned in tests/golden/wire-contract/kernel.json): nudge.growthFloor == nudge.growthCap == 50000, so the step is flat 50k at every window size and the growth gate is max(20k, 0.45*step) ~= 22.5k with the T1 path additionally requiring >= one step of compressible mass. The old text contradicted the new large-window section added alongside #2225.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2316-pr.2226.e0cd54fThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2226.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 Review 完成 — 判定:可合。 重复判定(先于 Triage):发现 #2225(同标题,早 10 分钟开、单 commit、+54 行)。判定功能重复/被取代:同一需求(同样两个社区症状的叙事文档)、同样四个文件、同样插入位置;#2226 以改写形式包含 #2225 全部内容 + pass-by 修正 + Validation 节,且其正文显式声明 结构化七问:
diff 整洁度:4 文件、2 个线性 commit,pass-by 修正独立标注,无跑题文件/空白噪音/生成物连带变更。CI:head f09edc1 全部 job 绿(ubuntu/windows 双平台 test、全套 real-client e2e lanes、docs-sync、docs-coverage、kernel-guard、version-guard、lane-guard、build-artifact)。无需 rebase(mergeable=True,docs-only 与 master 无语义冲突)。 判定:可合。我无法合并 PR(系统规则禁止),请手动合并:#2226 |
The earlier framing ("starts earlier than expected") got the emphasis
backwards: the first compaction is growth-gated (boot + nudgeGrowthTokens,
flat 50k by default), not absolute-window-gated — with a heavy boot
(100k-150k) the first compaction naturally waits until ~200k, and the 75%
forced line is only a backstop over the effective window. Rewrites the
section and FAQ entries around "why the first compaction waits until 200k"
plus remedy angles (earlier saving vs fewer compactions vs leaner boot).
- boot ~100k OR a growth step set to ~100k is what pushes the first compaction out to ~200k (drop the boot-100k-150k phrasing) - remedies now the three-step optimization order: trim prompt/tools/skills, lower nudgeGrowthTokens to ~50k, enable lean - drop the forced-threshold aside from the FAQ entry (kept in the worked example); unify token units to k (was mixed 万/50k)
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.70-master.46fb5a7 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Supersedes #2225 (same content, plus the pass-by fix from ework-agent; ework's branch became the surviving PR — reframe commit ported on top).
Why
Community feedback (awesome-dsh-plugin discussion #5795) shows users mis-model compaction timing on large-window + heavy-boot + local-model setups. The key fact the docs lacked:
Compaction does not trigger on absolute window position — it triggers on growth intervals. By default the first soft compaction fires 50k tokens past the boot content (
nudgeGrowthTokens, flat and window-independent; kernelnudge.growthFloor == nudge.growthCap == 50000, golden-pinned — #379/#380). So the absolute position of the first compaction ≈ boot + 50k:The 75%
maxContextLimitforced line is only a backstop, applied over the effective window (output reservemin(max_tokens, outputHeadroomMaxPct × window), 25% cap by default, subtracted first): typically small reserve → forced line ≈190k on a 262k window; a request carryingmax_tokens = 131072→ reserve 65,536 → forced line ≈147k.After the first compaction the cadence stays growth-based (+50k per incremental compaction); on local models each is a full re-prefill — the "kept compacting, task took 2–3×" experience.
What this adds
CONFIGURATION.md/CONFIGURATION.zh-CN.md:### Why the first compaction waits until 200k/### 为什么第一次压缩要到 200k 才触发?— growth-gate mechanics, boot+50k arithmetic, backstop math, then remedy angles: earlier token saving (lowernudgeGrowthTokens/maxContextLimit), fewer compactions (raise the step), leaner boot (promptPack: "lean"), measure first via/acpor the web UI.README.md/README.zh-CN.md: one FAQ entry each cross-linking the worked example.clamp(window×5%)growth-step formula in the Soft-target section → flat golden-pinned 50k).Docs-only — no code or config changes.