#4 [high] Report of 2026-11-26, run 1310 — #533 (rebased on #545)
Verdict: worth it with changes — smallest-footprint version yet (6 files, ~+30 code, +37 test), correctly reuses #545's RecipeParameters system so the flag/help/manifest/scope come for free. But two defects make the PR's own new test fail, and one exports a core Helios refuses to load after a full GPU preparation.
Diff scope (head, rebased on #545 compositional RecipeParameters)
docs/cli-design.md (+2/-1); ignition/cli/serve.py (+2/-2); ignition/parameters.py (+13); ignition/planning.py (+14/-1); ignition/preparation/bootstrap.py (+1/-1); tests/cli/test_planning.py (+37).
What works (verified)
- parameters.py:1309-1321 —
context_target: int | None = param(None, flag="--request-context", group="capacity and compression", min_value=1, max_fn=_recipe_context_limit, manifest_key="context_target", scope=ParameterScope.DEPLOYMENT, repro_always=True). CLI registration/parse/help come from #545's generic machinery;_dest_name→request_context,_RecordingStoreActionrecords explicitness (parameters.py:450-484) → resolve works. - planning.py:357-363 —
prepared_context= recipe.context when no target, elsemin(recipe.context, target). The previous round's export-hosttokensterm is gone: deterministic across hosts.Plan.context(353-355) untouched. - planning.py:186-190 — page-multiple check added (the missing-validation blocker from last round is closed).
- planning.py:212 — bench check now compares
required_contexttoprepared_context. - bootstrap.py:132 — the single seam:
"context": plan.prepared_context→ BasePreparationConfig.context (bootstrap.py:33) → Heliosprepared_sequence_tokens(helios/src/server/config.rs:131) +limits.max_sequence_tokens(:148), admission-enforced (server/request.rs:349-363), advertised as max_model_len (server/models.rs:81), pool-clamped at load (model.rs:261-273). - No-op when omitted: prepared_context == recipe.context → existing cores/artifacts unaffected. No Helios change, no per-model branch (one base-class field every recipe inherits).
- serve.py:67-68 — max_body_bytes now uses prepared_context (last round's should-fix, done).
BLOCKER 1 — --request-context never reaches reproduction_args (test line 324-325 fails; artifact gap #454 asked to close)
RecipeParameters.reproduction_args (parameters.py:1469-1528) OVERRIDES the base implementation, emits base fields by hand (--max-concurrency 1483, --prefill-chunk-size 1484, autotune/lock/compile 1522-1527), then skips every base field in the generic loop:
parameters.py:1491 base_field_names = {f.name for f in fields(RecipeParameters)}
parameters.py:1494 if dc_field.name in base_field_names or not spec.cli ...: continue
context_target is a base-class field → skipped → --request-context is never emitted. repro_always=True on it is dead. Consequence: tests/cli/test_planning.py:324 ("--request-context" in manifest["reproduction_args"]) fails, and flare inspect / the manifest's reproduction command silently reproduce an UNCAPPED core — exactly yatesdr's #454 requirement. Manifest parameters carry it (base manifest_parameters, parameters.py:596-616, has no base-field skip), so repro and manifest disagree — proof it's an oversight.
Fix: in the manual base block beside 1483-1484, if self.context_target is not None: args.extend(["--request-context", str(self.context_target)]) (band with prefill_chunk), or stop special-casing base fields.
BLOCKER 2 — an oversized target is rejected, contradicting the docs row and the PR's own test (test lines 310-313 fail)
max_fn=_recipe_context_limit (parameters.py:1268-1269, wired at :1316) returns context.recipe.context, so validate_fields (parameters.py:533-545) raises "--request-context for ALIAS must be 1 through 262,144" for context_target=500000. tests/cli/test_planning.py:310-313 asserts 500000 is accepted and clamps to the recipe max; docs/cli-design.md:468 says "resolves to the smaller of N and the recipe maximum"; prepared_context itself says min(...). Code vs docs vs test all disagree.
Fix (one line): drop max_fn from context_target (keep it on prefill_chunk at :1301) so oversize clamps as documented; then ALSO change the page check to the served value min(self.recipe.context, target) % self.page_tokens — necessary because 500000 % 64 == 32, so the current check at planning.py:187-190 would still raise and the test case would still fail. With that pair, lines 310-313 and 319-321 both pass as written. (Alternative: keep rejecting and rewrite docs:468 + the test — but clamping matches Helios, which already clamps to the pool.)
BLOCKER 3 — a cap below the prefill chunk exports a core Helios refuses to load
Helios: helios/src/scheduler.rs:66-77 validate_prefill rejects prefill_chunk_size > max_sequence_tokens ("must be divisible by 64 and within 64..=context"); called from model/catalog.rs:42 after fit_context (server/config.rs:225-226). Export writes prefill_chunk_size = parameters.prefill_chunk (bootstrap.py:45-46; default 4096, parameters.py:1294) and max_sequence_tokens = prepared_context.
Ignition has no check against the cap: RecipeParameters.validate compares the chunk to ctx.recipe.context (parameters.py:1458-1462), and plan() compares to result.context = min(recipe.context, pool tokens) (planning.py:594-596) — never prepared_context.
So ignition export qwen3.8-27b --request-context 2048 plans cleanly, spends the whole GPU preparation, then flare run fails "invalid prepared model configuration". Any target below the chunk (default 4096) hits this.
Fix: validate prefill_chunk <= prepared_context in Plan.post_init beside the page check, naming --request-context as the binding flag.
Should fix
- planning.py:320-321
demand_pagesstillconcurrency * (recipe.context // page_tokens)→ printed/to_dict KV demand (:407) overstates what the flag lowers. - Plan.to_dict emits
context(pool-bound) andcheckpoint_contextbut noprepared_context; the served ceiling is only inferable fromcontext_target. Add"prepared_context": self.prepared_context. - docs/cli-design.md:468 must state that a cap also lowers the default output allowance (
max_new_tokensdefaults tomax_sequence_tokens, server/config.rs:210-213) and that the cap must be >= the prefill chunk. - Evidence is still mode-scoped: under the default
--kv-cache-limit memory,page_ceilingreturns Ok(None) (runtime_core/memory.rs:290-292) and pages fill free VRAM, so the VRAM table only holds with--kv-cache-limit context|concurrency(the commands used it; the claim does not say so). Add the one case only this flag can produce: a request between cap and recipe max rejected by the capped core but accepted by stock, and a smaller max_model_len in /v1/models. - State the behaviour change honestly: stock passed recipe.context unclipped, so a cap above the pool now prepares a lower max_sequence_tokens than the same export without the flag.
- No test asserts the seam that actually changes the core: add
common_preparation_kwargs(plan)["context"] == plan.prepared_contextin tests/cli/test_commands.py:150-155.
Charter mapping
- Merged-PR criteria: addresses a maintainer request (#454 review by yatesdr listed exactly these requirements) and a measured memory issue with commands, revision and an SM120 card.
- Right layer (#404): the runtime cannot do this — --kv-cache-limit context|concurrency (runtime_core/memory.rs:284-331) and --memory-limit shape the pool only; max_sequence_tokens / max_model_len are baked at export. Export-time decision.
- No per-model branches: one field on the shared base RecipeParameters; every recipe inherits it; no Helios change.
- No duplication: nothing else lowers the admission ceiling.
- Cost: ~30 lines, no runtime/CUDA path, no catalog risk; maintenance limited to the repro tuple.
- Benefit: modest but real for the vision's core case (one long-context model on an SM120 workstation / DGX Spark): trade per-request ceiling for concurrency and advertise an honest max_model_len.
- Risk: low once blocker 3 is fixed; unaligned/undersized targets otherwise fail after full preparation.
Bottom line
Merge after: (1) emit --request-context in RecipeParameters.reproduction_args, (2) let an oversize target clamp and check alignment of min(recipe.context, target) — which also makes lines 310-313 and 319-321 pass — and (3) reject a cap below the prefill chunk before preparation. Report/docs gaps are one revision of the description plus one line of docs.
#7 [high] Report of 2026-11-27, run 1490 — #533 at e6239855
#533 head e6239855 ("Cap the per-request context target", 6 files, ~+69/−14 all Ignition Python + docs).
VERIFIED FIXED (was blocker last round):
- B1 repro: parameters.py:1484-1485 emits "--request-context" when set; repro_always removed.
- B2 max_fn: gone from context_target (parameters.py:1309-1319: min_value=1 only, manifest_key, DEPLOYMENT, status_label :1318).
- B3 page check: planning.py:186-190 gated on target <= recipe.context, so it validates exactly the served value (target <= max => prepared_context == target); oversized 500000 skips it and resolves to recipe max (:357-363). tests/cli/test_planning.py:310-313, 319-321 now consistent.
- B4 chunk vs cap: planning.py:594-597 effective = min(result.context, result.prepared_context).
- status_label present; serve.py:67-70 prepared_context + conditional hint; help.py:46; docs cli-design.md:449,:468,:1436; preparation-development.md:18.
REMAINING (should fix, none blocking):
- tests/cli/test_planning.py:295 takes monkeypatch but never patches source_identity; rebuild_manifest.from_plan (:323) calls it (rebuild_manifest.py:327) -> real hashing of ignition+flashinfer+flare_heliopause, needs flashinfer find_spec (source_identity.py:39-41). Siblings patch it at :223 and :333. Slow/env-dependent.
- No assertion pins the seam: drop bootstrap.py:132 and the new test stays green. Pattern at tests/cli/test_commands.py:150-155.
- No test for planning.py:594-597 (cap below prefill chunk), the newly added safety check.
- docs/cli-design.md:468 omits: cap also lowers default max_new_tokens (helios/src/server/config.rs:210-213) and must be >= prefill chunk.
- planning.py:320-321 demand_pages still recipe.context (only consumer :407); to_dict has context/checkpoint_context but no prepared_context.
- status_label prints raw target; a target above the recipe max prints 500,000 tokens though the served value is the recipe max.
- Evidence: VRAM table holds only under --kv-cache-limit context|concurrency (helios/src/runtime_core/memory.rs:290-292 default memory); description doesn't say.
- Description: "Helios's fit_context applies min(context, prepared_context)" — the min is Ignition's; fit_context (helios/src/model.rs:261-273) clamps to pages*page_tokens.
Charter: right layer (#404, max_sequence_tokens baked at export); no per-model branch; no Helios change; measured memory issue on SM120; #454 asked for it.
#5 [medium] #533 verification details (run 1310)
Additional verified details for #533 review (head 9118addd, rebased on #545):
- Blocker 2 message check:
validate_fields(parameters.py:533-545) withmax_fn=_recipe_context_limitraisesf"{flag} for {alias} must be {lo} through {hi}"→ "--request-context for fixture-alias must be 1 through 262,144". So tests/cli/test_planning.py:315-317 (target=0) still matches "--request-context" ✓, and :319-321 (target=100) still reaches the page check and matches "multiple of the" ✓. Only :310-313 (500000) and :324-325 (repro args) fail. - If blockers 2's fix is applied as
min(self.recipe.context, target) % page_tokensplus dropping max_fn, the target=0 case still raises via min_value=1 first (min(...)=0 % 64 == 0 would NOT trip the page check), so :315-317 stays correct. Good. - Fixture:
_recipe()(tests/cli/test_planning.py:117-150) sets context=262144, page_tokens=64, RankCosts(page_tokens=None) → Plan.page_tokens == 64. 500000 % 64 == 32. - Reporting gap (should fix):
context_targethas nostatus_label(parameters.py:1309-1321), soPlan's "Select GPUs" line (plan.parameters.status_parts, serve.py:268-272, RecipeParameters.status_parts parameters.py:1540-1562) never mentions the cap; combine with missingprepared_contextin Plan.to_dict (planning.py:379-416) → a capped export's report and a stock one's differ only incontext_target. - Overrides confirmed: RecipeParameters.reproduction_args (parameters.py:1469) is the root override of ParameterGroup.reproduction_args (parameters.py:618); the only other subclasses are groups (parameters.py:992 speculation, :1153 vision). Base-field skip at :1491/:1494 is what drops context_target.
- Helios load path: server/config.rs:148 max_sequence_tokens ← max_sequence_tokens key = prepared context; :210-213 max_new_tokens defaults to it; :225 fit_context (model.rs:261-273) clamps to pool; :226 catalog::validate → catalog.rs:42 limits.validate_prefill → scheduler.rs:66-77 rejects chunk > max_sequence_tokens.
- Evidence mode: runtime_core/memory.rs:290-292 default KvCacheLimit::Memory → Ok(None) (pages fill VRAM); :631-634 reads max_sequence_tokens from server config, so context|concurrency modes bind to the cap.
Verdict: worth it with changes (3 blockers, 6 should-fix). Design is the smallest-footprint version yet and correctly rides #545.