Repository navigation
A copied list of source texts shares their bytes, and the debug allocator's ledger no longer degrades on regular addresses (part of #685) - #3584
Merged
Conversation
added 4 commits
November 23, 2026 22:53
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.
Three changes that came out of measuring #685.
1. The compiler stops copying every source text twice.
sema_clone_str_listpushed a fresh copy of each str; it now returns the list as the value it is (D120: the table is shared until one side writes; D111: each str is a counted holder of its bytes). The pinned seed gives the spelling the same meaning (checked with a probe under its debug allocator: the copy outlives its source, a write to the copy leaves the original alone, leak count 0).link-compiler(the 2,048 MB tripwire)src/main.with, peak live2. The debug allocator's ledger mixes an address before it picks a slot. It probed linearly from
addr >> 4. Block addresses are regular, so with the allocation pattern change 1 produces, entries fell into the same runs of slots and a check of the compiler underWITH_DEBUG_ALLOC=1did not finish in 22 minutes (all samples indbg_record_allocanddbg_ledger_entry). With the address mixed the same run takes 84 s.3.
WITH_DEBUG_ALLOC_SITES_SHOWN=<n>prints the n largest allocation sites instead of 24, which is what the by-stage table on #685 was added up from. Documented in deep-debugging-tools.md.Evidence at the branch head:
:behavior-tests,:debug-alloc-tests,:unit-return-review,:ceremony-census,:self-auditgreen; battery green; linux-aarch64 container leg green (:build,:behavior-tests,:debug-alloc-tests);:release-checkssurvey: all targets green.Does not close #685: its remaining part (releasing the AST before code generation) needs the code generator to stop reading the AST, as measured on the issue.