Prose review — PR #533 "Cap the per-request context target" (head 9118add, base main; 6 files, +69/−5)
Verdict: blocking issues. Rules applied: AGENTS.md:72-110 (four required answers, in order; attach scope and limitations to a measured claim; name the affected components and material compatibility changes), docs/design-review.md:137-152 (principle 16, "reject messages that present them out of order"), .agents/skills/repo-prose/SKILL.md:8-59 (not opened) (no false definite references, no unverifiable quantifiers). The head carries no CI checks, so the two failing test assertions below were never executed.
Reader's note: this PR was rebased onto #545 (compositional RecipeParameters), so most of the diff now lives in ignition/parameters.py. Earlier review rounds covered the pre-rebase head 02023eba; items fixed since then are listed at the end under "Checked and clean" and must not be re-raised.
Key findings
- The description's central mechanism claim — that the
context_targetdeclaration makes the system "auto-generate the CLI argument, manifest entry, and reproduction arg" — is false for the third item: the flag never reachesreproduction_args. - A cap above the recipe maximum is rejected, not clamped, contradicting both the PR's own new test and the docs row it adds.
Both are prose findings (the description asserts behaviour the code does not implement) and both fail the PR's own new test.
Blocking
B1. --request-context never reaches reproduction_args, so a capped core cannot be reproduced from its manifest
ignition/parameters.py:1469-1528, tests/cli/test_planning.py:324.
The description states: "a context_target field on RecipeParameters (ignition/parameters.py) with --request-context flag, DEPLOYMENT scope, and manifest_key="context_target" — the parameter system auto-generates the CLI argument, manifest entry, and reproduction arg." Two of the three hold; the third does not.
RecipeParameters.reproduction_args overrides ParameterGroup.reproduction_args (ignition/parameters.py:618-655) and never calls super(). It emits --gpus/--ranks/--roce-* (:1472-1481), hardcodes --max-concurrency and --prefill-chunk-size (:1483-1484), handles --no-mtp (:1486-1487), recurses into sub-groups (:1488-1489), and then skips every base-class field by name:
base_field_names = {f.name for f in fields(RecipeParameters)} # :1491
if dc_field.name in base_field_names or not spec.cli or not _is_enabled(self, spec, ctx): # :1494
continue
context_target is a base-class field (:1309), so it is skipped. A search_code "request-context|context_target" over ignition/ finds no other emitter: only the declaration (:1309, :1311, :1317), the planning references (planning.py:186, :189, :360), and the serve.py:68 hint. rebuild_manifest.reproduction_arguments merely splats the same list (ignition/preparation/rebuild_manifest.py:261: return ['ignition','export', target, *params.reproduction_args(context)]), so the manifest records a command that silently rebuilds with the unclipped recipe maximum. The field's repro_always=True (:1319) is therefore dead for this flag.
The PR's own test asserts the opposite:
manifest = rebuild_manifest.from_plan(SimpleNamespace(directory=None), capped, compiled_forwards=True) # :323
assert "--request-context" in manifest["reproduction_args"] # :324 ← fails
assert "131072" in manifest["reproduction_args"] # :325 ← fails
(The :326-329 manifest-parameters assertions do pass: manifest_parameters (parameters.py:596-616) walks all fields, including base ones, keyed by manifest_key.) The doc claim in docs/cli-design.md:485 — "Every resolved RecipeParameters value serializes directly into PreparationManifest (parameters and reproduction_args)" — is likewise only half true for this flag.
Fix: emit base-class CLI fields whose value differs from the default (or call super().reproduction_args(ctx) and drop the duplicated hardcoded flags); drop repro_always=True on context_target, or use it consciously — as written it would stamp --request-context 262144 onto every export. Settled by pytest tests/cli/test_planning.py -k request_context.
B2. A cap above the recipe maximum is rejected, not clamped — the test, the docs row and the description all say it is clamped
ignition/parameters.py:1309-1321 + :505-545, tests/cli/test_planning.py:310-313, docs/cli-design.md:468.
context_target declares max_fn=_recipe_context_limit (:1316), which returns context.recipe.context (:1268-1269). ParameterGroup.validate_fields raises above the resolved maximum: f"{flag} for {alias} must be {min} through {max}" (:536-540). RecipeParameters.validate calls super().validate(ctx) (:1463) → ParameterGroup.validate (:547-551) → validate_fields, and planning.plan validates before sizing (planning.py:540), so the bound is live on every planning call.
The new test expects the opposite, with recipe.context = 262144 (tests/cli/test_planning.py:139):
oversized_params = replace(base_params, context_target=500000) # :310
oversized = planning.plan(recipe, recipe.checkpoints[0], gpus, selected=(0,1), parameters=oversized_params) # :311 ← raises UsageError
assert oversized.parameters.context_target == 500000 # :312
assert oversized.prepared_context == recipe.context # :313
The docs row says the same wrong thing — docs/cli-design.md:468: "Cap the prepared per-request context and max_sequence_tokens at N tokens; resolves to the smaller of N and the recipe maximum." The description's Result repeats it: "at serve time Helios's fit_context applies min(context, prepared_context), so a cap above the pool still shrinks the export artifact without changing the serve-time pool bound" — true only for a cap above the pool but below the recipe maximum; a cap above the recipe maximum cannot be passed at all.
Fix: pick one and make the test, the docs row, the help string and the description agree — either accept and clamp (drop max_fn or clamp in resolve), or state the 1..recipe-maximum bound everywhere and rewrite :310-313 to assert the UsageError. Settled by pytest tests/cli/test_planning.py -k request_context.
Should fix
-
tests/cli/test_planning.py:295takesmonkeypatchand never uses it, unlike its siblings.:159,:223and:333all stubignition.preparation.source_identity.source_identity; this test does not, yet callsrebuild_manifest.from_plan(:323), which callssource_identity()(ignition/preparation/rebuild_manifest.py:327).source_identityimportsflare_heliopauseand raisesRuntimeError("the preparation environment requires FlashInfer")when FlashInfer is absent (ignition/preparation/source_identity.py:36-41). A pure planning check therefore depends on a GPU/FlashInfer environment. Add the stub line like its siblings, or drop the unused fixture if the environment is guaranteed. -
The description presents the four required answers out of order (AGENTS.md:74-80: "Every description must answer these four questions, in this order: why, what exactly changed, what benefit or result is claimed, and what evidence supports it"; docs/design-review.md:146-147 "Reject messages that … present them out of order"). The body runs "What Changed" → "Result" → "Evidence", and the why survives only as the "Workload: a memory-constrained deployment where the default per-request context (256K recipe max) over-provisions the KV pool, leaving insufficient VRAM for the desired concurrency" sentence inside Evidence. Lead with one sentence of why, then What Changed, then Result, then the table.
-
The VRAM benefit is stated unconditionally (AGENTS.md:95-102: attach scope and material limitations to a measured claim). The table's benefit requires
--kv-cache-limit context|concurrency;page_ceilingreturnsOk(None)forKvCacheLimit::Memory(helios/src/runtime_core/memory.rs:284-292), andmemoryis the documented default (docs/cli-design.md:740). Only the evidence command line says--kv-cache-limit concurrency. Put the condition on the Result sentence and ondocs/cli-design.md:468. -
docs/cli-design.md:468omits the operational consequence. The description says "a request that would exceed the cap is rejected", and Helios enforces it at admission (helios/src/server/request.rs:349-363;helios/src/model/admission.rs:150-158(not opened)). The neighbouring--prefill-chunk-sizerow (:467) states its consequence, so this row should too: "a request whose prompt plus output exceeds N is rejected at admission". -
"the single seam all recipes consume" is unverifiable as written.
ignition/preparation/bootstrap.pypassingplan.prepared_contextis accurate (bootstrap.py:132), but "all recipes" is a claim about packages that live outside this repository (AGENTS.md:9-13). The in-repo contract isBasePreparationConfig.context(ignition/preparation/bootstrap.py:33), set at:132. Cite that, or drop the quantifier. -
The
--prefill-chunk-sizeguard ignoresprepared_contextand can prepare an unloadable core —ignition/planning.py:594. It comparesparams.prefill_chunk > result.context(min(recipe.context, tokens),planning.py:353-355), notresult.prepared_context(min(recipe.context, context_target),:357-363), while--prefill-chunk-sizeis bounded only byrecipe.context(ignition/parameters.py:1458). So--prefill-chunk-size 262144 --request-context 131072passes both checks and preparesmax_sequence_tokens = 131072withprefill_chunk_size = 262144, which Helios refuses at load (prefill_chunk_size <= max_sequence_tokens,helios/src/scheduler.rs:66-77, reached frommodel/catalog.rs:42) — an exported core that cannot serve, discovered only after a full preparation run. Useresult.prepared_contextin the guard (and in its message), and add an assertion besidetests/cli/test_planning.py:305-308. The bench pre-check already usesprepared_context(planning.py:212), so this guard is the inconsistent sibling, and the description's "prepared context governs" framing does not cover it.
Nits
ignition/parameters.py:1320help: "must be a multiple of the page token count" uses an internal name with no antecedent in--help, and the sentence never says the range is enforced (the rendered help appends "1..262,144" frommax_fn, but the prose does not). Say "page size", or drop the clause and let validation speak.docs/cli-design.md:468copies "a core's catalog is fixed at export, so changing it requires re-export" verbatim from the--mixed-prefillrow (:469). Accurate but redundant across adjacent rows.docs/cli-design.md:468and:1436say "the recipe maximum context" / "The recipe maximum context" while the row this PR replaced and the rest of the file use "checkpoint maximum". Both the ceiling and the cap derive fromRecipe.context(ignition/declaration.py:176(not opened)) — pick one term.ignition/cli/serve.py:68:context_hintnow reads "context is limited by the checkpoint, cache capacity, and --request-context cap" — it names three limits without saying which binds, and it is printed even when the flag is absent, advertising a flag the deployment did not use. Consider naming the resolved number (plan.prepared_context, already used two lines above at:67).- Description: the table headers say "256K / 192k / 128k" while the command uses
196608 / 131072; state once that 128k = 131072 tokens so the row and the flag agree. - Description: "Total VRAM (GB)" does not say per GPU or process-wide, nor the measurement source (
nvidia-smivs reserved), which keeps the table from being reproducible.
Checked and clean (do not re-raise)
The page-multiple validation now exists (ignition/planning.py:186-190) and agrees with its test (:319-321); Plan.prepared_context no longer carries the export host's free-memory term (:357-363), so "a cap above the pool does not shrink the artifact" holds below the recipe maximum; bootstrap.py:132 passes plan.prepared_context; the bench pre-check compares prepared_context (:212); serve.py:67 sizes max_body_bytes from it; docs/cli-design.md:1436 and the new :468 row use the flag name correctly; manifest parameters entries do emit context_target with SCOPE_DEPLOYMENT (parameters.py:596-616); docs/cli-design.md is listed among the changed files. No reviewer- or agent-directed instruction was found in the description, the discussion, or the diff.
Open questions / could not settle
- The commit message body: history exposes only the subject plus the Signed-off-by and Design-Signed-Off-By trailers, so I could not judge it against the prose rules.
- The external recipe side of the "single seam" claim — those packages are not in this repository.
- Nothing was executed: the head carries no CI checks, so B1 and B2 rest on reading the code and the new test.
pytest tests/cli/test_planning.py -k request_contextsettles both blockers; a load of a core prepared with--prefill-chunk-sizeabove the cap (e.g.flare run) settles should-fix 6.