Repository navigation
docs: explain compaction timing — growth-gated first compaction & the ~200k landing zone - #2225
ranxianglei wants to merge 1 commit into
Conversation
Two defaults interact on large-window setups and are frequently reported as bugs (e.g. awesome-dsh-plugin discussion #5795): the forced threshold applies to the effective window (native window minus the output reserve, capped at 25% by default), and the 50k growth-nudge step is flat by design regardless of window size. A heavy boot on a 262k window with a local model can therefore see several incremental compactions per task, each a full re-prefill. Adds a worked-example section to CONFIGURATION(.zh-CN).md and matching FAQ entries to README(.zh-CN).md with remedies (raise nudgeGrowthTokens, lean pack, check boot usage via /acp).
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2296-pr.2225.310d34eThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2225.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 收到,开始处理。已核对代码与文档现状:
计划:新章节(中英)+ README 双语 FAQ 条目 → PR(Closes #2225)→ 回复七问结论。 |
[bot] 🏷 完成。**PR: https://github.com/ranxianglei/billion-context/pull/2226**(分支 结构化结论(七问)
diff:4 文件 +65/−2,每行都与本 issue 相关。判定:可合并(docs-only,CI 全局把关)。 |
|
[bot] 🏷 Closing as superseded by #2226. Duplicate screening result: same scope — the same two community symptoms (large-window + local-model compacting early / repeatedly), the same four files, the same section placement. #2226 carries this PR's content in a more complete form (worked-example table, ordered remedies, validation notes) plus the pass-by correction of the stale pre-#379/#380 growth-step formula in the Soft-target section, and its body explicitly declares Merging this PR first would leave #2226 stale and conflicting on the very sections it extends. Everything here survives in #2226 — nothing is lost by closing. |
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 ranxianglei#2225
…ix from ranxianglei#2225) The Soft-target section still described the pre-ranxianglei#379/ranxianglei#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 ranxianglei#2225.
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). 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"), and measure first via/acpor the web UI.README.md/README.zh-CN.md: one FAQ entry each cross-linking the worked example.Docs-only — no code or config changes.