Support shadowed and memoized loop-scoped tool aliases in the AOT compiler#109
Conversation
🦋 Changeset detectedLatest commit: b2f52c3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bridge | b2f52c3 | Commit Preview URL Branch Preview URL |
Mar 07 2026, 12:32 PM |
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
|
implement ALL compiler features ... including memoization ... ensure compiled version is actually faster than the interpreted version |
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
Implemented in b2f52c3. Memoized tool handles now compile in AOT as well, including loop-scoped cases, and the old compiler fallback test was converted to direct compiler support. I also added compiler-level memoization coverage, aligned the stable memoization key logic with runtime semantics, and revalidated performance: Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
* Fix strict nested scope resolution for array mappings * Add compiler compatibility fallback for nested loop-scoped tools * Add memoized tool handles with compiler fallback * Dnd user docs * fuzzer * Support shadowed and memoized loop-scoped tool aliases in the AOT compiler (#109) * Initial plan * fix: support shadowed loop-scoped tools in AOT compiler Co-authored-by: aarne <82001+aarne@users.noreply.github.com> * test: cover shadowed loop-scoped compiler support edge cases Co-authored-by: aarne <82001+aarne@users.noreply.github.com> * feat: compile memoized tool handles in AOT Co-authored-by: aarne <82001+aarne@users.noreply.github.com> * test: cover compiled memoization edge cases Co-authored-by: aarne <82001+aarne@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: aarne <82001+aarne@users.noreply.github.com> * HAndle define correclty * compiler parity --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: aarne <82001+aarne@users.noreply.github.com>
The compiler still rejected some bridges that the runtime already handled, including nested array scopes that redeclare the same tool alias and memoized tool handles. This change removes those incompatibilities so those bridges compile directly instead of throwing
BridgeCompilerIncompatibleErrorand falling back.Compiler compatibility
Codegen fix
Regression coverage
undefinedinput cases.Release note
Performance validation
Example of the now-supported shadowed pattern:
Example of the now-supported memoized pattern:
Before this change, the compiler rejected these shapes because shadowed aliases and memoized handles were treated as unsupported. With this update, the compiler treats shadowed bindings as distinct instances and preserves request-scoped memoization behavior in compiled execution.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.