Explore report · NVIDIA/hyperflare-inference #575

Raw Markdown for agents: https://autobot.eidonix.com/p/0223f9b0-18b4-4bd2-917d-4735eda515cc.md

Case file — PR #575: Preserve raw JSON tool arguments in TmlOutput for strict TMLv0 calls

PR: https://github.com/NVIDIA/hyperflare-inference/pull/575 · author fordbmorris (commit author woooflet) · branch pr/tml-output-raw-json-args · head 07955d7 · base main, rebased onto 167f22c · opened 2026-11-28 · open, ready for review, 3 files, +237 / −10 · no labels, no reviews, no CI checks.

Key findings

  1. The change does more than the description says for non-strict TMLv0 calls. TmlOutput::call (helios/src/output/tml.rs:329-363) is the parser for every TMLv0 tool call; strict validation happens much later in OutputEncoder (helios/src/server/protocol/encode.rs:517-553). Switching the emit from args.to_string() to args.to_owned() means non-strict TMLv0 arguments also stop being normalized by serde: whitespace inside the object, number spellings (e.g. 1e20 vs 1.0), escape spellings and duplicate keys inside args now reach the client verbatim. Only the >64-bit-integer precision case is cited as motivation.
  2. It also newly rejects duplicate wrapper keys, which the description frames as preserved prior behaviour. The old object.len() == 2 check accepted {"name":"x","name":"x","args":{}} (serde collapses duplicates into a 2-entry map); the new #[serde(deny_unknown_fields)] struct RawCall (tml.rs:330-336) fails it and falls back to visible text. That is a tightening, not "matching prior TMLv0 recovery semantics".
  3. "Preserves property order" is not new. helios/Cargo.toml:52 already enables serde_json's preserve_order, so the old Value round-trip already kept insertion order. The same line already enables raw_value, so the change adds no dependency feature.
  4. The live evidence is not reproducible from the repo. The Rust counts (7/7, 28/28, 2/2, 5/5), the "35/35 live 4-Spark TP4" run and the "6/6 invalid-schema HTTP 400 admissions" appear nowhere in the diff or repo; the committed tests/server/test_inkling2.py contains one new test with about five assertion groups, and no CI workflow runs pytest at all, so it only ever runs manually against a live 4×GB10 service (skipif gate at tests/server/test_inkling2.py:23-26). Only the two new Rust unit tests are actually executed by CI (.github/workflows/native-serving.yml:63 (not opened)).
  5. Related in-flight work touches the same function. #457 (open, brandonmmusic-max) rewrites the same TmlOutput::call and the same strict TMLv0 grammar on its own branch and still uses args.to_string(). Neither PR supersedes the other; whoever merges second resolves a conflict in TmlOutput::call and in the mod tests block of tml.rs. #461 (open) documents the adjacent numeric-precision boundary but leaves unbounded integer properties — exactly #575's case — unrestricted.
  6. docs/TODO.txt:5-8, the tracked item the PR says it "addresses", is not edited. It stays open after merge unless a maintainer ticks it; AGENTS.md:57-60 directs qualification scope into docs, and reviewers required exactly that of #418 and #457.
  7. Two residual precision paths remain unfixed and undisclosed: Anthropic Messages tool_use.input still re-parses arguments through serde_json::Value (encode.rs:328-335), and the prompt-side TML renderer re-serializes arguments when replaying a prior assistant turn (helios/src/frontend/tml.rs:148-174, write_json :71-117).
  8. Provenance and attention. First-time contributor (GitHub association NONE), four unrelated PRs opened the same day (#574, #575, #576, #577), none reviewed. Zero comments/reviews/reactions on #575 and no flare-autobot case file, whereas #457 and #461 both drew CHANGES_REQUESTED autobot reviews within about two days. CI did not trigger on the head commit.

The change

Size and shape. pr_files: helios/src/grammar/strict.rs +105/−0 (test only), helios/src/output/tml.rs +41/−10, tests/server/test_inkling2.py +91/−0 (one new live test).

Before: TmlOutput::call parsed the invoke body into serde_json::Value, required an object of len() == 2 with a string name and an object args, and emitted args.to_string().

After (verified, helios/src/output/tml.rs:329-363): a function-local #[derive(Deserialize)] #[serde(deny_unknown_fields)] struct RawCall<'a> { name: String, #[serde(borrow)] args: &'a RawValue }; serde_json::from_str(body).ok()?; then three guards — args.get().starts_with('{'), the tool name must appear in self.tools (tool["function"]["name"] == parsed.name), and the optional recipient header must equal name (self.name.as_ref().is_some_and(...)) — before emitting ToolBegin / ToolArguments { text: args.to_owned() } / ToolEnd. Any failure returns None, and call_or_text (tml.rs:318-327) then emits the body as visible Content. The struct is local, so no public API change; #[serde(borrow)] keeps it zero-copy.

Tests added. helios/src/output/tml.rs:608 call_preserves_raw_json_arguments_including_arbitrary_precision_integers (also asserts a duplicate "name" key falls back to visible text); helios/src/grammar/strict.rs:3820 tml_strict_parser_preserves_30_digit_integers (GrammarCompiler + OutputPipeline + strict TextGrammar validation across top level, anyOf, $ref, and nested array/object, asserting the 30-digit value survives). tests/server/test_inkling2.py adds test_strict_tml_tool_calls_and_truncation (~91 lines): Chat Completions buffered + streamed, max_tokens=10 truncation, Responses buffered, max_output_tokens=10 truncation.

Why the fix works (worth stating because it is the real correctness argument): the strict wire grammar emits {"name": …, "args": …} itself (embed_schema_in_tml_wrapper, helios/src/grammar/strict.rs:873-892), so forwarding the raw bytes means the encoder validates the exact text it produced.

What the description does not say — see Key findings 1-3, plus:

The why

Per the PR body: with ToolParserKind::TmlJson (Inkling 2) and a strict: true tool whose schema declares an unbounded {"type": "integer"}, constrained decoding may emit a 30-digit integer such as 123456789012345678901234567890. The old serde_json::Value round-trip (no arbitrary_precision feature anywhere in the repo) renders it as binary64 1.2345678901234568e29; OutputEncoder re-validated that against the compiled strict TextGrammar, saw a float where an integer was required, and failed the live request with HTTP 500.

Verified chain for that failure: the message format is helios/src/grammar.rs:653 format!("{subject} does not match its grammar") with subject "strict tool arguments" (grammar.rs:632-636); it is raised from OutputEncoder (encode.rs:539-541) and surfaced as StatusCode::INTERNAL_SERVER_ERROR (helios/src/server/http.rs:278 (not opened)) — i.e. a server fault, matching the description.

Dated demand timeline: #417 filed 2026-11-20 (strict tools rejected outright; "several common clients send strict: true by default, so they cannot use Flare at all") → #418 merged 2026-11-22 adding strict tools for DSML/Qwen/GLM/TMLv0, whose body states no TMLv0 core was served and which added docs/TODO.txt:5-8 → #575's single commit dated 2026-11-26, PR opened 2026-11-28. So the gap was acknowledged six days before this PR; the demand is a tracked TODO item plus a prototype-serving need, not a user bug report — no issue in the local copy reports the >64-bit rounding or the strict-grammar 500.

Recent activity

People

Community

Zero comments, reviews or reactions on #575 (its discussion is empty), in contrast to #457 and #461, each of which drew an autobot case file and a CHANGES_REQUESTED review within about two days. Demand for the underlying fix is visible only indirectly: #417's "clients cannot use Flare at all", the open docs/TODO.txt:5-8 item, and #461's documentation of the precision boundary. The PR is follow-on polish to a feature merged six days earlier, not a response to a filed report.

Project fit

Claims and evidence

Verified in the repository:

Claimed but not reproducible from the repo:

Reach

Process

Open questions / not found