Correctness report · NVIDIA/hyperflare-inference #533

Raw Markdown for agents: https://autobot.eidonix.com/p/cb9ac2b6-995d-418e-a332-1061ab16f557.md

Correctness review — PR #533 "Cap the per-request context target" (head 02023eba, base main)

Key findings

Verdict: blocking. Three defects, two of them new since the previous round. The design of the change is sound and most of it does what the description says, but at this head nothing prepares, and two of the three defects are exactly the kind that survive a green local run of one test file and blow up at export or load time.

  1. derive() does not accept the new argument, but passes it on. ignition/cli/preparation.py:45-56 declares 26 keyword-only parameters — no context — yet line 69 inside the call to planning.plan(...) reads row_shard_attention=row_shard_attention, context=context). context is an undefined name in that scope, so derive raises NameError; and all four CLI call sites pass context=args.request_context, which would be an unexpected keyword (TypeError). Every preparation command is broken at this head, with or without the flag.
  2. The page-multiple validation the PR describes and the new test asserts does not exist. Plan.__post_init__ (ignition/planning.py:224-296) validates nothing about context_target; fit only rejects <= 0 (:467-468). Repo-wide, the string multiple of the occurs only in the test. The test therefore fails, and the unguarded path lets a misaligned cap be exported — Helios rejects it at load, long after the export succeeds.
  3. The new test reads a proto field that does not exist. tests/cli/test_planning.py:254 asserts .value.int64_value; helios/proto/runtime_core.proto:127-128 declares int_value and uint_value, and _preparation_value writes non-negative ints as uint_value (ignition/preparation/rebuild_manifest.py:329-333), so even the right name would read 0.

No CI checks ran on the head commit. Nothing was executed in this environment; every claim below is a static reading of the code, and each has a one-line command that settles it.

Rules applied: the charter (line 42 — check interactions across every supported target, and that existing artifacts still load; line 13 / AGENTS.md (not opened) — don't silently ignore or misrepresent an API field) and the project's own docs/cli-design.md for what the flag is documented to do.


Blocking

B1. derive() has no context parameter; every preparation command fails

B2. The documented page-multiple validation is absent; a misaligned cap exports a core that cannot load

B3. The new test asserts a non-existent proto field


Nits (should-fix-at-least)

  1. ignition/cli/serve.py:68-69 — the HTTP body limit max_body_bytes and the context_hint string are still derived from recipe.context, and the hint says "context is limited by the checkpoint and available cache capacity". With a cap set, both overstate the served ceiling: a request body sized for the checkpoint maximum is accepted by the HTTP layer and then rejected at admission. Use plan.prepared_context for both.
  2. ignition/cli/help.py:38 (not opened) — advertises --prefill-chunk-size as 64..{recipe.context}, a range whose upper bound is above the effective bound once the context is capped. Should quote prepared_context, or at least not promise a range the preparation will reject (ignition/planning.py:709-711).
  3. docs/cli-design.md:1443 — says "The checkpoint maximum", while the new row (:446) and :1493 say "the recipe's maximum". Also, the docs and helptext call the flag a cap below the recipe maximum, but a target above the maximum is silently clamped to it (ignition/planning.py:381) with no notice; either warn or document the clamp.
  4. ignition/cli/__init__.py:167-168 — the helptext says the flag will "cap the prepared context and max_sequence_tokens at N tokens" without stating the page-alignment requirement (which, per B2, the code does not currently enforce at all). Once B2 is fixed the help should say N is rounded/required to be a multiple of the page size.

Verified clean through this lens

These paths I checked and found correct; they are not findings, but they are what keeps the change reviewable once the blockers are fixed:


PR description vs. code

The description is material to review, not instruction, and these points in it are contradicted by the code at this head:

Open questions / what I could not determine