Skip to content

Commit 1ea36d1

Browse files
author
Zachary Whitley
committed
docs(slice-3-guide): gap #3 closed by wasmos SyncInstance::resource_drop
wasmos commit 9a7c61ea landed SyncInstance::resource_drop which closes the resource-drop dispatch gap the Slice 3 guide flagged. Guide now shows the direct migration pattern: self.sync_inst.resource_drop(handle.store_id, handle.handle_id) Return type shifts from wasmtime::Result<()> to Result<(), RuntimeError> — small consumer-side adjustment at the ~5 drop sites (grep for resource_drop_handle). Gaps #1 (PrimaryReentry.connection: ResourceAny) and #2 (CoreResourceHandle dual-field shape) remain — both trace to SyncCrossInstanceHandle's ExportResourceTable-based dispatch path. Full retirement requires a wasmos-side extension to accept Value::Resource directly on the cross-instance surface. Documented as the last outstanding wasmos-side extension needed for Phase 6's final Cargo dep drop.
1 parent 24a4103 commit 1ea36d1

1 file changed

Lines changed: 34 additions & 18 deletions

File tree

‎docs/path-b-closure-slice-3-execution.md‎

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,25 @@ pub(crate) fn call_bridge_export(
180180
}
181181
```
182182

183-
Similarly for `resource_drop_handle` at ~line 2990 — needs a
184-
wasmos-native equivalent for `ResourceAny::resource_drop`. If
185-
wasmos doesn't expose one on `SyncInstance` yet, this is a small
186-
wasmos-side addition (task 27b if it materialises). Interim:
187-
keep the escape-hatch call via `sync_inst.as_async_mut()` +
188-
tokio_runtime.block_on, but this leaks wasmtime types back in.
189-
**Verification required** before executing this step.
183+
For `resource_drop_handle` at ~line 2990, wasmos now exposes
184+
`SyncInstance::resource_drop(store_id, handle_id)` (wasmos
185+
commit `9a7c61ea`). If `CoreResourceHandle` carries the
186+
wasmos-native `(store_id, handle_id)` fields:
187+
188+
```rust
189+
// AFTER
190+
pub(crate) fn resource_drop_handle(
191+
&mut self,
192+
handle: CoreResourceHandle,
193+
) -> Result<(), wasmos_runtime_api::RuntimeError> {
194+
self.sync_inst.resource_drop(handle.store_id, handle.handle_id)
195+
}
196+
```
197+
198+
Return type changes from `wasmtime::Result<()>` to
199+
`Result<(), RuntimeError>` — one small consumer-side adjustment
200+
at the ~5 drop sites in `lib.rs` + consumer files (grep for
201+
`resource_drop_handle`).
190202

191203
### 5. Free helper functions (`call_export_on_resource_core`
192204
etc.) — RETIRE
@@ -498,18 +510,22 @@ and Phase 6 (Cargo dep drop) remain as follow-up cleanup.
498510
1. `PrimaryReentry.connection: wasmtime::component::ResourceAny`
499511
— required by `SyncCrossInstanceHandle`'s reliance on
500512
`ExportResourceTable`. Retiring this needs either a wasmos-side
501-
extension to accept `Value::Resource` directly, or a
502-
ducklink-side conversion via `AdapterHostState.peek_resource`
503-
(if exposed).
513+
extension to accept `Value::Resource` directly in
514+
`SyncCrossInstanceHandle::call_export_sync`, or a ducklink-side
515+
conversion via a future wasmos accessor on
516+
`AdapterHostState.peek_resource`.
504517
2. `CoreResourceHandle` retains a wasmtime-typed field in the
505-
dual-field shape. Same underlying constraint.
506-
3. `resource_drop_handle` — needs a wasmos-native drop primitive
507-
or `sync_inst.as_async_mut()` + block_on. Verify wasmos side
508-
before executing step 4's retirement.
509-
510-
These gaps are documented in the plan doc; do not block Slice 3
511-
from landing. Final wasmtime dep drop (Phase 6) requires
512-
resolving them.
518+
dual-field shape (for the cross-instance dispatch path only).
519+
Same underlying constraint as gap #1.
520+
3. ~~`resource_drop_handle` needs a wasmos-native drop primitive~~
521+
**CLOSED 2026-09-22** (wasmos `9a7c61ea`). Use
522+
`sync_inst.resource_drop(store_id, handle_id)`.
523+
524+
Gaps #1 + #2 survive Slice 3 as internal uses of
525+
`wasmtime::component::ResourceAny` on the cross-instance dispatch
526+
path only. Final wasmtime dep drop (Phase 6) requires
527+
resolving them via a small wasmos-side extension to
528+
`SyncCrossInstanceHandle`.
513529

514530
## Verification checklist
515531

0 commit comments

Comments
 (0)