Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

FYI: prototyping work in wabt and V8 #81

Closed

Description

@jakobkummerow

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.

Activity

  1. lars-t-hansen commented on Mar 18, 2020

    @lars-t-hansen
    Contributor

    That's great news. Firefox has also had a prototype for about a year or so, documented here.

  2. rossberg commented on Mar 18, 2020

    @rossberg
    Member

    Excellent news! I'll push forward with the reference interpreter, probably focussing on the function refs and type imports proposals first.

  3. Horcrux7 commented on Mar 18, 2020

    @Horcrux7

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

  4. skuzmich commented on Mar 18, 2020

    @skuzmich

    Kotlin/Wasm prototype also currently targets Firefox GC instruction set. In order to fully port it to WABT and V8 we would need optref, ref.cast and ref.test on top of the MVA.

  5. RossTate commented on Mar 18, 2020

    @RossTate
    Contributor

    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.

  6. binji commented on Mar 18, 2020

    @binji
    Member

    @skuzmich thanks for the info! I'll make sure to work on those next.

  7. lars-t-hansen commented on Mar 19, 2020

    @lars-t-hansen
    Contributor

    @lars-t-hansen Do you plan to adapt the binary coding of Firefox GC as soon as the implementation in WABT progresses?

    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.

  8. binji commented on Mar 19, 2020

    @binji
    Member

    I took a quick look, it seems like the main differences are these:

    name v8/wabt FF
    structtype form 0x5f 0x50
    ref.eq 0xd3 0xf0
    struct.new 0xfb00 0xfc50
    struct.get 0xfb03 0xfc51
    struct.set 0xfb06 0xfc52
    struct.narrow X 0xfc53
  9. skuzmich commented on Mar 19, 2020

    @skuzmich

    Another major difference is that FF (ref T) is v8 (optref T)

  10. lars-t-hansen commented on Mar 20, 2020

    @lars-t-hansen
    Contributor

    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.

  11. lars-t-hansen commented on Mar 20, 2020

    @lars-t-hansen
    Contributor

    Another major difference is that FF (ref T) is v8 (optref T)

    That's just syntax, right? Easy enough to fix...

  12. binji commented on Mar 20, 2020

    @binji
    Member

    I think optref is nullable and ref is non-nullable.
    edit: ah, sorry I see what you mean. :-)

  13. Horcrux7 commented on Mar 21, 2020

    @Horcrux7

    @jakobkummerow It there any build of V8 that include this prototype for testing?

  14. jakobkummerow commented on Mar 21, 2020

    @jakobkummerow
    ContributorAuthor

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

  15. Horcrux7 commented on Mar 22, 2020

    @Horcrux7

    @jakobkummerow I think the MVA subset should be enough for first test.

  16. 15 remaining items

  17. rossberg commented on Jun 29, 2020

    @rossberg
    Member

    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.

  18. jakobkummerow commented on Jun 29, 2020

    @jakobkummerow
    ContributorAuthor

    We will add i31ref to the V8 prototype soon.

  19. aardappel commented on Jun 29, 2020

    @aardappel

    @jakobkummerow would love to hear along what paths adding i31ref causes conditionals.

    @rossberg that still appears to be a matter of opinion.

  20. sabine commented on Jul 17, 2020

    @sabine

    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?

  21. skuzmich commented on Jul 17, 2020

    @skuzmich

    https://github.com/GoogleChromeLabs/jsvu is a handy tool that downloads and updates canary builds of V8 and other engines.

  22. Horcrux7 commented on Jul 17, 2020

    @Horcrux7

    @sabine I use https://github.com/nodejs/node-v8
    It is a node build with v8-canary. You can download directly the binaries. But currently it is broken for Windows. Only the other platforms are available.

  23. Horcrux7 commented on Sep 17, 2020

    @Horcrux7

    @jakobkummerow Are you interested in bug reports or is it too early for that? Currently I have a crash with 0xC0000005.

  24. binji commented on Sep 17, 2020

    @binji
    Member

    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.

  25. jakobkummerow commented on Sep 18, 2020

    @jakobkummerow
    ContributorAuthor

    @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 :-)

  26. jakobkummerow commented on Jan 15, 2021

    @jakobkummerow
    ContributorAuthor

    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.

  27. added a commit that references this issue on Feb 24, 2021
  28. jakobkummerow commented on May 27, 2021

    @jakobkummerow
    ContributorAuthor

    FYI, we are currently adding support for two experimental instructions that are not (yet?) included in this proposal:

    • array.copy: copy a range of elements from one array to another, similar to bulk memory operations
    • rtt.fresh_sub: like rtt.sub, but always creating a fresh RTT (never caching or canonicalizing), making it possible to express Java's type system in terms of RTT-based operations.

    Both instructions are described in our existing document: https://bit.ly/3cWcm6Q. To use them, pass the new flag --experimental-wasm-gc-experiments to d8. The existing --experimental-wasm-gc flag will continue to enable only the features that are part of this proposal.

    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.

  29. tlively commented on Jun 16, 2022

    @tlively
    Member

    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.

  30. jakobkummerow commented on Jun 27, 2022

    @jakobkummerow
    ContributorAuthor

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

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