-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FYI: prototyping work in wabt and V8 #81
Comments
That's great news. Firefox has also had a prototype for about a year or so, documented here. |
Excellent news! I'll push forward with the reference interpreter, probably focussing on the function refs and type imports proposals first. |
@lars-t-hansen Do you plan to adapt the binary coding of Firefox GC as soon as the implementation in WABT progresses? I ask because I use your code for my tests. |
Kotlin/Wasm prototype also currently targets Firefox GC instruction set. In order to fully port it to WABT and V8 we would need |
Cool! Regarding (2), it will be helpful if you make it easy to turn on and off optimizations, since some optimizations we can rely on now we might not be able to rely on in the future, so it'd be nice to know how critical that reliance is. And yes, we need to get some languages to work on targeting this extension. Great to hear that Kotlin is already working on it! I think OCaml is working on it too. I'll see if I can rally some more, ideally from the dynamic languages. |
@skuzmich thanks for the info! I'll make sure to work on those next. |
In general, the Firefox implementation can be changed to be compatible with whatever, as few people are using it. I've not looked at what @binji's done yet, but if it's incompatible with what I have then I guess we have to make the designs converge. |
I took a quick look, it seems like the main differences are these:
|
Another major difference is that FF |
FF also requires the presence of a special section in the module to enable the feature at all, https://github.com/lars-t-hansen/moz-gc-experiments/blob/master/version2.md#special-section-required. This was just paranoia on my part. If we're converging on some basic aspects of the design and some shared opcodes I could remove that requirement. |
That's just syntax, right? Easy enough to fix... |
I think |
@jakobkummerow It there any build of V8 that include this prototype for testing? |
@Horcrux7 Not yet. The V8-side work is far from complete (even the "MVA" subset). I'll post an update here when there's something to play with. |
@jakobkummerow I think the MVA subset should be enough for first test. |
Firefox update landing before long: https://bugzilla.mozilla.org/show_bug.cgi?id=1624363 though this will only have optref for now, buyer beware. |
Is there already something I can use to run .wat files that contain white and green instructions from the Google document linked above? The reason I ask is that it would be really nice to run the code emitted by an experimental compiler backend in someone else's GC prototype. |
@sabine you may be able to use the wabt interpreter, if your cases are simple enough. See the GC branch: https://github.com/WebAssembly/wabt/tree/gc |
We're looking at updating SpiderMonkey for the changes introduced by removing funcref/anyref subtyping in WebAssembly/reference-types#69. One question that arose is what to do for our GC prototype, and I think it'd be good to align with other prototypes. One approach that we're considering is to keep all subtyping logic, but conditionally enable it for when the GC prototype is enabled. So when GC is not-enabled, there would be no subtypes. But when GC is enabled, the old subtyping model of Another option would be to create a new subtyping hierarchy for the GC types such as a |
In V8's upcoming GC prototype, our situation is that we're approaching this from the other direction (as we don't have an existing prototype to modify), and our preliminary plan is to build only the subtyping that we absolutely need, considering that the larger questions around how subtyping should work are still in flux (as evidenced e.g. by the recent funcref change, as well as the larger nominal-vs-structural discussion). At a minimum, we think we'll need I'm open to thoughts about implementing more. Since we'll use a unified representation internally anyway, adding |
Is there a newer version of the prototype which reflect the latest changes for removing subtyping? |
@Horcrux7, subtyping was only removed from the reference types proposal. It's still included in the GC proposal. |
@rossberg With the "removing subtyping" there are some incompatible changes like the extra parameter for |
Status update: we have updated our "prototype specification" document to reflect the latest changes to the relevant proposals, as well as our plans for a "milestone 2". Aside from that, we have kept the specification as backwards-compatible as possible. We have also introduced columns to indicate the implementation status (currently for SpiderMonkey/V8/WABT, happy to add others if there are any) and are inviting representatives of those prototypes to indicate their status there if they wish. The idea is that interested users/consumers can easily see how far along the various prototypes are, and which implementation might fit their current needs. The link to the doc is still https://bit.ly/3cWcm6Q. |
Are there currently plans to implement |
@sabine, to clarify, anyref was merely removed (deferred) from the initial reftypes proposal. It has moved to the type imports proposal, which is a prerequisite of this one. Both type imports and the GC proposal as it stands would be of rather limited use without some version of anyref. |
Regarding implementation plans: as our document https://bit.ly/3cWcm6Q describes, we haven't committed to implementing i31ref yet. That doesn't rule out that we might implement it in Q3; it only means that so far it hasn't had priority. Do you have a particular need or use case for it (that's not adequately served by |
@jakobkummerow Using the workaround of boxing all the I'm only worried that, if Edit: to elaborate: When I translate the compiler primitives that operate on unboxed 31-bit integers ( |
@sabine, it's hard to say what the future of One thing I'll note specific to OCaml is that its semantics for |
Just to be clear, there currently is no plan for dropping i31ref. The GC proposal clearly needs a way to express unboxed scalars, and in a way that is predictable and works across platforms. One could argue that this is just a performance improvement, and technically that's true. However, it also is such a fundamental feature that it should be part of the basic design evaluation that we want to do with the MVP. Without a proven way to incorporate unboxed scalars, practical usability of the GC extension will remain completely unclear for a whole range of languages. |
We will add i31ref to the V8 prototype soon. |
@jakobkummerow would love to hear along what paths adding @rossberg that still appears to be a matter of opinion. |
Side question: to use the V8 prototype, we use the instructions at https://v8.dev/docs/build to build V8 from source, or is there a simpler/quicker method to get a build of the bleeding-edge V8? |
https://github.com/GoogleChromeLabs/jsvu is a handy tool that downloads and updates canary builds of V8 and other engines. |
@sabine I use https://github.com/nodejs/node-v8 |
@jakobkummerow Are you interested in bug reports or is it too early for that? Currently I have a crash with 0xC0000005. |
FYI: I haven't made much progress on wabt, but I have implemented milestone2 support in wasp: https://github.com/binji/wasp The plan is to merge the wasp library into wabt, but for now wasp has its own tool to do the text -> binary conversion. |
@Horcrux7 yes, I'm interested in bug reports. Probably makes sense not to derail this thread; you can email me (address in the doc linked in the OP) or file a bug at crbug.com/v8/new and assign it to me. Please include repro instructions :-) |
Heads up: we're planning to adopt the lastest changes to the proposal, which will break backwards compatibility. Please comment on this draft doc: https://docs.google.com/document/d/1yAWU3dbs8kUa_wcnnirDxUu9nEBsNfq0Xo90OWx6yuo/edit# if you have questions/comments/concerns. |
FYI, we are currently adding support for two experimental instructions that are not (yet?) included in this proposal:
Both instructions are described in our existing document: https://bit.ly/3cWcm6Q. To use them, pass the new flag The idea is to gather data, and in particular to verify the assumption that these instructions provide practical benefits. Depending on the results, we will either officially request that they (or something like them) be included in the GC proposal, or drop them again. |
Closing this issue since it hasn't been used for announcements in over a year, although note that we have continued to keep the link @jakobkummerow shared pointing to the latest version of the informal prototype spec as it has evolved. |
Here's an announcement :-) (but I'm happy to keep this issue closed) For a while now, "milestone 5" of the prototype spec has been the de-facto state of things despite officially still being marked as "draft". I've just made it official to reflect reality. It's at the old link: https://bit.ly/3cWcm6Q A number of backwards-incompatible changes have accumulated recently; we're planning to incorporate those in the next version of the prototype spec, so that'll be a breaking change. Details TBD -- I guess we'll prepare patches (and/or land code behind flags), make some announcement, and then flip the switch (in a coordinated manner across both V8 and Binaryen). |
Just FYI to anyone who's interested: we have started prototyping this proposal in both wabt and V8.
We've consolidated the plan for the prototypes in this document to ensure that both implementations are compatible.
I'd like to emphasize that we're not trying to shortcut or sidestep the ongoing discussion about the specifics of the proposal. The prototypes will not ship (they will remain behind off-by-default flags). We will ship whatever the outcome of the proposal/spec process will be. The prototypes do not constitute an expression of preference/opinion on any of the open questions.
Instead, the idea is to (1) start making progress with the core implementation work we will (most likely) have to do at some point anyway, and (2) hopefully be able to provide feedback to the ongoing discussion, e.g. around practical feasibility of structural type checking, although to be really meaningful this might require some Wasm producers (i.e., source languages) to volunteer to invest the effort to produce modules targeting the prototypes.
The text was updated successfully, but these errors were encountered: