Repository navigation
perf(ir): transfer fresh dynamic numeric assignment results - #1884
Merged
Merged
Conversation
nahime0
marked this pull request as ready for review
October 18, 2026 21:44
Member
Author
|
@greptileai please review the current head 934d884. |
Contributor
[Medium impact] This PR appears safe to merge; no actionable issues were found. Summary
Reviews (1) · Last reviewed commit: "perf(ir): transfer fresh dynamic numeric..." · Reviewed by Greptile |
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.
Dynamic numeric add/sub/mul already return a fresh integer-or-float Mixed cell. Assignment still clones that cell and immediately releases the original, including inside known-closure loops. Extend the existing FreshMixedTransfer finalizer to move these results under its existing single-owner, exact-use and adjacent-release conditions. Pow, borrowed/shared/acquired sources and other producers remain excluded.
The finalizer still runs after the optimizer fixed point, so removing the copy cannot trigger another integer-sink specialization. Overflow promotion and the boxed runtime representation are preserved. In the mixed fixture, closurePart keeps its direct call while its remaining assignment clone drops from one to zero.
Validation: eight focused optimizer library tests and six end-to-end regressions pass with the real PHP oracle. Coverage includes int/float overflow, aliases/references, a 2,024-allocation upper bound for 1,000 dynamic accumulator updates, clean heap-debug summaries, optimizer on/off parity, and EIR checks for all five targets. A 21-round CPU11-pinned Linux x86_64 release comparison with isolated matching bridge archives and before/after build guards changes the mixed fixture closure phase from 4.184 to 3.951 ms (1.059x by medians); paired median speedup 1.053x, bootstrap 95% interval 1.051-1.081. Every phase passes the 5% MAD gate. A 1,000-call closure probe reports 8,013 versus 7,013 allocations/frees with identical output.
git diff --checkpasses.