Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lorenzobattistela
requested changes
Oct 19, 2026
Lorenzobattistela
left a comment
Collaborator
There was a problem hiding this comment.
Thanks! The speedup is real and all gates are green. I pushed a commit that drops the GUIDE edit; we don't want that change in the guide. Three small things before we merge:
- Don't duplicate the bend.ts helpers.
bend.tsalready has these exact casts:F32_VIEW,f32_to_bitsandf32_from_bits. comp.ts already splices${Bend.f32_round}into the JS runtime, so reuse the bend.ts versions the same way instead of keeping a second copy in comp.ts. - Drop the
, truearguments. Each cast writes and reads with the same byte order, so the little-endian flag changes nothing. Big-endian, the default that bend.ts uses, gives the same bits. The four arguments just cost ttok in comp.ts. - Remove
lib.bits(0.75)from the test loop. It can't catch a scratch-reuse bug:valueis already a JS number before that call, andlib.bits(value)rewrites the buffer before reading it. The round-trip table on its own is the useful part.
Contributor
Author
|
This is JS-only performance work, so I’m withdrawing it following the reference-runtime policy in #1644. |
Contributor
Author
|
I closed this too quickly after reading #1644 — sorry. Reopening it and taking care of these three points. |
Contributor
Author
|
Done — comp.ts now splices in the two bend.ts helpers and uses their default byte order. Dropped the extra test call. The exported-module smoke passes (0 / 16777216), and the repo gate is 54/54. |
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 #1638.
The JS bit casts share a four-byte buffer instead of allocating one for every call. They reuse the cast functions from bend.ts, with no second implementation or endian flags.
Kept the round-trip table for signed zero, subnormals, finite bounds and infinities; removed the unrelated
lib.bits(0.75)call. No new NaN-payload guarantee.Local generated-module smoke:
0/16777216. Repo gate: 54/54. The maintainer ran the full gates on the previous head; I haven’t rerun the private gates locally.