github-actions[bot] commented on Issue #2202:
Subscribe to Label Action
cc @kubkon
<details>
This issue or pull request has been labeled: "wasi"Thus the following users have been cc'd because of the following labels:
- kubkon: wasi
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
pchickey commented on Issue #2202:
rebased on top of main after #2201 merged
pchickey edited a comment on Issue #2202:
This PR has been rebased on top of main after #2201 merged
pchickey commented on Issue #2202:
wrt the Rights flags: right now, the canonical definition of the rights type is in the witx snapshot, but if we evolve how rights work, I expect the first thing we'll do is make the canonical definition a type defined in wasi-common, and then define conversion functions for whenever we need to represent those to the guest via each snapshot we support.
wrt separation of responsibilities: first off, theres a big overlap between
Handle
andEntry
right now, which needs design work still. I'm not 100% sure how to resolve these yet. My goal is that the handle/entry concept will be responsible for exporting all types used in its interfaces. Whether those types are imported from a given snapshot's wiggle generated code, or defined canonically without wiggle, is an implementation detail.At the moment, snapshots manipulate the entry table (mostly
get_entry
but someremove_entry
andinsert_entry_at
) and callEntry
methods (though they do so with types exported bycrate::handle
... admittedly this is muddled). Since we want to define many snapshots that will usually look a lot alike, I tried to move as much complexity out of these bodies as possible, while exposing as few pointers (and, with them, assumptions about how guest programs represent things in memory) to theEntry
methods as possible. Unfortunately, I haven't figured out how to do this with absolutely no pointers, unless we reintroduce mut vs const borrows to the wiggle api so that const borrows can overlap.Then, each snapshot will be responsible for calling the handle/entry concept, converting any of its interfaces's types to and from the ones expected by the
Entry
methods. Whichever snapshot's types get exported bycrate::handle
gets to skip this converting to/from code. For all of the types in snapshot 0, we'll have to define conversion functions, but the overwhelming majority of them should compile to a no-op because the representation is exactly the same.This PR leaves this work incomplete - #2205 is still a work in progress at completing that abstraction with the scheduler methods.
pchickey commented on Issue #2202:
Closing, I'm taking another tack on this work based on cap-std & system-interface.
Last updated: Nov 22 2024 at 17:03 UTC