Repository navigation
Conversation
Signed-off-by: Jairus Tanaka <me@jairus.dev>
Signed-off-by: Jairus Tanaka <me@jairus.dev>
Signed-off-by: Jairus Tanaka <me@jairus.dev>
JairusSW
marked this pull request as draft
June 9, 2026 06:04
JairusSW
marked this pull request as ready for review
June 17, 2026 18:13
|
Just curious here, why the exception of a trailing .0? |
Member
Author
Max and Dan made that decision so that floats are easily identifiable when converting them to a string. For example, you know that the string |
Member
|
Can you rename xjb.ts to dtoa.ts and in comments mentioned about implementation based on xjb and zmij? |
MaxGraey
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
Co-authored-by: Max Graey <maxgraey@gmail.com>
Co-authored-by: Max Graey <maxgraey@gmail.com>
MaxGraey
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
Co-authored-by: Max Graey <maxgraey@gmail.com>
dcodeIO
reviewed
Jun 17, 2026
MaxGraey
reviewed
Jun 17, 2026
Co-authored-by: Max Graey <maxgraey@gmail.com>
MaxGraey
reviewed
Jun 18, 2026
MaxGraey
reviewed
Jun 18, 2026
MaxGraey
reviewed
Jun 18, 2026
Member
|
Also plz add extra tests which cover new implementation-specific edge cases (I anready found a bug) and uncomment existing test cases which failed with grisu2 |
…ript into jairus/switch-to-xjb
JairusSW
force-pushed
the
jairus/switch-to-xjb
branch
from
October 30, 2026 18:27
220f9c4 to
660bd25
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3012.
Changes proposed in this pull request:
.0It's good quality stuff though, and I'm quite confident in that.
Current implementation measurements from independent review of
0c115329againstb6bda05, including the exact-integer string path. These are diagnostic results for the stated engine, machine, runtime, and workloads.Generated Wasm size for tiny modules exporting
f64.toString(),f32.toString(), or both, compiled with-O --noAssert --runtime stub:f64onlyf32onlyWith the default incremental runtime, the both-width module grows from 6,834 B to 13,248 B (+6,414 B). These small formatter-focused modules do not estimate whole-application growth. The generated string wrappers call shared buffered formatters; the exact-integer direct-allocation path adds specialized code.
Throughput on Node 24.22.1, x86-64 AMD EPYC 9V74, default incremental runtime, scalar builds: 4,096 inputs per bucket, 150,000 warmup operations, and medians of seven alternating base/PR samples of 400,000 operations. The timed loops run inside Wasm.
f64bufferedf32bufferedf64stringf32stringf64bufferedf32bufferedf64stringf32stringf64bufferedf32bufferedf64stringf32stringOrdinary decimals are nonintegral values roughly between −1,000 and +1,000, formed by dividing integers by 1,000. Gains are strongest for buffered formatting and integers; complete-string performance varies with workload. The 96.0 → 96.4 ns ordinary-decimal
f64result is effectively flat, not a meaningful measured regression.A separate SIMD diagnostic run improved random-finite buffered formatting by 2.31× (
f64) and 2.75× (f32) against its own interleaved baseline. Ordinary-decimalf64string output improved by about 6% in that run.Correctness validation at this revision includes exact BigInt binary32 rounding intervals with ties-to-even, the four formerly double-rounded
f32regressions, all four checked-in debug/release × scalar/SIMD configurations (556,880 exact output comparisons), 28-code-unit canaries, the float-array join allocation budget, and independent verification of all 618 cached powers. Independent review also checked 28,076 cases against C++std::to_chars(float, scientific)and 12,384 additional boundary comparisons across the buffered, ordinary string, and low-level string paths. These are substantial checks, not an exhaustive proof over all floating-point bit patterns.