Repository navigation
fix(js): explain the host Nat input range - #1656
Merged
Lorenzobattistela merged 3 commits intoOct 19, 2026
Merged
Lorenzobattistela merged 3 commits into
Lorenzobattistela merged 3 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The export test checks the exact host-range error again, and nat_host_neg.bend stays a golden test on the JS lane, where the answer is rejected as it comes in. The C lane fail-stops later with the 2^48-1 limit, so its twin goes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lorenzobattistela
approved these changes
Oct 19, 2026
nicolas-abril
added a commit
to nicolas-abril/bend
that referenced
this pull request
Oct 19, 2026
bendlang#1438's tail-drop spine and bendlang#1447's device rounds come in as written. The constructor table takes bendlang#1438's Cid struct with this branch's nat flag (a foreign Nat answer checked as it comes in) as one more byte; lay_holds keys by ty_key. tests/io/nat_host_neg takes bendlang#1656's JS-only form. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merged
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 #1634.
Invalid JavaScript Nat inputs reported the 2^48-1 arithmetic limit, even for a negative number, fraction, BigInt, NaN or Infinity.
nat_innow throws its own message,bend: expected a Nat host number: an integer from 0 to 2^53. The accepted range and the arithmetic limit are unchanged.Tests:
tests/io/nat_host_export: the exported-argument rejections (one call and curried, plus NaN/Infinity) check the exact new message; 0, 2^48 and 2^53 round-trip throughidentity.tests/io/nat_host_neg: a foreign effect answering -3 is now a JS-only golden with the new message. The C lane reads that answer as a word past the cap and fail-stops later inNat.showwith the 2^48-1 limit, so the two lanes cannot share one golden; the C twin is removed.