Repository navigation
fix(array): the depth-wall error and Array.new say d is a depth - #1963
Merged
Lorenzobattistela merged 3 commits intoOct 30, 2026
Merged
Conversation
The C wall is depth plus log2 of the cell's words (blk_new), so a two-word record already stops at depth 31; a boxed v stops at depth 23 (its copies). Same comp.ts ttok as before (65,927). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lorenzobattistela
approved these changes
Oct 30, 2026
3 tasks done
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 #1962 (the first two points; no new helper).
Array.new(T, d, v)takes a depth: it builds2^dcells. Passing a length, as inArray.new(U32, 12288n, 0), hits the depth wall with "an array past the deepest block class 31", which names neither the argument nor that 31 is a depth. The fix is 14n (16384 cells).Change
bend2/comp.ts: fail-stop 10 reads "an array past the deepest block class 31 (a depth d holds 2^d cells)". It is the one ERRS entry that changes; the others keep their text (checked by evaluating both tables). 65917 → 65927 ttok, cap 66000.bend2/base.bend: a comment aboveArray.new: d is a depth, not a length (14n for 12288 cells), at most 31.tests/io/array_depth_bound.bend: its#|line carries the new text.Array.get(U32, Array.new(U32, d, 7), 5)77Verification (macOS arm64, Bun 1.4.2; Linux arm64 (Docker, Debian 13, Bun 1.4.2, clang 19))
Array.new(U32, 12288n, 7), and14n) on interp, JS and C, macOS and Linux: the table above, the same on bothtests/, interpreter, before vs after, macOS and Linux: onlyarray_depth_bounddiffers, in that linegates/repo.ts: 54/54 (comp.ts 65,927 / 66,000 ttok)gates/test.ts: runs on the miniscell!(12288n), built with its.gpuprogram, prints the new line, andcell!(14n)prints7, before and after the change as on the other lanes!call ran on the GPU or on the runtime's CPU path: not confirmed (the Metal dispatch and commit counts under lldb are the same with+RTS --gpu off)Note:
bend base Array.newprints the definition without its comment, so the new comment shows inbase.bendonly.