Skip to content

Commit

Permalink
Merge pull request #29 from dhil/wasmfx-wasm3.0+exn
Browse files Browse the repository at this point in the history
Merge with wasm-3.0+exn
  • Loading branch information
dhil committed Apr 12, 2024
2 parents 0af205c + 02de8d1 commit b0a7c47
Show file tree
Hide file tree
Showing 164 changed files with 14,603 additions and 1,800 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-interpreter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: CI for interpreter & tests
on:
push:
branches: [ main ]
paths: [ interpreter/**, test/** ]
paths: [ .github/**, interpreter/**, test/** ]

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

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -31,6 +31,6 @@ jobs:
- name: Build interpreter
run: cd interpreter && opam exec make
- name: Run tests
# TODO: disable node.js run until it fully implements proposal
# TODO: reactiate node once it supports all of Wasm 3.0
# run: cd interpreter && opam exec make JS=node ci
run: cd interpreter && opam exec make test
30 changes: 27 additions & 3 deletions .github/workflows/ci-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: CI for specs
on:
push:
branches: [ main ]
paths: [ document/** ]
paths: [ .github/**, document/** ]

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

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -40,6 +40,25 @@ jobs:
name: core-rendered
path: document/core/_build/html

build-legacy-exceptions-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup TexLive
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- name: Setup Sphinx
run: pip install six && pip install sphinx==5.1.0
- name: Build main spec
run: cd document/legacy/exceptions && make main
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: legacy-exceptions-rendered
path: document/legacy/exceptions/_build/html

build-js-api-spec:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -72,7 +91,7 @@ jobs:

publish-spec:
runs-on: ubuntu-latest
needs: [build-core-spec, build-js-api-spec, build-web-api-spec]
needs: [build-core-spec, build-legacy-exceptions-spec, build-js-api-spec, build-web-api-spec]
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand All @@ -83,6 +102,11 @@ jobs:
with:
name: core-rendered
path: _output/core
- name: Download legacy exceptions spec artifact
uses: actions/download-artifact@v2
with:
name: legacy-exceptions-rendered
path: _output/legacy/exceptions
- name: Download JS API spec artifact
uses: actions/download-artifact@v2
with:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/w3c-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to W3C TR space

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

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
publish-to-w3c-TR:
runs-on: ubuntu-latest
# TODO(dhil): The following effectively disables this workflow. It
# should be removed before merging with upstream.
if: false
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Setup TexLive
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- name: Setup Sphinx
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
env:
STATUS: --md-status=WD
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
49 changes: 49 additions & 0 deletions deploy_key
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn
NhAAAAAwEAAQAAAgEAn9FUrQzWcgEOHsDJ+f7L0g7xIYrdBb3K1dQqFWFidZcL8KYMMR0/
CEYRXfSn3EcvpYnRoIjWfGQgqOpA90FMaAwqdoK72ByW7q2C4ymjX5xR8XFyG5YJVvjaMe
STXZlynQSOH9lXU5RooeEwRatgQizuwB/Bqahry/8FOfDhVlNO26IbEyJPd23qeyAd+42C
OTE5oWHEJ3TKSWSfwTAhfrIlIg+dWiSx/IUcLc+7Ms5EpQh3ebX49oaW00SWRDnyqoM95m
D+Uc3DuTFJyKdHlLouESdNrE9LeBms5N/bHSgedVyZ5fL9SHC6P1HmgDPFspmO6z1s15/a
5y5hf9zHVoj1ha54LSaPlE5/L5hpY6PCH7fepRXhw84VIQV74IsJow1XUbkmfKkjW3PeBq
CF5cTKF2LK65SraxEfNMLU0ThOH6B6yzePq7JF+05VGMh2G2Wkwy11pezeqW5tPU1M2qwS
RN8jAFKIwuC7B73drz8yMhF8MfTW4iGM4RqhQRCK22xmVtzwYFwRKUM++p2iOggGi42jnV
skv7/yQ6XcaEm+2Jx3C2zy/5OdLql9z8gmKsH4jpQUADmae8KBfJCqHZrtvhRTqH99E3th
pIKcpzY+n5uhNCyrY+hTfB44/EIntWkXDTLwVVRmmOyHSvEA7/Dz1vtA7gY9Nu25xY/SXS
sAAAc4dIF4rHSBeKwAAAAHc3NoLXJzYQAAAgEAn9FUrQzWcgEOHsDJ+f7L0g7xIYrdBb3K
1dQqFWFidZcL8KYMMR0/CEYRXfSn3EcvpYnRoIjWfGQgqOpA90FMaAwqdoK72ByW7q2C4y
mjX5xR8XFyG5YJVvjaMeSTXZlynQSOH9lXU5RooeEwRatgQizuwB/Bqahry/8FOf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4xQSoJVH3IikpodQAuXTdL5utuAzgVEL
Xpk1XVyVPkFGitmNqTr3D2gKnPnkQf8KYsRmzt4bPKDrKOBleqYbFSabyHUNJEaW7pmf8+
fNbVF9dWMmyHAAAAAAEC
-----END OPENSSH PRIVATE KEY-----
1 change: 1 addition & 0 deletions deploy_key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCf0VStDNZyAQ4ewMn5/svSDvEhit0FvcrV1CoVYWJ1lwvwpgwxHT8IRhFd9KfcRy+lidGgiNZ8ZCCo6kD3QUxoDCp2grvYHJburYLjKaNfnFHxcXIblglW+Nox5JNdmXKdBI4f2VdTlGih4TBFq2BCLO7AH8GpqGvL/wU58OFWU07bohsTIk93bep7IB37jYI5MTmhYcQndMpJZJ/BMCF+siUiD51aJLH8hRwtz7syzkSlCHd5tfj2hpbTRJZEOfKqgz3mYP5RzcO5MUnIp0eUui4RJ02sT0t4Gazk39sdKB51XJnl8v1IcLo/UeaAM8WymY7rPWzXn9rnLmF/3MdWiPWFrngtJo+UTn8vmGljo8Ift96lFeHDzhUhBXvgiwmjDVdRuSZ8qSNbc94GoIXlxMoXYsrrlKtrER80wtTROE4foHrLN4+rskX7TlUYyHYbZaTDLXWl7N6pbm09TUzarBJE3yMAUojC4LsHvd2vPzIyEXwx9NbiIYzhGqFBEIrbbGZW3PBgXBEpQz76naI6CAaLjaOdWyS/v/JDpdxoSb7YnHcLbPL/k50uqX3PyCYqwfiOlBQAOZp7woF8kKodmu2+FFOof30Te2GkgpynNj6fm6E0LKtj6FN8Hjj8Qie1aRcNMvBVVGaY7IdK8QDv8PPW+0DuBj027bnFj9JdKw==
22 changes: 21 additions & 1 deletion document/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
DIRS = core js-api web-api
DIRS = core js-api web-api legacy/exceptions
FILES = index.html
BUILDDIR = _build
TAR = tar

# Global targets.

Expand All @@ -24,6 +25,25 @@ clean: $(DIRS:%=clean-%)
.PHONY: diff
diff: $(DIRS:%=diff-%)

# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-tar
.PHONY: WD-tar
WD-tar:
for dir in $(DIRS); \
do STATUS=--md-status=WD TAR=$(TAR) $(MAKE) -e -C $$dir $@;\
done

# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-echidna
.PHONY: WD-echidna
WD-echidna:
for dir in $(DIRS); \
do $(MAKE) -e -C $$dir $@;\
done

.PHONY: WD-echidna-CI
WD-echidna-CI:
for dir in $(DIRS); \
do $(MAKE) -e -C $$dir $@;\
done

# Directory-specific targets.

Expand Down
22 changes: 20 additions & 2 deletions document/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ BUILDDIR = _build
STATICDIR = _static
DOWNLOADDIR = _download
NAME = WebAssembly
DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2017/WG-12-06.md
TAR = tar

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
Expand Down Expand Up @@ -148,7 +150,7 @@ bikeshed: $(GENERATED)
@echo
@echo =========================================================================
mkdir -p $(BUILDDIR)/bikeshed_mathjax/
bikeshed spec index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
bikeshed spec $(STATUS) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
mkdir -p $(BUILDDIR)/html/bikeshed/
(cd util/katex/ && yarn && yarn build && npm install --only=prod)
python3 util/mathjax2katex.py $(BUILDDIR)/bikeshed_mathjax/index.html \
Expand All @@ -163,9 +165,11 @@ bikeshed: $(GENERATED)
@echo "Build finished. The HTML page is in $(BUILDDIR)/html/bikeshed/."

.PHONY: WD-tar
# macOS tar has no “--transform” option (only GNU tar does), so on macOS,
# do “brew install tar” & run “make” like this: “TAR=gtar make -e WD-tar”
WD-tar: bikeshed
@echo "Building tar file..."
tar cvf \
$(TAR) cvf \
$(BUILDDIR)/WD.tar \
--transform='s|$(BUILDDIR)/html/bikeshed/||' \
--transform='s|index.html|Overview.html|' \
Expand All @@ -190,6 +194,20 @@ WD-echidna: WD-tar
@echo
@echo "Published working draft. 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
@if [ -z $(W3C_ECHIDNA_TOKEN_CORE) ] || \
[ -z $(DECISION_URL) ] ; then \
echo "Must provide W3C_ECHIDNA_TOKEN_CORE and DECISION_URL environment variables"; \
exit 1; \
fi
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
@echo
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"

.PHONY: diff
diff: bikeshed
@echo "Downloading the old single-file html spec..."
Expand Down
24 changes: 23 additions & 1 deletion document/core/appendix/algorithm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Value types are representable as sets of enumerations:
type vec_type = V128
type heap_type =
Any | Eq | I31 | Struct | Array | None |
Func | Nofunc | Extern | Noextern | Bot |
Func | Nofunc | Exn | Noexn | Extern | Noextern | Bot |
Def(def : def_type)
type ref_type = Ref(heap : heap_type, null : bool)
type val_type = num_type | vec_type | ref_type | Bot
Expand Down Expand Up @@ -445,6 +445,28 @@ Other instructions are checked in a similar manner.
pop_val(Ref(Def(types[x])))
pop_val(unpack_field(st.fields[n]))
case (throw x)
pop_vals(tags[x].type.params)
unreachable()
case (try_table t1*->t2* handler*)
pop_vals([t1*])
foreach (handler in handler*)
error_if(ctrls.size() < handler.label)
push_ctrl(catch, [], label_types(ctrls[handler.label]))
switch (handler.clause)
case (catch x)
push_vals(tags[x].type.params)
case (catch_ref x)
push_vals(tags[x].type.params)
push_val(Exnref)
case (catch_all)
skip
case (catch_all_ref)
push_val(Exnref)
pop_ctrl()
push_ctrl(try_table, [t1*], [t2*])
.. note::
It is an invariant under the current WebAssembly instruction set that an operand of :code:`Bot` type is never duplicated on the stack.
This would change if the language were extended with stack instructions like :code:`dup`.
Expand Down
Loading

0 comments on commit b0a7c47

Please sign in to comment.