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. |
e831b49 to
31c9020
Compare
|
@flare-autobot Addressed all review items on rebased
|
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 are capped strictly below `2^53`, whereas `llguidance =1.9.1` converts `minimum`, `maximum`, `exclusiveMinimum`, and `exclusiveMaximum` to IEEE 754 binary64 (and adjusts exclusive integer bounds with `+ 1.0` / `- 1.0` before casting to `i64`), which can round endpoints in either direction (for bounds with magnitude at or above `2^53`, or fractional `number` bounds beyond binary64 precision) or fail grammar compilation. Rejecting every range bound with magnitude at or above `2^53` at admission would reject valid inclusive integer maxima such as `2^63 - 1` (`i64::MAX`) that the grammar enforces exactly; documenting the admission scope, bidirectional binary64 rounding cases, and admission-refused range bounds preserves valid large maxima without misstating exactness. Before this change, `docs/api.md` stated that named selection adds no decoding constraints and that required mode leaves sampling unchanged, did not define an active `strict: true` function tool or state that unselected and disabled strict schemas are validated at admission, and did not describe IEEE 754 binary64 range-bound rounding or admission-refused range bounds. After this change: - `docs/api.md`: states that named and required selection add no decoding constraint by themselves while preserving the prompt-rendering split across Jinja-template, TMLv0, and native DeepSeek V4/V4.1 encoders; defines an active `strict: true` function tool once; states that every declared `strict: true` schema must be admissible even when unselected or under `tool_choice: "none"`; separates the `< 2^53` `enum`/`const` literal cap from IEEE 754 binary64 range-bound conversion; documents bidirectional rounding for bounds with magnitude at or above `2^53` (`minimum: 9007199254740993`, `exclusiveMinimum: 9007199254740992`, `maximum: 9007199254740993`) and fractional `number` bounds beyond binary64 precision (`minimum: 0.30000000000000001`), exact inclusive maxima (`2^53`, `10^18`, `2^63 - 1`), and admission-refused bounds (`minimum: -9223372036854775808` on `integer`, `minimum: 1152921504606846976` on `number` returning HTTP 400); and advises exact integer or decimal validation from the raw JSON argument text before tool execution while noting that post-validation catches over-admission but cannot recover values excluded by the grammar. - `docs/TODO.txt`: adds an entry recording the unresolved `llguidance` IEEE 754 binary64 range-bound rounding and compilation limits (magnitude at or above `2^53`, or fractional bounds beyond binary64 precision) in `helios/src/grammar/strict.rs` and its closure criterion covering both signs. - `helios/src/grammar/strict.rs`: extends `strict_bounds_do_not_round_integers_or_fractional_multiples` to pin exact inclusive integer maxima (`10^18`, `i64::MAX`, alongside the existing `2^53` check), bidirectional integer rounding (`minimum: 9007199254740993`, `exclusiveMinimum: 9007199254740992`, `maximum: 9007199254740993`), fractional binary64 rounding (`minimum: 0.30000000000000001`), and `AdmissionError::Grammar` rejection of `minimum: -2^63` on `integer` and `minimum: 2^60` on `number`. Claimed result: runtime admission and decoding behavior are unchanged relative to `main` (zero new HTTP 400s); the API reference and `docs/TODO.txt` match Helios request admission and `llguidance =1.9.1` range behavior, and unit tests fail visibly if a dependency update alters the documented outcomes. Evidence: on this change rebased onto `main` (`cfb72093`), ran `cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib grammar::strict` (28 passed, 0 failed, 1 ignored, including `strict_bounds_do_not_round_integers_or_fractional_multiples`) and `cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib server::request::tests::ignored_strict_tools_still_require_compiler_admissible_schemas` (1 passed, 0 failed) on Linux x86_64 CPU (`rustc 1.100.0`). Material limitation: no production runtime code changed, so GPU serving, simulator, and formal checks were not run. Design-Signed-Off-By: Antigravity (Gemini 4); design-review=2e5b Signed-off-by: Joshua Cartu <jcartu@users.noreply.github.com>
31c9020 to
9e1c470
Compare
|
Rebased onto Also tightened the range-bound documentation and tests against
Verified on branch head
Runtime admission and decoding behavior remain unchanged relative to |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeAll four should-fix items from my 2026-11-24 review are resolved at
Walkthrough
Merge Risk: Low · up to
|
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 are capped strictly below2^53, whereasllguidance =1.9.1convertsminimum,maximum,exclusiveMinimum, andexclusiveMaximumto IEEE 754 binary64 (and adjusts exclusive integer bounds with+ 1.0/- 1.0before casting toi64), which can round endpoints in either direction (for bounds with magnitude at or above2^53, or fractionalnumberbounds beyond binary64 precision) or fail grammar compilation. Rejecting every range bound with magnitude at or above2^53at admission would reject inclusive integer maxima such as9223372036854775807(2^63 - 1) that the grammar enforces exactly; documenting the admission scope, bidirectional binary64 rounding cases, and admission-refused range bounds preserves valid large maxima without overstating exactness.What changed
Before this change,
docs/api.mdstated that named selection adds no decoding constraints and that required mode leaves sampling unchanged, did not define an activestrict: truefunction tool or state that unselected and disabled strict schemas are validated at admission, and did not describe IEEE 754 binary64 range-bound rounding or admission-refused range bounds. After this change:docs/api.md: states that named and required selection add no decoding constraint by themselves (preserving the Jinja-template, TMLv0, and native DeepSeek V4/V4.1 prompt-rendering split from docs: document DeepSeek V4/V4.1 behavior for tool_choice required #686); 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 cap from IEEE 754 binary64 range-bound conversion; documents bidirectional rounding for bounds with magnitude at or above2^53(minimum: 9007199254740993,exclusiveMinimum: 9007199254740992,maximum: 9007199254740993) and fractionalnumberbounds beyond binary64 precision (minimum: 0.30000000000000001), exact inclusive maxima (2^53,10^18,2^63 - 1), and admission-refused bounds (minimum: -9223372036854775808oninteger,minimum: 1152921504606846976onnumberreturning HTTP 400); and advises exact integer or decimal validation from the raw JSON argument text before tool execution while noting that post-validation catches over-admission but cannot recover valid values excluded by the grammar.docs/TODO.txt: adds an entry tracking exact decimal enforcement or HTTP 400 admission rejection ofstrict: truenumeric range bounds when binary64 conversion or integer adjustment rounds the bound (magnitude at or above2^53, or fractional bounds beyond binary64 precision), with a closure criterion covering both signs.helios/src/grammar/strict.rs: extendsstrict_bounds_do_not_round_integers_or_fractional_multiplesto pin exact inclusive integer maxima (10^18,i64::MAX, alongside the existing2^53check), bidirectional integer rounding (minimum: 9007199254740993,exclusiveMinimum: 9007199254740992,maximum: 9007199254740993), fractional binary64 rounding (minimum: 0.30000000000000001), andAdmissionError::Grammarrejection ofminimum: -2^63onintegerandminimum: 2^60onnumber.Claimed result
Runtime admission and decoding behavior are unchanged relative to
main(zero new HTTP 400s). The API reference anddocs/TODO.txtaccurately describe strict-tool admission scope, active-grammar attachment, and IEEE 754 binary64 numeric range behavior, and unit tests fail visibly if a dependency update alters the documented outcomes.Evidence
9e1c4701(rebased ontomaincfb72093),cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib grammar::stricton Linux x86_64 CPU (rustc 1.100.0): 28 passed, 0 failed, 1 ignored (includingstrict_bounds_do_not_round_integers_or_fractional_multiples).9e1c4701(rebased ontomaincfb72093),cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib server::request::tests::ignored_strict_tools_still_require_compiler_admissible_schemason Linux x86_64 CPU (rustc 1.100.0): 1 passed, 0 failed.Discord: jcartu