Repository navigation
Reduce compiler memory in context tool name mapping - #886
Merged
Merged
Conversation
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 three literal String patterns in tool_input_name produce a large checked term and increase compiler memory use. Use ordered String.eq checks and Bool.pick for the same three aliases and preserve unknown names unchanged.
The paired real-code probe on source d461a56 used the same Bend 2.0.25 compiler and five inputs. C generation fell from 54.61 to 34.09 seconds; peak RSS fell from 3,560,276 to 855,772 KiB. Both linked executables returned the same five output lines, exit 0 and empty stderr. This is a focused codec-entry result.
A matching check-only comparison on the recovery entry reduced validator-end heap from 3.403 to 2.558 GB and RSS from 6.808 to 5.180 GB. The candidate removed the observed roughly 340 MB retained-heap increase across tool_input_name. These measurements do not qualify the complete package.
Validation on the current-main parent bf4df22: the new compiled codec runtime test passed 1/1 in 33.228 seconds under an 8 GiB memory limit with swap disabled. It covers the three aliases, an already-normalized name and unknown-name passthrough.
Retained diagnostic log: /mnt/nvme4tb/ci-runners/baton2-native-homelab/retained/account-live-f25-20261018/hotspot-candidate-c/.scratch/hotspot-candidate-c.gcdiag.log, SHA256 714955c3fce8f59aedcea7523829a491771fae5ad94d5f244d3b516886cf753b.
Related: #776 for the general compiler lowering and retained-term investigation; #869 for the separate retained Codex-frame memory fix.