Skip to content

embedder: give host resource registrations independent lifetimes - #332

Merged
lannbot merged 1 commit into
mainfrom
fix/host-resource-registration-identity
Sep 11, 2026
Merged

embedder: give host resource registrations independent lifetimes#332
lannbot merged 1 commit into
mainfrom
fix/host-resource-registration-identity

Conversation

@lannbot

@lannbot lannbot commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #330.

  • Allocate independent host-resource registrations for each own lowering of a host implementation object, even when backing JS object identity is equal. Returning/dropping one registration leaves the other usable; each owning drop invokes disposal independently.
  • Allocate fresh call-scoped host-originated borrow registrations. Preserve existing guest-resource wrapper transfer and canonical lender protection.
  • Remove the obsolete identity-deduplication/deferred-disposal policy, its cleanup-error machinery, and its dedicated fixture/tests. Add real-Wasm independence, return, overlap, and failure-cleanup regressions.
  • Clarify the embedder contract and advance protocol from 0.3.2 to 0.4.0 (breaking/protocol); the lockstep runtime packages stay at 0.6.8.

Semantics

Resource identity is distinct from backing-data identity. The pinned Component Model creates fresh resource handles and independently calls the destructor for each owned drop; it does not merge lifetimes by representation equality. Existing resource-handle lowering remains an ownership transfer. Wasmtime corroboration and pinned source citations are in #330.

Host providers that return the same object repeatedly now receive a disposal invocation per independent registration. Plain-object host borrows no longer delay disposal of unrelated own registrations backed by that object. Managing shared backing data is the provider's responsibility.

Verification

  • Independent review approved the revised diff.
  • Focused embedder/resource/conventions suite: 74 passed, no skips.
  • Runtime suite: 865 passed, 3 existing ignored cases; WASI: 293 passed, 1 ignored.
  • All just gates recipes completed across resumed invocations: the initial command hit a 120s tool timeout in sched-seeds; remaining recipes resumed with a larger timeout. Installed missing Playwright browsers with just browsers-install, then reran just browsers successfully.
  • Seeded runtime/conformance runs, pinned SpiderMonkey/Node and findings-only Bun lanes, Chromium/Firefox page/worker/shared-worker and OPFS checks, npm packaging, Rust/protocol/ct-runner, examples, TLS and C0 consumer smokes passed their configured expectations. JSC shell is skipped on aarch64 by recipe; existing conformance exclusions remain.
  • git diff --check, just fmt-check, just lint, just version-guard-local passed. Existing convention goldens unchanged.

Automerge will be armed after creation, with merge after required core checks.

@lannbot lannbot added the breaking/protocol Breaks @polyengine/protocol published surface (caret-incompatible): minor must bump this cycle label Sep 11, 2026
@lannbot
lannbot enabled auto-merge September 11, 2026 01:26
@lannbot
lannbot merged commit 377b9c0 into main Sep 11, 2026
4 checks passed
@lannbot
lannbot deleted the fix/host-resource-registration-identity branch September 11, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking/protocol Breaks @polyengine/protocol published surface (caret-incompatible): minor must bump this cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

embedder/resources: backing-object deduplication conflates independent host resource lifetimes

2 participants