Skip to content

Commit

Permalink
Merge pull request #107 from dhil/sync
Browse files Browse the repository at this point in the history
Sync with WebAssembly/spec branch `wasm-3.0`.
  • Loading branch information
dhil authored Jan 15, 2025
2 parents 5010b4e + eb0dbce commit 0ebce95
Show file tree
Hide file tree
Showing 129 changed files with 17,752 additions and 1,992 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-interpreter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: CI for interpreter & tests

on:
push:
branches: [ main ]
branches: [ main, wasm-3.0 ]
paths: [ .github/**, interpreter/**, test/** ]

pull_request:
branches: [ main ]
branches: [ main, wasm-3.0 ]
paths: [ .github/**, interpreter/**, test/** ]

# Allows you to run this workflow manually from the Actions tab
Expand All @@ -17,17 +17,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup OCaml
uses: ocaml/setup-ocaml@v2
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 4.14.x
- name: Setup OCaml tools
run: opam install --yes ocamlfind.1.9.5 js_of_ocaml.4.0.0 js_of_ocaml-ppx.4.0.0
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 19.x
node-version: 20.x
- name: Build interpreter
run: cd interpreter && opam exec make
- name: Run tests
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/ci-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: CI for specs

on:
push:
branches: [ main ]
branches: [ main, wasm-3.0 ]
paths: [ .github/**, document/** ]

pull_request:
branches: [ main ]
branches: [ main, wasm-3.0 ]
paths: [ .github/**, document/** ]

# Allows you to run this workflow manually from the Actions tab
Expand All @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- name: Setup Bikeshed
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Run Bikeshed
Expand All @@ -59,7 +59,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Run Bikeshed
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -147,7 +147,7 @@ jobs:
- build-spec-versions
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Create output directory
run: mkdir _output && cp document/index.html _output/index.html
- name: Download core spec artifact
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
path: _output/versions
- name: Publish to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: ./_output
github_token: ${{ secrets.GITHUB_TOKEN }}
33 changes: 25 additions & 8 deletions .github/workflows/w3c-publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Publish to W3C TR space
name: Validate/Publish to W3C TR space

on:
push:
branches: [ main ]
paths: [ .github/**, document/** ]
pull_request:
paths: [ .github/**, document/** ]

# Allows you to run this workflow manually from the Actions tab, gh CLI tool,
# or REST API. THe w3c-status options correspond to the valid options for
Expand All @@ -23,30 +25,45 @@ on:
- CRD
- CR

env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
W3C_STATUS: ${{ github.event_name == 'workflow_dispatch' && inputs.w3c-status || 'WD' }}

jobs:
publish-to-w3c-TR:
if: github.repository == 'WebAssembly/spec'
strategy:
fail-fast: false
matrix:
spec: [core, js-api, web-api]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Setup TexLive
if: ${{ matrix.spec == 'core' }}
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- name: Setup Sphinx
if: ${{ matrix.spec == 'core' }}
run: pip install six && pip install sphinx==5.1.0
- name: Publish all specs to their https://www.w3.org/TR/ URLs
run: cd document && make -e WD-echidna-CI
- name: Publish ${{ matrix.spec }} spec to its https://www.w3.org/TR/ URL
if: env.W3C_ECHIDNA_TOKEN_CORE
run: cd document && make -e -C ${{ matrix.spec }} WD-echidna-CI
env:
W3C_STATUS: ${{ github.event_name == 'push' && 'CRD' || inputs.w3c-status }}
W3C_ECHIDNA_TOKEN_CORE: ${{ secrets.W3C_ECHIDNA_TOKEN_CORE }}
W3C_ECHIDNA_TOKEN_JSAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_JSAPI }}
W3C_ECHIDNA_TOKEN_WEBAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_WEBAPI }}
YARN_ENABLE_IMMUTABLE_INSTALLS: false
ECHIDNA_DRYRUN: ${{ !(github.event_name == 'push' && github.repository == 'WebAssembly/spec' && github.ref == 'refs/heads/main') }}
- name: Validate ${{ matrix.spec }} spec with Echidna
if: env.W3C_USERNAME
run: cd document && make -e -C ${{ matrix.spec }} WD-echidna
env:
W3C_USERNAME: ${{ secrets.W3C_USERNAME }}
W3C_PASSWORD: ${{ secrets.W3C_PASSWORD }}
13 changes: 9 additions & 4 deletions document/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ NAME = WebAssembly
DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2024/WG-06-12.md
TAR = tar
DEADLINE = $(shell date -d "+30 days" +%Y-%m-%d 2>/dev/null || date -v +30d +%Y-%m-%d)
ECHIDNA_DRYRUN = true

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand Down Expand Up @@ -196,9 +197,11 @@ WD-echidna: WD-tar
curl 'https://labs.w3.org/echidna/api/request' \
--user '$(W3C_USERNAME):$(W3C_PASSWORD)' \
-F "tar=@$(BUILDDIR)/WD.tar" \
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
-F "decision=$(DECISION_URL)" \
-F "dry-run=$(ECHIDNA_DRYRUN)" | tee $(BUILDDIR)/WD-echidna-id.txt
python3 ../util/check-echidna-status.py $(BUILDDIR)
@echo
@echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
@echo "Uploaded $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"

.PHONY: WD-echidna-CI
WD-echidna-CI: WD-tar
Expand All @@ -210,9 +213,11 @@ WD-echidna-CI: WD-tar
curl 'https://labs.w3.org/echidna/api/request' \
-F "tar=@$(BUILDDIR)/WD.tar" \
-F "token=$(W3C_ECHIDNA_TOKEN_CORE)" \
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
-F "decision=$(DECISION_URL)" \
-F "dry-run=$(ECHIDNA_DRYRUN)" | tee $(BUILDDIR)/WD-echidna-id.txt
python3 ../util/check-echidna-status.py $(BUILDDIR)
@echo
@echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
@echo "Uploaded $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"

.PHONY: diff
diff: bikeshed
Expand Down
94 changes: 91 additions & 3 deletions document/core/appendix/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Allowed basic numeric computations in constant expressions. [#proposal-extconst]
- |GLOBALGET| for any previously declared immutable :ref:`global <syntax-global>`

.. note::
The :ref:`garbage collection <extension-gc>` added further constant instructions.
The :ref:`garbage collection <extension-gc>` extension added further constant instructions.


.. index:: instruction, function, call
Expand Down Expand Up @@ -389,6 +389,44 @@ Added the ability to use multiple memories per module. [#proposal-multimem]_
* :ref:`Data segments <syntax-elem>` take a :ref:`memory index <syntax-memidx>`


.. index:: address type, number type, table, memory, instruction

64-bit Address Space
....................

Added the ability to declare an :math:`\I64` :ref:`address type <syntax-addrtype>` for :ref:`tables <syntax-tabletype>` and :ref:`memories <syntax-memtype>`. [#proposal-addr64]_

* :ref:`Address types <syntax-addrtype>` denote a subset of the integral :ref:`number types <syntax-numtype>`

* :ref:`Table types <syntax-tabletype>` include an :ref:`address type <syntax-addrtype>`

* :ref:`Memory types <syntax-memtype>` include an :ref:`address type <syntax-addrtype>`

* Operand types of :ref:`table <syntax-instr-table>` and :ref:`memory <syntax-instr-memory>` instructions now depend on the subject's declared address type:

- |TABLEGET|
- |TABLESET|
- |TABLESIZE|
- |TABLEGROW|
- |TABLEFILL|
- |TABLECOPY|
- |TABLEINIT|
- |MEMORYSIZE|
- |MEMORYGROW|
- |MEMORYFILL|
- |MEMORYCOPY|
- |MEMORYINIT|
- :math:`t\K{.load}`
- :math:`t\K{.store}`
- :math:`t\K{.load}\!N\!\K{\_}\sx`
- :math:`t\K{.store}\!N`
- :math:`\K{v128.load}\!N\!\K{x}\!M\!\K{\_}\sx`
- :math:`\K{v128.load}\!N\!\K{\_zero}`
- :math:`\K{v128.load}\!N\!\K{\_splat}`
- :math:`\K{v128.load}\!N\!\K{\_lane}`
- :math:`\K{v128.store}\!N\!\K{\_lane}`


.. index:: reference, reference type, heap type, value type, local, local type, instruction, instruction type, table, function, function type, matching, subtyping

Typeful References
Expand Down Expand Up @@ -424,6 +462,8 @@ Added more precise types for references. [#proposal-typedref]_

* Refined typing of :ref:`local instructions <valid-instr-variable>` and :ref:`instruction sequences <valid-instr-seq>` to track the :ref:`initialization status <syntax-init>` of :ref:`locals <syntax-local>` with non-:ref:`defaultable <valid-defaultable>` type

* Refined decoding of :ref:`active <syntax-elemmode>` :ref:`element segments <binary-elem>` with implicit element type and plain function indices (opcode :math:`0`) to produce :ref:`non-nullable <syntax-nullable>` :ref:`reference type <syntax-reftype>`.

* Extended :ref:`table definitions <syntax-table>` with optional initializer expression


Expand Down Expand Up @@ -518,6 +558,48 @@ Added managed reference types. [#proposal-gc]_
- |EXTERNCONVERTANY|


.. index:: instruction, vector instruction, SIMD

Relaxed Vector Instructions
...........................

Added new *relaxed* vector instructions,
whose behaviour is non-deterministic and implementation-dependent. [#proposal-relaxed]_

* New binary :ref:`vector instruction <syntax-instr-relaxed>`:

- :math:`\K{f}\!N\!\K{x}\!M\!\K{.relaxed\_min}`
- :math:`\K{f}\!N\!\K{x}\!M\!\K{.relaxed\_max}`
- :math:`\K{i16x8.relaxed\_q15mulr\_s}`
- :math:`\K{i16x8.relaxed\_dot\_i8x16\_i7x16\_s}`

* New ternary :ref:`vector instruction <syntax-instr-relaxed>`:

- :math:`\K{f}\!N\!\K{x}\!M\!\K{.relaxed\_madd}`
- :math:`\K{f}\!N\!\K{x}\!M\!\K{.relaxed\_nmadd}`
- :math:`\K{i}\!N\!\K{x}\!M\!\K{.relaxed\_laneselect}`
- :math:`\K{i32x4.relaxed\_dot\_i8x16\_i7x16\_add\_s}`

* New conversion :ref:`vector instructions <syntax-instr-relaxed>`:

- :math:`\K{i32x4.relaxed\_trunc\_f32x4\_}\sx`
- :math:`\K{i32x4.relaxed\_trunc\_f64x2\_}\sx\K{\_zero}`

* New byte reordering :ref:`vector instruction <syntax-instr-relaxed>`:

- :math:`\K{i8x16.relaxed\_swizzle}`


.. index:: determinism, non-determinism, profiles

Profiles
........

Introduced the concept of :ref:`profile <profiles>` for specifying language subsets.

* A new profile defining a :ref:`deterministic <profile-deterministic>` mode of execution.


.. index:: text format, annotation, custom section, identifier, module, type, function, local, structure field

Custom Annotations
Expand All @@ -542,7 +624,7 @@ mirroring the role of custom sections in the binary format. [#proposal-annot]_


.. [#proposal-extconst]
https://github.com/WebAssembly/extended-const/blob/main/proposals/extended-const/
https://github.com/WebAssembly/spec/tree/main/proposals/extended-const/
.. [#proposal-tailcall]
https://github.com/WebAssembly/spec/tree/main/proposals/tail-call/
Expand All @@ -551,13 +633,19 @@ mirroring the role of custom sections in the binary format. [#proposal-annot]_
https://github.com/WebAssembly/spec/tree/main/proposals/exception-handling/
.. [#proposal-multimem]
https://github.com/WebAssembly/multi-memory/blob/main/proposals/multi-memory/
https://github.com/WebAssembly/spec/tree/main/proposals/multi-memory/
.. [#proposal-addr64]
https://github.com/WebAssembly/spec/tree/main/proposals/memory64/
.. [#proposal-typedref]
https://github.com/WebAssembly/spec/tree/main/proposals/function-references/
.. [#proposal-gc]
https://github.com/WebAssembly/spec/tree/main/proposals/gc/
.. [#proposal-relaxed]
https://github.com/WebAssembly/spec/tree/main/proposals/relaxed-simd/
.. [#proposal-annot]
https://github.com/WebAssembly/annotations/tree/main/proposals/annotations/
Loading

0 comments on commit 0ebce95

Please sign in to comment.