Repository navigation
fix(runtime): count nested array fields in shared records - #2198
Merged
nicolas-abril merged 1 commit intoNov 18, 2026
Merged
nicolas-abril merged 1 commit into
nicolas-abril merged 1 commit into
Conversation
nicolas-abril
added a commit
to nicolas-abril/bend
that referenced
this pull request
Nov 22, 2026
, bendlang#2198, bendlang#2203, bendlang#2205 and others) Conflicts: - comp.ts, nat_mul: bendlang#2174's draft against bendlang#2205 on main (the same test without its two != 0); main's text taken. - bendlang#2173 landed on main in another form (base.bend: Nat.div / Nat.mod drop the other half of Nat.divmod as a Nat) from the draft merged here (comp.ts OPERATIONS entries Nat.div / Nat.mod, native C). Both auto-merged and computed the same thing; the draft's comp.ts entries are removed so the branch carries bendlang#2173 as merged, and tests/run/nat_div_native.bend (add/add) is main's. Co-Authored-By: Claude Opus 5.5 <[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.
The native runtime stops when both handles from
Array.forkmatch a record that contains nested arrays. This also fails with one CPU worker. The added regression stops withbend: runtime fail-stoponmain. With this fix it prints4,4, and8, as the JS runtime does.rfc_sealgives constructor fields reference counts before a record can be shared. It skips array and buffer handles, sospan_faderejects those fields when it opens the shared record. IncludeTAG_ARRandTAG_BUFwhenBLK_SHRis enabled. This follows the statedArray.forkcontract for affine elements. Maintainer commentThe regression covers nested
Array<U32>andArray<String>, a recursive record, and replacement throughArray.set.Validation on macOS with Apple clang 21
BEND_POISON.twice!passed with+RTS --gpu onon Metal.comp.tsis 65,995 tokens.The full cluster suite and CUDA were not run.