Skip to content

runtime: preserve component-local resource handle identity - #320

Merged
lannbot merged 1 commit into
mainfrom
fix/resource-table-identity
Sep 8, 2026
Merged

runtime: preserve component-local resource handle identity#320
lannbot merged 1 commit into
mainfrom
fix/resource-table-identity

Conversation

@lannbot

@lannbot lannbot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve the resource identities already supplied by the translator instead of using ResourceIndex for every comparison.

  • Keep ResourceTypeInfo as shared origin/implementation/destructor metadata; add a required ResourceTableInfo per emitted TypeResourceTableIndex.
  • Validate guest resource handles using local table identity, and tag transferred handles with the destination table identity.
  • Keep facade resource wrappers, destructor dispatch, and cross-component compatibility based on underlying resource identity.
  • Store endpoint-local stream/future element descriptors. Guest operations, lifts, and transfer-source checks use local equality; lowering, transfer-destination checks, and shared rendezvous use underlying identity.
  • Keep known task.return result comparisons local, including FACT callee result tuples.

This prevents a child from confusing distinct abstract imports when the parent supplies one underlying resource to both, including through resource-bearing async payloads. Equality-bound aliases and legitimate component transfers remain valid. Both identities are fresh per runtime instantiation of a plan.

No new public facade behavior, host-class unification, cross-store transfer, plan schema, protocol, package version, golden, or expected-failure changes. Previously accepted wrong-local guest operations now trap. Update internal descriptor/intrinsic/plan contracts to state the distinction.

Verification

  • 26 new identity regressions: validated linked parent/child + equality alias/destructor, all local async guard families, actual resource payload transfers and destination tags, different-origin refusal, known task.return checks.
  • Existing direct handle tests now exercise distinct local wrappers with a shared origin; original lifetime guarantees retained.
  • Runtime: 879 passed, 0 failed, 3 existing deferred tests. Seeds 1 and 4242: 876 passed each, 6 existing skips.
  • Conformance: unchanged 1,285 passing commands, 126 expected failures, 95 pending, 5 unsupported directives.
  • Independent semantic design and final code/test review approved. FACT result tuple provenance was checked against pinned producer source; direct task fixtures do not pretend to execute that dictionary path.
  • Full just gates < /dev/null passed, including packaging/npm, pinned shell lanes, Chromium/Firefox page and worker realms, OPFS, and TLS/C0 consumer smokes. Consumer worktrees retain their initial status.
  • WAT regenerates byte-identically; formatting/diff checks pass. Protocol, golden and lockfile bytes are unchanged.

@lannbot
lannbot enabled auto-merge September 8, 2026 17:42
@lannbot
lannbot merged commit cdc6bf9 into main Sep 8, 2026
4 checks passed
@lannbot
lannbot deleted the fix/resource-table-identity branch September 8, 2026 17:47
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.

2 participants