Compute field offsets once in the layout packer - #945
Closed
tachytelicdetonation wants to merge 1 commit into
Closed
tachytelicdetonation wants to merge 1 commit into
tachytelicdetonation wants to merge 1 commit into
Conversation
VictorTaelin
pushed a commit
that referenced
this pull request
Sep 21, 2026
lay_pack takes constructor names and field layouts and assigns the final offsets while merging word kinds; the intermediate offsets of lay_fields and the caller-supplied offsets in arr_lay are gone. Emission is byte-identical. (PR #945)
Contributor
|
Merged into 2.0.25 as one commit under your authorship, thank you. We verified the byte-identical emission over 914 outputs on our side. It landed together with the wide-record fix of #944, so Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself. |
Phylliida
pushed a commit
to Phylliida/bend
that referenced
this pull request
Sep 27, 2026
lay_pack takes constructor names and field layouts and assigns the final offsets while merging word kinds; the intermediate offsets of lay_fields and the caller-supplied offsets in arr_lay are gone. Emission is byte-identical. (PR bendlang#945)
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.
lay_fieldscalculated field offsets beforelay_packmutated each offset to account for the constructor tag. This makeslay_packaccept constructor names and field layouts and assign the final offsets while merging word kinds. It removes the intermediate offset calculation and the caller-supplied offsets inarr_lay.Only
bend2/comp.tschanges: +17 / -27 lines (net -10), and 64,941 -> 64,881 ttok. No language features or comments are removed.Validation against upstream commit
99f9c6cdon macOS arm64:.bendfile undertests/{compile,run,base,show,rfc,cost}plus all 16 runtime benchmarks. All 235 emitted C files and 235 emitted JavaScript files are byte-identical; the other 28 inputs have identical compilation diagnostics and exit status.#|output. Four additional rejection tests match their expected errors and exit status.gates/repo.ts: PASS 46 / 46.git diff --check: pass.bend2/bend.tsand missingcanvasdeclarations in two documentation generators. No diagnostics incomp.ts.