Skip to content

fix: export dedup + shared resource types + disable handle tables#89

Merged
avrabe merged 1 commit intomainfrom
fix/export-dedup-shared-types-no-ht
Apr 3, 2026
Merged

fix: export dedup + shared resource types + disable handle tables#89
avrabe merged 1 commit intomainfrom
fix/export-dedup-shared-types-no-ht

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 3, 2026

Summary

Three interconnected fixes for 3-component resource chain support:

  1. Export dedup suffixing: In multi-memory mode, suffix duplicate export names with $comp_idx instead of silently dropping them. Previously, the fixup module's indirect table was wired to the wrong component's functions due to export name collisions ("0", "1", "$imports" etc.).

  2. Shared resource types: Key resource types by resource name only (not interface+name). Re-exporters import and export the same resource under different interface names but must share one canonical wasmtime handle table.

  3. Disable handle table allocation: With shared canonical resource types, all components use wasmtime's built-in handle tables. Custom per-component handle tables are no longer needed (code preserved with #[allow(dead_code)] for potential future use).

Part of #69.

Test plan

  • 276 tests pass, 0 failures
  • SharedMemory test still passes (first-wins dedup preserved)
  • 3 resource chain tests remain fuse-only (separate allocator issue)

🤖 Generated with Claude Code

…tables

Three interconnected fixes for 3-component resource chain support:

1. Export dedup suffixing (multi-memory mode): suffix duplicate export
   names with $comp_idx instead of dropping them. Prevents the fixup
   module from being wired to the wrong component's indirect table.

2. Shared resource types: key resource types by resource name only
   (not interface+name). Re-exporters import and export the same
   resource under different interface names (imports, exports,
   test:…/test) and must share one wasmtime handle table.

3. Disable handle table allocation: with shared canonical resource
   types, all components use wasmtime's built-in handle tables.
   Custom per-component handle tables are no longer needed.

The 3 resource chain tests still fail with an unreachable trap in
the leaf's allocator — this is a separate bug in how the intermediate
component's code path interacts with the leaf's internal functions.

Part of #69.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 93c8541 into main Apr 3, 2026
4 checks passed
@avrabe avrabe deleted the fix/export-dedup-shared-types-no-ht branch April 3, 2026 01:09
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.

1 participant