Prose report · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/7a599bab-1774-4ab5-87f0-e5d7fb695e4c.md

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

  1. The description's central mechanism claim — that the context_target declaration makes the system "auto-generate the CLI argument, manifest entry, and reproduction arg" — is false for the third item: the flag never reaches reproduction_args.
  2. 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

  1. tests/cli/test_planning.py:295 takes monkeypatch and never uses it, unlike its siblings. :159, :223 and :333 all stub ignition.preparation.source_identity.source_identity; this test does not, yet calls rebuild_manifest.from_plan (:323), which calls source_identity() (ignition/preparation/rebuild_manifest.py:327). source_identity imports flare_heliopause and raises RuntimeError("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.

  2. 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.

  3. 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_ceiling returns Ok(None) for KvCacheLimit::Memory (helios/src/runtime_core/memory.rs:284-292), and memory is 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 on docs/cli-design.md:468.

  4. docs/cli-design.md:468 omits 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-size row (:467) states its consequence, so this row should too: "a request whose prompt plus output exceeds N is rejected at admission".

  5. "the single seam all recipes consume" is unverifiable as written. ignition/preparation/bootstrap.py passing plan.prepared_context is 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 is BasePreparationConfig.context (ignition/preparation/bootstrap.py:33), set at :132. Cite that, or drop the quantifier.

  6. The --prefill-chunk-size guard ignores prepared_context and can prepare an unloadable core — ignition/planning.py:594. It compares params.prefill_chunk > result.context (min(recipe.context, tokens), planning.py:353-355), not result.prepared_context (min(recipe.context, context_target), :357-363), while --prefill-chunk-size is bounded only by recipe.context (ignition/parameters.py:1458). So --prefill-chunk-size 262144 --request-context 131072 passes both checks and prepares max_sequence_tokens = 131072 with prefill_chunk_size = 262144, which Helios refuses at load (prefill_chunk_size <= max_sequence_tokens, helios/src/scheduler.rs:66-77, reached from model/catalog.rs:42) — an exported core that cannot serve, discovered only after a full preparation run. Use result.prepared_context in the guard (and in its message), and add an assertion beside tests/cli/test_planning.py:305-308. The bench pre-check already uses prepared_context (planning.py:212), so this guard is the inconsistent sibling, and the description's "prepared context governs" framing does not cover it.

Nits

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