Skip to content

feat: route re-exporter resource imports to handle table functions#80

Merged
avrabe merged 1 commit intomainfrom
fix/handle-table-routing
Apr 2, 2026
Merged

feat: route re-exporter resource imports to handle table functions#80
avrabe merged 1 commit intomainfrom
fix/handle-table-routing

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 2, 2026

Summary

  • Add component_idx to MergedImport to track which component each import belongs to
  • Export handle table functions ($ht_new_N, $ht_rep_N, $ht_drop_N) from the fused module
  • In component_wrap.rs, route LocalResource imports from re-exporter components to handle table function aliases instead of canon resource.new/rep/drop

This is the critical wiring step: re-exporter components now use per-component in-memory handle tables with 4-byte-aligned addresses instead of sequential canonical indices.

Part of #69, closes #72.

Test plan

  • 276 tests pass, 0 failures
  • No regressions — handle table routing only activates for re-exporter components
  • Non-re-exporter components still use the canonical resource type path

🤖 Generated with Claude Code

Wire the handle table functions into the P2 wrapper:

1. Add component_idx to MergedImport so the wrapper knows which
   component each import belongs to.

2. Export handle table functions ($ht_new_N, $ht_rep_N, $ht_drop_N)
   from the fused module so the wrapper can alias them.

3. In LocalResource import resolution, check if the import's component
   has a handle table. If so, alias the handle table export instead of
   emitting canon resource.new/rep/drop on a shared type.

This completes the critical path: re-exporter components now use
per-component in-memory handle tables with 4-byte-aligned addresses
instead of sequential canonical indices.

Part of #69, closes #72.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 9d75edd into main Apr 2, 2026
4 checks passed
@avrabe avrabe deleted the fix/handle-table-routing branch April 2, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route re-exporter resource imports to handle table functions (P2 wrapper)

1 participant