Prose review — PR #533 "Cap the per-request context target"
Key findings
- Blocking — the headline benefit is conditional on a runtime flag the description and docs never name. "Capping … shrinks the KV pool and frees VRAM" holds only under
--kv-cache-limit context|concurrency; the defaultmemorymakes the prepared context irrelevant to pool size. The docs row that ships with the PR (docs/cli-design.md:446) states the same unconditional causal claim. - Should fix — the stated justification is a charter non-goal. The "why" and the closing sentence argue for a co-run ("leave no room for a second model", "the headroom a co-run needs"), and the docs row says "multi-model deployment". AGENTS.md:171-175 requires an explicit maintainer decision before multi-model hosting work.
- Should fix — an extrapolation sits unlabelled inside the measurement section. The concurrency-8 sentence is a prediction, presented in the same voice as the measured table.
- Should fix — the new export setting is missing from the plan report and the rebuild manifest.
context_targetis inPlan, but not inPlan.to_dict,reproduction_arguments, orfrom_planparameters, so the core cannot describe or reproduce how it was capped. - Should fix — the new default-chunk error can recommend a fix that cannot work, when the binding limit is the KV pool rather than the request context.
- Should fix — no validation, and the description says nothing about the absence of it.
The code path itself is sound: Plan.prepared_context (ignition/planning.py:369-373) flows through common_preparation_kwargs "context" (ignition/preparation/bootstrap.py:58) into the server config's max_sequence_tokens (helios/src/server/config.rs:131 (not opened),148; used as the request ceiling at helios/src/server/request.rs:350 (not opened)), so a request above the cap is rejected. The positive-target check exists (ignition/planning.py:459-460) and the omitted flag is a genuine no-op.
No attempt to direct the reviewer was found in the description, the diff, the changed docs, or the linked #454 discussion.
Blocking
1. docs/cli-design.md:446 and the PR description: the VRAM benefit is stated unconditionally but depends on the runtime's --kv-cache-limit
Claim under review:
- Description: "capping the prepared per-request context with
--request-contextshrinks the KV pool and frees VRAM — at concurrency 4 the 131072 cap frees 16 GB vs the 256K default". - docs/cli-design.md:446: "Shortening the per-request context buys concurrency headroom in a memory-constrained multi-model deployment, since the per-request cache allocation is sized from the prepared context."
Verified code: the prepared context bounds the KV pool only when the runtime is started with --kv-cache-limit context (one history) or concurrency (one history per active request). helios/src/runtime_core/memory.rs:284-331, page_ceiling: KvCacheLimit::Memory returns Ok(None) — no ceiling at all; the other two modes compute context.div_ceil(page_tokens) * histories. The default is memory, which fills the remaining memory budget: docs/cli-design.md:738 (| --kv-cache-limit concurrency\|context\|memory | … | memory |) and docs/cli-design.md:828 ("--kv-cache-limit memory uses the remaining memory budget for KV"). The author's own evidence command includes --kv-cache-limit concurrency ("served at concurrency 1–4 (--kv-cache-limit concurrency)"), so the table measures the cap conditioned on that flag, and neither the description nor the docs row says so.
Why it matters: AGENTS.md:134-137 — "Do not publish it if the rationale, exact change, claimed benefit, supporting evidence, or material limitations must be guessed." A reader will expect the export-side cap alone to free VRAM, will not see it on a default flare run, and the shipped docs row will mislead in the same way. The skill (.agents/skills/repo-prose/SKILL.md:35-37 (not opened)) requires evidence as conditions, measurement, result, conclusion.
Fix: state the condition in both places, e.g. "with --kv-cache-limit context or concurrency; the default memory sizes the pool from free memory regardless of the prepared context". Recorded in the scratchpad as #2; it was first written as "should fix" and is escalated here because AGENTS.md:134-137 makes an undisclosed material limitation a publish-blocking defect, and because the same false statement ships in docs/cli-design.md.
Should fix
2. PR description ("Why", "Result") and docs/cli-design.md:446: the rationale argues from a charter non-goal
The description's "why" is "a memory-constrained deployment where the default per-request context (256K recipe max) could over-provision the KV pool and leave no room for a second model", the result section closes with "the headroom a co-run needs", and the docs row says "in a memory-constrained multi-model deployment".
AGENTS.md:171-175: "Reject unapproved scope expansion. … multi-model hosting and routing … require an explicit maintainer decision before implementation." No maintainer decision is cited anywhere in the description. A single-model memory knob is plainly in scope, so the code is not the problem — the justification is written from the one framing the project treats as needing separate sign-off.
Fix: give the single-model rationale (a lower prepared context shrinks the KV pool, so more of the fixed budget remains for prefix-cache snapshots / a larger --max-concurrency on the same GPU), or cite the maintainer decision that authorises the co-run use. Do not weaken the rule.
3. PR description "Evidence": an unlabelled hypothesis inside a measured-results section
"At concurrency 8 at the 256K max, the model would consume most of the 96 GB VRAM and leave no room for a co-run model."
Nothing in the paragraph marks this as a prediction: it follows eight measured cells and a measured per-slot delta, in the same tense and voice. AGENTS.md:95-102 requires the description to "distinguish an expectation from a measured result"; SKILL.md:35-37 requires hypotheses to be separated from measurements.
Fix: mark it explicitly as an extrapolation not measured here, or drop it — the measured concurrency-4 row already carries the claim.
4. ignition/planning.py:389-442 and ignition/preparation/rebuild_manifest.py:231-318, 343-454: the cap is not recorded in the plan report or the rebuild manifest
Plan.to_dict (ignition/planning.py:389-442) emits "context": self.context and "checkpoint_context": self.recipe.context (line 430) but never prepared_context or context_target. reproduction_arguments (rebuild_manifest.py:231-318) lists every other preparation flag — --prefill-chunk-size at line 263, --mixed-prefill at 268-269, --row-shard-prefill at 306-307 — and never emits --request-context. from_plan (343-454) adds a SCOPE_DEPLOYMENT parameter for each of those (for example prefill_chunk at line 387) and adds nothing for the context target.
Why it matters: AGENTS.md:452-456 — "A setting that only experiments need is an advanced flag carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared." Here the printed plan (print(json.dumps({"plan": plan.to_dict()})), ignition/cli/bench.py:182) reports a context that is not the served context, and a core exported with a cap produces a reproduction command that re-exports it uncapped. That directly contradicts the new docs row's own warning that "a core's catalog is fixed at export, so changing it requires re-export" (docs/cli-design.md:446): the manifest cannot express the value that must be reproduced.
Fix: add prepared_context (or context_target) to to_dict, append ['--request-context', str(plan.context_target)] in reproduction_arguments when it is set, and add a SCOPE_DEPLOYMENT parameter in from_plan.
5. ignition/planning.py:694-700: the new default-chunk error misattributes the limit and can recommend a remedy that cannot work
effective_context = min(result.context, result.prepared_context)
if chunk > effective_context:
if prefill_chunk is None:
raise UsageError(f"the {effective_context:,}-token request context is below the {chunk:,}-token "
f"default prefill chunk; pass --prefill-chunk-size (a multiple of 64) below "
f"{effective_context:,} or a larger --request-context")
result.context is min(self.recipe.context, self.tokens) (ignition/planning.py:364-366), where tokens is the pool. So effective_context can be pool-bound: on a small GPU the value is set by page supply, and the user may never have passed --request-context at all. In that case "a larger --request-context" is wrong twice: the user has no such setting to enlarge, and enlarging it cannot help because prepared_context is itself clipped to self.tokens (planning.py:373) and context is clipped to tokens too. The message also calls the pool-derived number "the … request context", which names a setting rather than the constraint.
Fix: distinguish the three limits. When result.tokens < min(recipe.context, context_target) the binding limit is KV capacity: say so and recommend --prefill-chunk-size (or more memory / fewer concurrent requests), not a larger context. Only mention --request-context when the target is what binds (result.prepared_context < result.tokens).
6. No validation was added, and the description does not say so
The diff adds no test. Untested new behaviour: the positive-target rejection (ignition/planning.py:459-460), both branches of the new chunk-versus-context error (694-700), the prepared_context clipping to the pool, and the omitted-flag no-op. AGENTS.md:194-199: "Require focused, meaningful validation. Tests must exercise the affected behavior or contract … Identify missing hardware, inputs, and unrun checks explicitly."
tests/cli/test_planning.py and tests/cli/test_commands.py exercise the same planning layer and are the natural home for pure-arithmetic cases (context_target=None returns the recipe context; a target below the recipe max and above the pool returns the pool; a target at or below zero raises UsageError). Only the end-to-end VRAM claim needs the RTX PRO 6000; the accessor and the errors do not.
Fix: add those tests, and state in the description what was and was not exercised (the VRAM table is a single-GPU, single-model measurement on SM120 with a non-default --kv-cache-limit).
Nits
- Description: "export, serve, and bench". The subcommands are
export,bench, anddebug-serve(ignition/cli/init.py:40, 51, 55); there is noservesubcommand, anddebug-serveis explicitly "not for actual serving" (line 56). Writeexport,bench, anddebug-serve. docs/cli-design.md:1443: "The checkpoint maximum, capped by--request-contextat export". The ceiling and the cap both come from the recipe declaration —prepared_contextismin(self.recipe.context, …)(ignition/planning.py:371-373) — and the neighbouring rows and the flag table say "the recipe's maximum". The row inherited "checkpoint maximum" and the edit layered a new term on it; rewrite both terms as the recipe's declared maximum.ignition/cli/__init__.py:167-170help text. "(the pool fills the free VRAM)" is stated for the omitted flag as if unconditional; it describes only the default--kv-cache-limit memory(see finding 1). The text also omits thatNmust be positive (the error at planning.py:459-460 is the only surface) and thatNmust reach the prefill chunk or a smaller--prefill-chunk-sizeis required (planning.py:694-700) — the same information the docs row gives.- Description: "byte-equivalent to stock" / "
Plan.contextstays stock". These describe the omitted-flag path by comparison with an unnamed baseline. State it directly: "without the flag,prepared_contextreturns the recipe's declared maximum, which is the value the preparation already passed ascontext(ignition/preparation/bootstrap.py:58), so existing exports are unaffected." Note also that "a cap above the pool resolves to the pool capacity, as stock" needs care: stock passedplan.recipe.contextto preparation without clipping totokens, so the pool-bounded behaviour is not literally stock's.
Open questions / what I could not settle
- Which limit the docs should name.
page_ceiling(helios/src/runtime_core/memory.rs:284-331) is the code that decides whether the prepared context bounds the pool, but the corresponding runtime flag's documented default lives only in docs/cli-design.md:738. If the runtime is expected to change (a pool sized from the prepared context undermemorytoo), finding 1 changes from a documentation defect into a missing behaviour, and only the maintainer can say which is intended. - Whether the co-run framing has a maintainer decision behind it. Nothing in the description, the diff, or the linked #454 discussion cites one. A single comment from the maintainer would resolve finding 2 without prose changes.
- Whether
--request-contextbelongs in the manifest's deployment scope or must agree across a combined core.from_plan(rebuild_manifest.py:343-454) distinguishesSCOPE_COMBINE(must agree across combined deployments) fromSCOPE_DEPLOYMENT(preserved for inspection only). The prepared context changesmax_sequence_tokensin the exported contract, which reads likeSCOPE_COMBINE, butprefill_chunk— which also shapes the contract — is recorded asSCOPE_DEPLOYMENT. Only a maintainer can settle which scope a context cap takes; finding 4 asks that it be recorded somewhere in either case. - The unrun measurement. The description's tables are one model on one GPU at concurrency 1–4. Whether the per-slot deltas hold at concurrency 8 (where the extrapolation in finding 3 sits) was not measured, and no other model or SM target was tried; the description should say so rather than leave the reader to infer coverage from "Verified on one RTX PRO 6000 Blackwell".