Skip to content

feat(json): add standard numeric conversion and owned encoder results - #1015

Merged
sanohiro merged 3 commits into
mainfrom
feat/r63-json-numbers
Sep 10, 2026
Merged

feat(json): add standard numeric conversion and owned encoder results#1015
sanohiro merged 3 commits into
mainfrom
feat/r63-json-numbers

Conversation

@sanohiro

@sanohiro sanohiro commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Owned JSON records containing finite f32/f64 fields now use the same structural codec as other supported leaves. Selected numbers decode directly to their target width with nearest/ties-even rounding; rounded overflow rejects, while grammar-valid unselected large numbers remain skippable.

Both json.encode and json.encode_bounded return Result<string, Error>. Success transfers an independent output buffer; selected NaN/infinity and invalid byte limits return Error.Invalid without partial output. The compiler uses one encoder operation, reserves the source across limit evaluation, validates the complete MIR JSON sequence, and carries owned float graphs through V3/interface 12 and cache invalidation. Existing callers and English/Japanese contracts are synchronized. R65 and align-llm adoption remain separate.

Validation covers independent numeric/descriptor goldens, host rounding modes, ownership/cleanup and native admission, every body emitter, whole/per-unit routes, cache changes and compiled ABI export parity. Local nine-pair measurements found no reproducible ordinary decode regression; the final mixed numeric encoder is faster than both baseline raw encoding and baseline plus the explicit owned copy. Detailed measurements and artifact identities are in bench/json_numeric/r63-results.md.

@sanohiro sanohiro changed the title feat(json): support owned float records and fallible encoding feat(json): add standard numeric conversion and owned encoder results Sep 10, 2026
@sanohiro
sanohiro marked this pull request as ready for review September 10, 2026 10:00
@sanohiro
sanohiro merged commit 4cb1489 into main Sep 10, 2026
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant