Skip to content

perf(ir): transfer fresh dynamic numeric assignment results - #1884

Merged
nahime0 merged 1 commit into
mainfrom
feat/fresh-mixed-numeric-transfer
Oct 19, 2026
Merged

nahime0 merged 1 commit into
mainfrom
feat/fresh-mixed-numeric-transfer

Conversation

@nahime0

@nahime0 nahime0 commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

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 --check passes.

@github-actions github-actions Bot added area:eir Touches EIR definitions, lowering, validation, or passes. area:optimizer Touches AST or EIR optimization passes. size:s Small pull request. type:feature Introduces new user-visible behavior or capabilities. labels Oct 18, 2026
@nahime0
nahime0 marked this pull request as ready for review October 18, 2026 21:44
@nahime0

nahime0 commented Oct 18, 2026

Copy link
Copy Markdown
Member Author

@greptileai please review the current head 934d884.

@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no actionable issues were found.

Summary

FreshMixedTransfer now removes assignment copies of fresh dynamic add/sub/mul results under its existing ownership and cleanup checks.

  • Dynamic add, subtract, and multiply assignments reuse their fresh result.

Reviews (1) · Last reviewed commit: "perf(ir): transfer fresh dynamic numeric..." · Reviewed by Greptile

@nahime0
nahime0 merged commit 103c48a into main Oct 19, 2026
192 checks passed
@nahime0
nahime0 deleted the feat/fresh-mixed-numeric-transfer branch October 19, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:eir Touches EIR definitions, lowering, validation, or passes. area:optimizer Touches AST or EIR optimization passes. size:s Small pull request. type:feature Introduces new user-visible behavior or capabilities.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant