Repository navigation
A value past 2^24-1 live copies fail-stops with its own message, and WONTFIX names the cap - #1366
Merged
Lorenzobattistela merged 1 commit intoOct 6, 2026
Conversation
…WONTFIX names the cap (bendlang#1267) The 24-bit count of a shared value overflowed into ERR_RFCS, whose text is the generic "runtime fail-stop". The overflow now posts ERR_CNTS: "a value has more than 2^24-1 live copies: keep fewer alive at once, or build it again for some of them (each build counts its own copies)", from rfc_bump and from blk_new's depth-24 check alike. ERR_RFCS stays for sharing a closure and for span_fade's sealed-field check. WONTFIX's RUNTIME section names the cap beside bendlang#779: the C lane stops, JS keeps no count, Array.new of a computed value stops at depth 24, and building the value again per group of copies goes past it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Refs #1267. The cap stays: this makes it visible. Once this merges, #1267 should be closed as not planned, like the other RUNTIME entries.
Why
On the C lane, copies of a
+value share it through one 24-bit count, so a value can have at most 2^24 − 1 live copies. Past that, the program fail-stops with the genericbend: runtime fail-stop, which doesn't say which limit was hit. JS keeps no count and runs on. The BendRT paper lists the cap among its limitations, but WONTFIX didn't, which is why #1267 looked like an undocumentedArray.newlimit.The cap isn't specific to arrays.
Array.new(T, d, x)makes 2^d copies ofx, so it hits the cap at depth 24, but so does a list holding 2^24 copies of one computed string.Change
ERR_CNTS, both fromrfc_bumpand fromblk_new's depth-24 check:ERR_RFCSkeeps its generic text for its other two uses, sharing a closure andspan_fade's sealed-field check. Neither is a count overflow.Array.newat depth 23 per build, joined withANode.Checked
On the C lane:
Array.new(String, 23n, F32.show(1.0))1n1nF32.show(12.375))runtime fail-stop1n1nruntime fail-stopJS prints the answer in every case, as before.
There's no new test: every lane must print the same
#|lines, and here JS and C differ by design.Gates: repo 50/50, test 1577/1577, perf PASS (120/124). ping was skipped: the site repo isn't checked out on this machine.
🤖 Generated with Claude Code