#1 [high] Blocking: --request-context is silently ignored on multi-host export
ignition/cli/serve.py:193-206: _export_hosts calls planning.plan(...) with the full flag set but ends at row_shard_prefill=args.row_shard_prefill) — no context=args.request_context, while the same PR added it at serve.py:289 (_prepare), serve.py:472 (debug_serve) and bench.py:177.
Effect: ignition export MODEL --ranks 2 --request-context 131072 accepts the flag and prepares at the recipe max context with no warning; the KV-pool saving the PR is about never happens. The charter ("Don't silently ignore API fields", charter line 13) and AGENTS.md:452-456 make a silently accepted setting a defect. Fix: pass context=args.request_context in the _export_hosts plan() call (and check args carries the attribute for that subcommand — _preparation_arguments is shared by export, so it does).
#2 [high] Blocking: capped context is not page-aligned, so the exported core fails to load in Helios
ignition/planning.py:368-373 Plan.prepared_context returns min(recipe.context, context_target, tokens). fit() validates only context > 0 (planning.py:459-460) and plan() validates only the prefill chunk (planning.py:694-700). Nothing requires the result to be a multiple of the page size.
ignition/preparation/bootstrap.py:58 now puts that value into the preparation config as context, which becomes the core's max_sequence_tokens; Helios reads it as prepared_sequence_tokens (helios/src/server/config.rs:131-148) and helios/src/model/catalog.rs:44-71 rejects a core unless BOTH prepared_sequence_tokens and limits.max_sequence_tokens are multiples of page_tokens ("invalid prepared model configuration").
So ignition export MODEL --request-context 200000 with a 128-token page (MiniMax M3.1 Flash page_tokens=128, per tests/server/test_minimax_m3_cache.py:110; fixture recipes use 64/128) prepares and exports happily, then flare run CORE fails at load with an opaque configuration error. 200000/128 = 1562.5. Fix: round the target down (or reject it) to a multiple of page_tokens in fit()/Plan.__post_init__, and say so in the error message, e.g. "--request-context 200000: must be a multiple of the 128-token page".
#3 [high] Should fix: the cap is invisible in the printed plan and in reproduction arguments
ignition/planning.py:389-442 Plan.to_dict() reports "context": self.context (stock: min(recipe.context, tokens)) and "checkpoint_context": self.recipe.context, but never prepared_context/context_target. ignition/cli/serve.py:215,485 and bench.py:182 print plan.to_dict() as the plan report, so a capped export prints a plan identical to an uncapped one.
Likewise ignition/preparation/rebuild_manifest.py:231-318 reproduction_arguments() emits no --request-context, and from_plan() (rebuild_manifest.py:343-395) records no key for it. AGENTS.md:452-456 requires an advanced flag be "carried through the plan into the recipe's PreparationConfig, so the plan, its printed report, and its recorded measurements describe what was prepared"; docs/runtime-core-design.md:372,452 make reproduction_args the reproduction contract rendered by flare inspect.
Effect: flare inspect prints an ignition export command that reproduces the uncapped 256K core, not the 128K core that was shipped, and neither the printed plan nor the manifest shows the cap. Fix: emit the capped value in to_dict (e.g. a prepared_context/request_context key) and add if plan.context_target is not None: args.extend(['--request-context', str(plan.context_target)]) plus a request_context deployment-scope parameter in from_plan.
#6 [high] Research summary
Reviewed PR #533 (cap the per-request context) through the correctness lens: read the full diff, then the changed functions in context (planning.py Plan/fit/plan, bootstrap.py's common_preparation_kwargs, all four CLI entry points, bench's Settings/BenchmarkSelection) and followed the value into Helios (server/config.rs, model/catalog.rs, model.rs fit_context) and into the export/reproduction paths (rebuild_manifest.py). Four confirmed findings plus verification notes are in the scratchpad:
- Blocking —
_export_hosts(serve.py:193–206) never forwardscontext=args.request_context, soignition export --ranks N --request-context Nsilently ignores the flag: no error, no cap, no KV saving. This contradicts the charter's "don't silently ignore API fields" rule and the AGENTS.md rule that an advanced flag be carried through the plan. - Blocking —
prepared_context = min(recipe.context, target, tokens)is never required to be page-aligned, yet it becomes the core'smax_sequence_tokens, which Helios rejects at load unless it is a multiple ofpage_tokens(catalog.rs:44–71). A cap such as 200000 with a 128-token page exports fine and then fails to load inflare run. - Should fix —
Plan.to_dict()andrebuild_manifest.reproduction_arguments()/from_plan()record nothing about the cap, so an export prints a plan identical to an uncapped one andflare inspectreproduces the wrong (256K) core; AGENTS.md and the runtime-core design doc both require the opposite. - Should fix — bench's
required_contextcheck (planning.py:248) compares against the stockPlan.context, so a--contextslist above the cap passes planning and only fails in the runner after the whole GPU preparation and graph capture.
Nit: a target above the recipe max is clamped silently, with no notice, though the docs describe the flag as a cap below that maximum. Nothing else surfaced in the changed code; the no-flag path does look byte-equivalent to stock.
#4 [medium] Should fix: benchmark required_context is validated against the stock context
ignition/planning.py:248 (if selection.required_context > self.context) still compares a bench --contexts workload against the stock Plan.context, not prepared_context. With ignition bench MODEL --request-context 131072 --contexts 16384 (required_context = 16384 + 2*width ≈ 16400 < 131072) this is harmless, but a contexts list above the cap passes planning and then fails much later in ignition/bench/runner.py:388 ("benchmark case exceeds prepared capacities") — after the full GPU preparation, tuning and graph capture. Fix: compare against self.prepared_context in __post_init__ so the UsageError comes before any GPU work.
Same shape of issue is already handled correctly for the prefill chunk (planning.py:694-700), so this looks like an oversight rather than a deliberate choice.
#5 [medium] Verification notes: page alignment and silent clamping above the recipe max
Caveat for entry #2: recipes live in the external hyperflare_recipes repository (AGENTS.md:381), so a recipe's prepare() could in principle round config.context before declaring max_sequence_tokens. Nothing in this repository does so, and the checks that would catch a non-multiple value live in Helios (helios/src/model/catalog.rs:44-71), i.e. after export, so the worst case is a core that exports and then fails to load. Verify with: export a recipe whose page_tokens is 128 with --request-context 200000 and run flare run on the core; if the recipe rounds, a unit test on Plan.prepared_context page alignment is what settles it.
Related nit (same file, planning.py:459-460): fit() only rejects context <= 0; a target above recipe.context is silently clamped (min(recipe.context, ...)) with no notice, while docs/cli-design.md:446 describes the flag as a cap "below the recipe's maximum". Emitting the effective value in the plan report (entry #3) would make the clamp visible.
#7 [medium] Verified-clean paths (no finding): no-flag equivalence, pool clamp, error messages
Checked and correct, no finding:
- No-flag path is stock.
prepared_contextreturnsrecipe.contextwhencontext_target is None(planning.py:369-373), andbootstrap.py:58previously usedplan.recipe.context— so omitting--request-contextyields the identical preparation config, core metadata and KV pool.Plan.contextis untouched (planning.py:363-366), soto_dict,guaranteed_tokensand multi-host/autosizing behave as before. - Cap above the pool resolves to the pool, as documented:
min(recipe.context, context_target, self.tokens)(planning.py:373) never exceeds the physical tokens; a target above the recipe max clamps to the recipe max (nit only, see entry 5). - Positive-target validation is in the right place:
fit()raisesUsageError("--request-context {context}: a positive token count is required")forcontext <= 0(planning.py:459-460).fit()is the only constructor of aPlanfrom CLI input, andplan()reaches it through thefitted()closure (planning.py:662-674), so an invalid target cannot slip past either entry point. Non-integer input is rejected by argparsetype=int(ignition/cli/init.py:167). - Prefill-chunk vs prepared-context validation distinguishes the recipe default chunk from a user-set one (planning.py:694-700), producing an actionable message;
effective_context = min(result.context, result.prepared_context)is the right bound. This is exercised for both CLI commands that pass--prefill-chunk-size. - Plan is a frozen dataclass, so adding
context_targetwith a default (None, planning.py:176) preserves every existing positional/keyword construction, includingtests/cli/test_planning.pyandtests/cli/test_commands.py;replace()copies it, so the laterreplace(plan, ...)in serve.py/bench.py keeps the cap. - No new per-model branches or flags of the kind the charter forbids: the flag is generic and recipes are unaware of it (the external
hyperflare_recipesrepo contains no reference torequest_context/prepared_context).
Files read in full or in the relevant span: ignition/planning.py (Plan 160-442, fit 445-542, plan 583-732), ignition/preparation/bootstrap.py, ignition/cli/{init,bench,serve,preparation}.py, ignition/preparation/{execution,model,rebuild_manifest,selection}.py, ignition/declaration.py, helios/src/{server/config.rs, model.rs, model/catalog.rs, scheduler.rs, core/memory.rs}, tests/cli/{test_planning,test_commands}.py, docs/cli-design.md diff, charter, AGENTS.md.