Canonical JSON: numbers as ECMAScript writes them (jouleclaw-jcs), and the integer range (sandbox-attest) #313
Loading…
Reference in a new issue
No description provided.
Delete branch "jouleclaw/jcs-ecmascript-numbers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two canonical-JSON (RFC 8785) writers in the repository could produce text that other implementations do not.
jouleclaw-jcs laid numbers out as ryu does, not as ECMA-262's Number::toString, which RFC 8785 requires:
1e-60.0000011.5e-50.0000151e16100000000000000009007199254740993Every number is now the double it reads as, written with the fewest digits that read back as it (the nearest of those, a tie going to the even, as the standard says: RFC 8785's 1424953923781206.25 is
1424953923781206.2), in plain decimals from 10⁻⁶ up to 10²¹ and in exponent form outside. An integer past ±(2⁵³ − 1), which a double cannot hold exactly, isUnrepresentableNumber. Checked against RFC 8785's appendix B and 3,385 vectors written by a JavaScript engine (testdata/es-number-tostring.txt). The crate is not published and nothing in the repository depends on it.ryuis no longer a dependency.sandbox-attest wrote integers verbatim at any size. Past 2⁵³ that is not what an implementation holding numbers as doubles writes, so the attestation's JCS form was not byte-identical across platforms, as SPEC §4 requires. SPEC §4 now states the range, and the writer refuses a core outside it. No current core holds such an integer (times are microseconds, energies microjoules). The sandbox workspace's tests, conformance vectors included, all pass; a manual
is_multiple_ofthat clippy flags is fixed too.The same writer, verified the same way (2 million random doubles against a JavaScript engine), now signs the quantum job service's receipts.
🤖 Generated with Claude Code