Repository navigation
Conversation
yatesdr
left a comment
There was a problem hiding this comment.
Thanks. Checked a640a30. The docs/api.md changes settle the two sentences our #418 review flagged: named and required selection now say a strict function still attaches its grammar.
The admission rule refuses more than the gap it closes. On main 6d6fe0c we ran a scratch test through validate_strict_tool_schema and TextGrammar::validate (aarch64 Linux, CPU only), on integer properties:
| Bound | Value tried | Result on main |
|---|---|---|
exclusiveMinimum: 9007199254740992 |
9007199254740992 | accepted (schema forbids it) |
minimum: 9007199254740993 |
9007199254740992 | accepted (schema forbids it) |
maximum: 9007199254740992 |
9007199254740992 / 9007199254740993 | accepted / rejected (exact) |
maximum: 1000000000000000000 |
10^18 / 10^18 + 1 | accepted / rejected (exact) |
maximum: 9223372036854775807 |
2^63 - 1 / 2^63 | accepted / rejected (exact) |
minimum: -9223372036854775808 on integer, and minimum: 2^60 on number, are already refused by llguidance with a range error.
- Exact bounds become HTTP 400s. Rejecting every magnitude at or above 2^53 also refuses the exact rows above, including the int64 limits that generated schemas emit. The PR changes main's own test from
maximum: 9007199254740992to9007199254740991so that it passes. Please refuse only the bounds llguidance rounds: an exclusive integer bound at or above 2^53, and a bound whose value does not survive conversion to f64 and back. Or leave admission as it is and document the limit, whichdocs/api.mdnow states. - Compatibility. Whatever remains, please say in the description which requests accepted today now return HTTP 400.
Nit: the commit message's section on #418's timing provenance describes #418's evidence, not this change, and cites a commit that is not in this repository. It belongs on #418's thread, if anywhere.
|
@yatesdr I took the documentation alternative from your review. At e831b49 the net runtime diff against the PR base is empty: no new HTTP 400s. The original inclusive 2^53 test is unchanged, and the new regression accepts 10^18 and i64::MAX at the endpoint and rejects each successor. The strict grammar suite passed on x86_64 (28 passed, 1 ignored). The API docs identify the two rounding cases rather than claiming they are fixed; the PR description no longer cites unrelated timing results. Ready for another look. |
|
A case file has been opened for 461 To opt out, include #autobot:ignore in the PR or any comment. |
Changes RequestedBlockers:
Should fix:
Nits:9 nits
To opt out of future reviews, put #autobot:ignore in your response. |
Named and required `tool_choice` modes do not by themselves constrain token sampling, while `compile_strict_validators` compiles every declared `strict: true` tool schema at request admission regardless of `tool_choice` (including unselected tools and `tool_choice: "none"`). Separately, strict numeric `enum` and `const` literals enforce an exact magnitude cap below `2^53`, whereas `llguidance =1.9.1` interprets `minimum`, `maximum`, `exclusiveMinimum`, and `exclusiveMaximum` at IEEE 754 binary64 precision and rejects bounds outside its numeric range. Rejecting all range bounds at or above `2^53` would reject inclusive integer maxima such as `2^63 - 1` (`i64::MAX`) that the grammar enforces exactly; documenting the admission scope, binary64 rounding cases, and refused range bounds preserves valid large maxima without misstating exactness. Changes against `main`: - `docs/api.md`: state that named and required selection add no decoding constraint by themselves, define an active `strict: true` function tool once, state that every declared `strict: true` schema must be admissible even when unselected or under `tool_choice: "none"`, separate the `< 2^53` `enum`/`const` restriction from IEEE 754 binary64 range-bound behavior, document both rounded bounds (`minimum: 9007199254740993`, `exclusiveMinimum: 9007199254740992`) and admission-refused bounds (`minimum: -9223372036854775808` on `integer`, `minimum: 1152921504606846976` on `number`), and advise exact arithmetic validation before tool execution when large bounds can round. - `docs/TODO.txt`: record the unresolved `llguidance` IEEE 754 binary64 range-bound rounding and range-limit gap and its closure criterion. - `helios/src/grammar/strict.rs`: extend `strict_bounds_do_not_round_integers_or_fractional_multiples` to pin exact inclusive integer maxima (`10^18`, `i64::MAX`), the documented `minimum` and `exclusiveMinimum` rounding cases, and admission rejection of `minimum: -2^63` on `integer` and `minimum: 2^60` on `number`. Claimed result: runtime admission and decoding behavior are unchanged; the API reference and `docs/TODO.txt` match Helios admission and `llguidance =1.9.1` range behavior, and unit tests fail visibly if a dependency update alters the documented outcomes. Evidence: `cargo test --locked --manifest-path helios/Cargo.toml --features runtime-core,server --lib grammar::strict` passed on Linux x86_64 CPU (27 passed, 1 ignored). No production runtime code changed; GPU serving was not run. Design-Signed-Off-By: Gemini 4 Carbon (agent for Josh Cartu); design-review=c3a9 Signed-off-by: Joshua Cartu <[email protected]>
e831b49 to
31c9020
Compare
|
@flare-autobot Addressed all review items on rebased
|
Why
Named and required
tool_choicemodes do not by themselves constrain token sampling, whilecompile_strict_validatorscompiles every declaredstrict: truefunction schema at request admission regardless oftool_choice(including unselected tools andtool_choice: "none"). Separately, strict numericenumandconstliterals enforce an exact magnitude cap strictly below2^53, whereasllguidance =1.9.1interpretsminimum,maximum,exclusiveMinimum, andexclusiveMaximumat IEEE 754 binary64 precision and rejects bounds outside its supported numeric range. Rejecting every range bound at or above2^53at admission would reject inclusive integer maxima such as9223372036854775807(2^63 - 1) that the grammar enforces exactly; documenting the admission scope, binary64 rounding cases, and refused range bounds preserves valid large maxima without overstating exactness.What changed
docs/api.md: states that named and required selection add no decoding constraint by themselves; defines an activestrict: truefunction tool once; states that every declaredstrict: trueschema is validated at admission even when unselected or undertool_choice: "none"; separates the< 2^53enum/constliteral limit from IEEE 754 binary64 range-bound interpretation; documents both rounded bounds (minimum: 9007199254740993,exclusiveMinimum: 9007199254740992) and admission-refused bounds (minimum: -9223372036854775808oninteger,minimum: 1152921504606846976onnumberreturning HTTP 400); and advises exact arithmetic validation before executing a tool when large admitted bounds can round.docs/TODO.txt: adds an entry tracking exact decimal enforcement or explicit rejection ofstrict: truenumeric range bounds above2^53and its closure criterion.helios/src/grammar/strict.rs: extendsstrict_bounds_do_not_round_integers_or_fractional_multiplesto pin exact inclusive integer maxima (10^18,i64::MAX), the documentedminimumandexclusiveMinimumbinary64 rounding cases, and schema-admission rejection ofminimum: -2^63onintegerandminimum: 2^60onnumber.Claimed result
Runtime admission and decoding behavior are unchanged relative to
main. The API reference anddocs/TODO.txtaccurately describe strict-tool admission scope, active-grammar attachment, and IEEE 754 binary64 numeric range behavior, and unit tests pin the documentedllguidance =1.9.1outcomes so any upstream change surfaces immediately.Evidence
cargo test --locked --manifest-path helios/Cargo.toml --features runtime-core,server --lib grammar::stricton Linux x86_64 CPU (rustc 1.100.0): 27 passed, 1 ignored (includingstrict_bounds_do_not_round_integers_or_fractional_multiples).Discord: jcartu