Case file — PR #461 "Document strict tool selection and numeric range precision"
https://github.com/NVIDIA/hyperflare-inference/pull/461 · author jcartu (CONTRIBUTOR) · branch pr/strict-numeric-bounds → main · head e831b49 · opened 2026-11-22 09:19, last updated 2026-11-23 15:29 · open, "ready for review", no labels · +39/−14 in 2 files · reviews: CHANGES_REQUESTED by yatesdr only · no CI checks on head.
Key findings
- The branch once did the opposite of what it now does, and the description does not say so. Commit
a640a302(2026-11-22) was titled "Bound strict function-tool numeric range keywords below 2^53" and implemented the reviewer's request to reject bounds ≥ 2^53; yatesdr's 2026-11-23 review called that rule over-restrictive, ande831b49("Preserve admission for large strict numeric bounds") replaced it with documentation only (PR #461 review thread;pr_diffshows no non-test code). A maintainer's explicit item from the #418 review — "apply the 2^53 limit to the four keywords and document it" — is therefore delivered as prose, not as a constraint fix. - The reviewer rejected the code change for a concrete reason: it would have 400'd schemas in use today. yatesdr's table (main
6d6fe0c6, aarch64 Linux, CPU only, viavalidate_strict_tool_schema+TextGrammar::validate) showsmaximum: 10^18,maximum: i64::MAXandmaximum: 2^53all exact, i.e. the ≥2^53 rule "refuses more than the gap it closes" and would reject "the int64 limits that generated schemas emit" (#461 review, 2026-11-23 15:04). - The compatibility claim is verified. "No requests accepted on
mainacquire a new HTTP 400" holds: the diff is one docs file plus one test (pr_diff), andunsupported_strict_literal(helios/src/grammar/strict.rs:176-192,LIMIT = 1<<53) is still called only from theconstbranch (342-353) andenumbranch (356-375), while the four range keywords only requirev.as_f64().is_some()— "must be a finite number" (strict.rs:575-584). - The central rounding claim is supported, but by the reviewer's evidence, not by an artifact in the PR. Two examples —
exclusiveMinimum: 9007199254740992admitting the endpoint,minimum: 9007199254740993admitting 9007199254740992 — come only from yatesdr's review table; the description cites that review rather than reproducing the experiment, and nothing in the repo records a run. The mechanism (llguidance f64 normalisation of integer bounds) is cited in #418's review to llguidance-1.9.1src/json/numeric.rs:509-534(not opened); Helios itself never rounds bounds. The inclusive half of the claim (maximum: 9007199254740992is exact) is backed by an existing regression test,strict_bounds_do_not_round_integers_or_fractional_multiples(strict.rs:3005-3021). - The new test partly duplicates existing coverage.
strict_bounds_do_not_round_integers_or_fractional_multiples(strict.rs:3006-3016) already assertsmaximum: 9007199254740992accepts the endpoint and rejects9007199254740993;strict_integer_maxima_preserve_large_inclusive_endpoints(strict.rs:3888-3900) extends the same shape to10^18andi64::MAX. The description calls this "existing regression unchanged" (true) but does not say the new test is an extension of, not a gap in, existing coverage. - The new prose over-generalises in one respect the reviews document. docs/api.md:605-612 says the four range keywords "are interpreted at binary64 precision", but yatesdr's table also reports that
minimum: -9223372036854775808onintegerandminimum: 2^60onnumberare "already refused by llguidance with a range error" — an admission failure the new paragraph does not mention, so a reader may expect those schemas to be accepted approximately. - Docs hunks verified as correct against the admission path. For
ToolChoice::Named,helios/src/server/request.rs:225-241keeps only the selected tool and setsstrict_schema: tool.strict.then_some(&tool.parameters); if any strict tool is active, lines 249-279 compile a request grammar withrequire_call: matches!(tool_choice, Required | Named(_)). So the removed sentences ("adding no instructions or decoding constraints", "Sampling is unchanged;") were wrong exactly as yatesdr flagged in #418, and the replacements match the code. - Process risks: no CI on head and the review is still outstanding.
.github/workflows/native-serving.yml:63 (not opened),68runs the Heliosruntime-core,serversuite on everypull_request, so the new test would be exercised — the orientation packet reports no checks one831b49. yatesdr's review remains CHANGES_REQUESTED; the author's "Ready for another look" (2026-11-23 15:29) has had no reply in this material.
The change
Two files, +39/−14, no production logic (pr_diff, result 4).
docs/api.md:
- Named selection paragraph (~520-524): "retaining conversation history and adding no instructions or decoding constraints" → "adding no separate call instruction. Selection by itself adds no decoding constraint; when the selected function sets
strict: true, it attaches the strict request grammar described below." - Required mode paragraph (~540-553): "Sampling is unchanged;" deleted; now "No calls are fabricated… Required mode by itself leaves sampling unconstrained; any active
strict: truefunction still attaches the strict request grammar described below." The paragraph is also re-wrapped (line reflow), which inflates the diff. - Strict schema section (~599-603):
const/enumrule shortened — "parsed at IEEE 754 binary64 precision and must have magnitude strictly below2^53(9,007,199,254,740,992, so integer literals lie in[-9,007,199,254,740,991, 9,007,199,254,740,991]; pass larger exact identifiers or higher-precision decimals as strings)" → "parsed at binary64 precision and must have magnitude strictly below2^53. Use strings for identifiers or decimal values that must be represented exactly." Specificity is lost: the explicit interval, the decimal expansion, and "IEEE 754" are gone. - New paragraph at docs/api.md:605-612 on binary64 range bounds, the two rounding examples, the exact inclusive-maximum case, and "If exact enforcement of a large numeric bound matters, validate the tool arguments with exact arithmetic before executing the tool."
- "With an active strict tool, TMLv0 recognizes only declared tool names…" sentence merely re-wrapped (614-615).
helios/src/grammar/strict.rs:3888-3900, test-only:
#[test]
fn strict_integer_maxima_preserve_large_inclusive_endpoints() {
let compiler = GrammarCompiler::new(&byte_tokenizer(), 320, &[256, 257], &[]).unwrap();
for maximum in [1_000_000_000_000_000_000u64, i64::MAX as u64] {
let schema = json!({"type":"object","additionalProperties":false,"required":["n"],
"properties":{"n":{"type":"integer","maximum":maximum}}});
let grammar = validate_strict_tool_schema(&compiler, "measure", &schema).unwrap();
grammar.validate(&json!({"n": maximum}).to_string()).unwrap();
assert!(grammar.validate(&json!({"n": maximum + 1}).to_string()).is_err());
}
}
It sits immediately before strict_const_and_enum_enforce_exact_integer_range (3900).
Description vs. change. The description's "What changed" matches the docs. What it does not say: that the branch earlier contained the opposite code change and that it was reversed (finding 1); that the new test extends existing coverage (finding 5); that the const/enum paragraph was substantively simplified rather than only reworded. Its Compatibility section's promises are accurate.
The why
- Origin: issue #417 (closed 2026-11-22, by Napuh,
area:api, enhancement) —strict: truefunction tools returned HTTP 400, making Flare unusable for pydantic-ai, which marks tools strict by default, while vLLM/xgrammar handled the same requests. yatesdr ruled out accept-and-ignore "even behind a flag". - #418 (merged 2026-11-22 04:43, +6048/−128, 16 files) implemented strict grammars, creating
helios/src/grammar/strict.rs, and went through four rounds of CHANGES_REQUESTED. - In #418's final round (2026-11-21 23:03) yatesdr left two open items: (1) "Numeric bounds have the same limit … Please apply the 2^53 limit to the four keywords and document it with the
constlimit", citing llguidancecompile_numericandnormalize_integer_bounds; (2) twodocs/api.mdsentences that contradict strict tools. - jcartu opened #461 on 2026-11-22 09:19 explicitly as the follow-up for items 1 and 2. So the change is maintainer-requested and documentation-correcting — the two categories the project charter accepts.
Related work
- #418 (merged) is the parent and author of the text being edited; #461 is stacked on it in content only (base
main6b58639 already contains the docs text). - #417 (closed issue) is the consumer-facing motivation, closed by #418.
- #457 (open, brandonmmusic-max) modifies
helios/src/grammar/strict.rs(+134) and adds tests inside the samemod testsblock, and touchescompile_strict_tmlwhich #461 does not. Different regions, so no textual conflict; merge order changes neither behaviour. - #404 (open, same author) shares only docs/api.md, in unrelated sections.
- #478 (merged) is the most recent commit touching docs/api.md; it edits the decision-label paragraphs near the end of the file and does not overlap these hunks.
- No competing proposal exists: no other PR or issue proposes either rejecting or documenting large numeric bounds. Remaining strict-tool debt elsewhere is
docs/TODO.txt:25-28(unrun served TMLv0 qualification), untouched. - The only work #461 itself reverses is its own first commit
a640a302; nothing else inmainis undone.
Recent activity
- docs/api.md and helios/src on
mainhave moved recently (prefix-cache work #416, doctor/CLI work by Luke Alonso, TML changes #478, #457 in flight), but not in the tool-schema sections this PR edits. - On
main, docs/api.md still carries the exact sentences being replaced: "adding no instructions or decoding constraints" (~520-523), "Sampling is unchanged;" (~540-542), and the #418-eraconst/enumparagraph (~597-600). Nothing onmaincontradicts the PR. - The branch predates #478; its hunks do not overlap, so a rebase is mechanical.
- Verified as of head
e831b49: no second document repeats the2^53bound claim — the only hits for "2^53"/binary64 indocs/are in docs/api.md, so no stale duplicate claim is being left behind.
People
- jcartu (author, CONTRIBUTOR): #418 (strict tools, merged), #416 (prefix-cache recency, merged), #404 (activation steering, open). #461 is the cleanup of his own largest merged contribution. Maintainers have previously asked him to shift mechanism changes toward maintainer-approved contracts (lukealonso on #404), and the repo's AGENTS.md and repo-prose skill ban change chronology in prose — his #418 review history also included a DCO sign-off hold.
- yatesdr (COLLABORATOR; 46 docs commits and 43 helios/src commits in 180 days): the sole reviewer here and in all four #418 rounds; the maintainer voice on strict tools; runs aarch64 CPU test suites himself to check authors' claims. Also authored nearby docs work (#405, #478).
- No other reviewers, commenters, or reactions have engaged with #461.
Community
- One review, one answer, no further comments, no reactions recorded, no labels (
pr_comments,read_item 461). - The review is substantive: it accepts the docs half ("The
docs/api.mdchanges settle the two sentences our #418 review flagged") and rejects the code half with measured evidence and two alternative asks, plus a "Nit" about the commit message narrating #418's provenance and citing a commit not in this repository. - The author's answer takes the documentation alternative and notes "the PR description no longer cites unrelated timing results" — i.e. he accepted the nit.
Project fit
- Charter, "What gets merged": maintainer request, roadmap item, reproducible bug, measured performance/memory, or bad docs (#461 is the last two of those). Fits.
- Charter, "Keep the runtime small and model-agnostic": unaffected — no per-model branch, no runtime code.
- Charter, "Don't silently ignore API fields": #417 is the case that produced strict tools. #461 documents that admitted large bounds are approximated rather than applied exactly. A reader could read this as documenting around a known divergence from JSON Schema — the charter lists JSON Schema among targeted standards — rather than closing it.
- AGENTS.md:160-162 and :202 ("Every contribution must address an explicit maintainer request, a demonstrated defect, a measured performance or memory problem, or inaccurate documentation"; apply the same bar to documentation changes). Satisfied.
- AGENTS.md:47-55 asks unresolved defects and pending measurements to be recorded in
docs/TODO.txt, not in design documents. The rounding limitation is a permanent property of current behaviour (it exists until llguidance changes), so api.md is a defensible home, but nothing was added todocs/TODO.txtand no follow-up item tracks the llguidance rounding anywhere.docs/TODO.txt:25-28still carries the separate unrun TMLv0 strict qualification. - AGENTS.md:189-194 asks for explicit statement of unrun checks: the description says "No GPU benchmark was run; there is no performance claim." Complies.
- Repo-prose skill ("documentation is a present-state specification, not a changelog"): the docs hunks are present-state and pass. The description's review URL and Discord handle are normal for this repo.
Claims and evidence
Verified in the repository at head e831b49:
- The diff is docs + one test; therefore "no new HTTP 400" is structurally true (
pr_diff). unsupported_strict_literal(strict.rs:176-192) applies the1<<53magnitude test and is reached only forconst(342-353) andenum(356-375).- Range keywords are only checked for finiteness (strict.rs:575-584); Helios neither rejects nor rounds them, so any rounding is llguidance's, and docs/api.md:605-612 describes
main's real behaviour. - The existing test
strict_bounds_do_not_round_integers_or_fractional_multiples(strict.rs:3006-3021) assertsmaximum: 9007199254740992→ accepts9007199254740992, rejects9007199254740993, matching the docs' "inclusive maximum distinguishes the endpoint". - Named/required selection does attach a grammar when a strict function is selected (request.rs:225-241, 249-279), so the two corrected sentences were wrong before.
- The claimed "28 passed, 0 failed, 1 ignored" is consistent:
mod tests(strict.rs:2458) has 29#[test]functions — 2489, 2551, 2802, 2932, 2972, 2980, 3005, 3027, 3041, 3095, 3106, 3160, 3217, 3230, 3243, 3264, 3281, 3350, 3405, 3452, 3594, 3723, 3819, 3888 (new), 3900, 3989, 4073, 4242, 4354 — of which exactly one is#[ignore](4354-4356, needsFLARE_DEEPSEEK_TEST_SNAPSHOT). 28 + 1 = 29. - CI would run the new test:
.github/workflows/native-serving.yml:63 (not opened),68executescargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,serverfor everypull_request; the orientation packet reports no checks on this head, so it has not run yet.
Rests on participants, not reproduced here:
- The two rounding rows (
exclusiveMinimum: 9007199254740992admitting the endpoint;minimum: 9007199254740993admitting 9007199254740992) — yatesdr's aarch64 run at6d6fe0c6, which is also the sole support for the description's central factual claim. - The reviewer's note that llguidance refuses
minimum: -9223372036854775808onintegerandminimum: 2^60onnumber— relevant because the new prose does not mention those admission errors. - The author's x86_64 test run itself (count consistent, not executed here).
- DCO
Signed-off-bypresence ona640a302/e831b496(commit messages not visible in this environment; CONTRIBUTING.md requires sign-off on every commit and yatesdr enforced it on #418). - Whether named selection also injects prompt text (frontend template side); the new "adds no separate call instruction" wording is plausible but not fully verifiable from
request.rs.
No performance claim is made and none is needed. There is no benchmark, no GPU work, and no new dependency (llguidance remains pinned at =1.9.1, helios/Cargo.toml:62).
Reach
- No runtime behaviour, wire format, default, status code, dependency or deployment change. Nothing for operators to configure.
- Users affected through documentation only: clients using OpenAI/Anthropic-style strict tools (pydantic-ai and similar frameworks from #417) learn that a strict function under named or required selection still attaches a grammar, and that large numeric range bounds are approximate. The actionable new guidance is "validate the tool arguments with exact arithmetic before executing the tool" when a large bound matters.
- The
const/enum≥2^53 rejection remains an admission-time HTTP 400 for schemas OpenAI's strict mode would accept; the PR now says so in prose and tells clients to use strings, but does not change it. Anyone who wanted the opposite (reject approximate bounds) is told to validate client-side instead. - The added test guards the documented behaviour for very large inclusive maxima, which is exactly what a future tightening of the 2^53 rule would break.
Process
- Open, "ready for review", two days old at last update; no labels; no CI checks on head
e831b49; one review, CHANGES_REQUESTED, unanswered since the author's 2026-11-23 15:29 reply. - The review's two asks were (a) refuse only the bounds llguidance rounds, or (b) leave admission as is and document — the author took (b), which yatesdr explicitly offered; whether the reviewer considers that sufficient is unresolved in the material available.
- The nit about the commit message narrating #418's provenance was addressed by the author in the description.
- The docs half of the review was accepted by the reviewer; only the numeric-bound half changed shape.
Open questions / not found
- Will yatesdr approve the documentation-only resolution, given the review that rejected his own option-1 wording (or does he expect the narrower "refuse only the bounds llguidance rounds" rule)?
- No artifact in the PR reproduces the two rounding examples; only the reviewer's table. No test in the repo asserts the approximate cases, so a future llguidance upgrade could silently change behaviour the docs now promise — no TODO entry tracks this.
- Was DCO sign-off present on both commits? Commit messages were not visible here.
- Does the simplification of the
const/enumparagraph (dropping the explicit±(2^53−1)integer interval and the "higher-precision decimals" phrasing) lose information the #418 reviewers wanted documented precisely? - Why has CI not run on this head in a repository whose workflow covers every
pull_request?