Skip to content

Should waitable-sets have their own table or go in the waitables table? #511

Closed

Description

@lukewagner

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.

Activity

  1. lukewagner commented on Apr 29, 2025

    @lukewagner
    MemberAuthor
  2. dicej commented on Apr 29, 2025

    @dicej
    Collaborator

    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).

  3. alexcrichton commented on Apr 30, 2025

    @alexcrichton
    Collaborator

    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

  4. lukewagner commented on Apr 30, 2025

    @lukewagner
    MemberAuthor

    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.

  5. added 2 commits that reference this issue on May 1, 2025
    5292458
    8499243
  6. added a commit that references this issue on May 9, 2025
    cdbf5cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions