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
{{ message }}
Repository navigation
Should waitable-sets have their own table or go in the waitables table? #511
Currently, CanonicalABI.md gives waitable-sets their own table alongside the resources and waitables tables (here), which is observable via the i32 indices allocated. Writing some .wast tests, it looks like wasip3-prototyping puts waitable-sets into the waitables table, so probably worth discussing.
One reason for the separate table is that, since you can't put a waitable-set in another waitable-set , waitable-sets are not themselves waitable. It's worth asking though if we might want to allow this in the future, in which case waitable-sets need to go in the waitables table now. I was thinking that this is probably not something we'd want to do, because it adds non-trivial complexity (you have to check for cycles in waitable.join and potentially various other operations go from O(1) to O(depth)), but maybe that's short-sighted.
Another reason might be to minimize the number of tables, for the debugging/simplification benefits of #427. #427 was mostly about collapsing N subtle (per-resource-type) tables, though; if we want to collapse further, it's worth asking whether resources and waitables should also be merged into one.
Yeah, I think the idea behind #427 is that minimizing the number of tables makes debugging easier, so I'd be in favor of putting resources, waitable sets, and waitables all in the same table (or at least writing the spec such that the host is allowed to do so).
I'm personally partial to the idea of putting all the tables into one indexing space as well for all the same debugging reasons, and while we'd forbid waitable-sets-in-waitable-sets for now it'd be a bit easier to open that up in the future
Yeah, the more I think about it, the more this seems like a good idea for future-proofing against all manner of unforeseen future extensions that, for whatever reason, might want to index over (via a single i32) things that might otherwise be in separate tables. I'll work up a PR.
Activity
lukewagner commentedon Apr 29, 2025
(cc @dicej @alexcrichton)
dicej commentedon Apr 29, 2025
Yeah, I think the idea behind #427 is that minimizing the number of tables makes debugging easier, so I'd be in favor of putting resources, waitable sets, and waitables all in the same table (or at least writing the spec such that the host is allowed to do so).
alexcrichton commentedon Apr 30, 2025
I'm personally partial to the idea of putting all the tables into one indexing space as well for all the same debugging reasons, and while we'd forbid waitable-sets-in-waitable-sets for now it'd be a bit easier to open that up in the future
lukewagner commentedon Apr 30, 2025
Yeah, the more I think about it, the more this seems like a good idea for future-proofing against all manner of unforeseen future extensions that, for whatever reason, might want to index over (via a single
i32) things that might otherwise be in separate tables. I'll work up a PR.Have a single table for resources, waitables, waitable sets and error…
Have a single table for resources, waitables, waitable sets and error…
Have a single table for resources, waitables, waitable sets and error…