You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 1 of #573 migrated Map<K, V> to the heap-wrap-as-ADT scheme: every Map value is now a pointer to a GC-managed wrapper ADT, and Phase 2c of $gc_collect fires host_decref_handle(MAP, handle) to evict unreachable entries from _map_store.
This issue tracks the parallel migration for Set<T>, which still uses raw i32 handles into _set_store and therefore still leaks per execute().
Scope
Mechanical mirror of the Map migration:
vera/wasm/calls_containers.py — wrap on Set-returning ops (set_new, set_add, set_remove); unwrap on Set-consuming ops (set_contains, set_size, set_to_array).
vera/wasm/helpers.py — remove "Set" from _HOST_HANDLE_TYPES (wrappers are real heap pointers and need rooting).
Context
Phase 1 of #573 migrated
Map<K, V>to the heap-wrap-as-ADT scheme: every Map value is now a pointer to a GC-managed wrapper ADT, and Phase 2c of$gc_collectfireshost_decref_handle(MAP, handle)to evict unreachable entries from_map_store.This issue tracks the parallel migration for
Set<T>, which still uses raw i32 handles into_set_storeand therefore still leaks perexecute().Scope
Mechanical mirror of the Map migration:
vera/wasm/calls_containers.py— wrap on Set-returning ops (set_new,set_add,set_remove); unwrap on Set-consuming ops (set_contains,set_size,set_to_array).vera/wasm/helpers.py— remove"Set"from_HOST_HANDLE_TYPES(wrappers are real heap pointers and need rooting).vera/codegen/api.py::host_decref_handle— addkind == 2branch popping_set_store.vera/browser/runtime.mjs::host_decref_handle— samekind === 2branch poppingsetStore._WRAP_KIND_SET = 2and_SET_HANDLE_TAG = 0xFEEDC002constants alongside the Map equivalents (already reserved in the phase-1 PR).TestHostHandleReclamation573::test_map_chain_reclaims_transientsfor Set.TestOpaqueHandleParamRooting347::test_set_param_not_shadow_pushed(Set params will be shadow-pushed post-migration).No call-site changes needed for JSON/HTML — they don't use Set internally (only Map).
Acceptance
array_foldoverset_addchain:_set_storesize at exit < 100 (mirroring the Map test's bound).Set<T>is removed from_HOST_HANDLE_TYPESinvera/wasm/helpers.py.Out of scope