From c0b3a9c76db2e7d065c9627d69498a46d9f5e389 Mon Sep 17 00:00:00 2001
From: Derek Schuff
Date: Fri, 16 Aug 2024 09:58:25 -0700
Subject: [PATCH 01/43] Add Implementation Report metadata (#1783)
This is necessary for Bikeshed to generate CRs.
---
document/core/index.bs | 1 +
1 file changed, 1 insertion(+)
diff --git a/document/core/index.bs b/document/core/index.bs
index 830c0595c8..b4598d0b2f 100644
--- a/document/core/index.bs
+++ b/document/core/index.bs
@@ -7,6 +7,7 @@ Issue Tracking: GitHub https://github.com/WebAssembly/spec/issues
Level: 2
TR: https://www.w3.org/TR/wasm-core-2/
ED: https://webassembly.github.io/spec/core/bikeshed/
+Implementation Report: https://webassembly.org/features/
Editor: Andreas Rossberg, w3cid 82328
Repository: WebAssembly/spec
Markup Shorthands: css no, markdown no, algorithm no, idl no
From 55aaa6b0d9a39fe5d21be679ecb73689befefd83 Mon Sep 17 00:00:00 2001
From: Dan Gohman
Date: Mon, 19 Aug 2024 12:01:05 -0700
Subject: [PATCH 02/43] [test] Add a few more mixed-type floating-point
expression tests (#1785)
In addition to testing `demote(x-promote(y))`, also test
`demote(promote(y) - x)`. And test similar mixed-type cases for multiply
and divide.
---
test/core/float_exprs.wast | 58 ++++++++++++++++++++++++++++++++++++--
1 file changed, 56 insertions(+), 2 deletions(-)
diff --git a/test/core/float_exprs.wast b/test/core/float_exprs.wast
index e6d4f10e91..274c996652 100644
--- a/test/core/float_exprs.wast
+++ b/test/core/float_exprs.wast
@@ -649,7 +649,8 @@
(assert_return (invoke "no_fold_promote_demote" (f32.const inf)) (f32.const inf))
(assert_return (invoke "no_fold_promote_demote" (f32.const -inf)) (f32.const -inf))
-;; Test that demote(x+promote(y)) is not folded to demote(x)+y.
+;; Test that demote(x+promote(y)) is not folded to demote(x)+y, and that
+;; demote(promote(y)+x) is not folded to y+demote(x).
(module
(func (export "no_demote_mixed_add") (param $x f64) (param $y f32) (result f32)
@@ -670,11 +671,14 @@
(assert_return (invoke "no_demote_mixed_add_commuted" (f32.const 0x1.096f4ap-29) (f64.const -0x1.0d5110e3385bbp-20)) (f32.const -0x1.0ccc5ap-20))
(assert_return (invoke "no_demote_mixed_add_commuted" (f32.const -0x1.24e474p-41) (f64.const -0x1.73852db4e5075p-20)) (f32.const -0x1.738536p-20))
-;; Test that demote(x-promote(y)) is not folded to demote(x)-y.
+;; Test that demote(x-promote(y)) is not folded to demote(x)-y, and that
+;; demote(promote(y)-x) is not folded to y-demote(x).
(module
(func (export "no_demote_mixed_sub") (param $x f64) (param $y f32) (result f32)
(f32.demote_f64 (f64.sub (local.get $x) (f64.promote_f32 (local.get $y)))))
+ (func (export "no_demote_mixed_sub_commuted") (param $y f32) (param $x f64) (result f32)
+ (f32.demote_f64 (f64.sub (f64.promote_f32 (local.get $y)) (local.get $x))))
)
(assert_return (invoke "no_demote_mixed_sub" (f64.const 0x1.a0a183220e9b1p+82) (f32.const 0x1.c5acf8p+61)) (f32.const 0x1.a0a174p+82))
@@ -683,6 +687,56 @@
(assert_return (invoke "no_demote_mixed_sub" (f64.const 0x1.0459f34091dbfp-54) (f32.const 0x1.61ad08p-71)) (f32.const 0x1.045942p-54))
(assert_return (invoke "no_demote_mixed_sub" (f64.const 0x1.a7498dca3fdb7p+14) (f32.const 0x1.ed21c8p+15)) (f32.const -0x1.197d02p+15))
+(assert_return (invoke "no_demote_mixed_sub_commuted" (f32.const 0x1.c5acf8p+61) (f64.const 0x1.a0a183220e9b1p+82)) (f32.const -0x1.a0a174p+82))
+(assert_return (invoke "no_demote_mixed_sub_commuted" (f32.const 0x1.d48ca4p+17) (f64.const -0x1.6e2c5ac39f63ep+30)) (f32.const 0x1.6e3bp+30))
+(assert_return (invoke "no_demote_mixed_sub_commuted" (f32.const 0x1.9d69bcp-12) (f64.const -0x1.98c74350dde6ap+6)) (f32.const 0x1.98c7aap+6))
+(assert_return (invoke "no_demote_mixed_sub_commuted" (f32.const 0x1.61ad08p-71) (f64.const 0x1.0459f34091dbfp-54)) (f32.const -0x1.045942p-54))
+(assert_return (invoke "no_demote_mixed_sub_commuted" (f32.const 0x1.ed21c8p+15) (f64.const 0x1.a7498dca3fdb7p+14)) (f32.const 0x1.197d02p+15))
+
+;; Test that demote(x*promote(y)) is not folded to demote(x)*y, and that
+;; demote(promote(y)*x) is not folded to y*demote(x).
+
+(module
+ (func (export "no_demote_mixed_mul") (param $x f64) (param $y f32) (result f32)
+ (f32.demote_f64 (f64.mul (local.get $x) (f64.promote_f32 (local.get $y)))))
+ (func (export "no_demote_mixed_mul_commuted") (param $y f32) (param $x f64) (result f32)
+ (f32.demote_f64 (f64.mul (f64.promote_f32 (local.get $y)) (local.get $x))))
+)
+
+(assert_return (invoke "no_demote_mixed_mul" (f64.const 0x1.a19789e5aa475p-202) (f32.const 0x1.858cbep+113)) (f32.const 0x1.3db86cp-88))
+(assert_return (invoke "no_demote_mixed_mul" (f64.const 0x1.8f0e6a5a53f15p+140) (f32.const 0x1.2ef826p-107)) (f32.const 0x1.d845d2p+33))
+(assert_return (invoke "no_demote_mixed_mul" (f64.const 0x1.f03aa769e296cp+176) (f32.const 0x1.a9255p-57)) (f32.const 0x1.9c0cdap+120))
+(assert_return (invoke "no_demote_mixed_mul" (f64.const 0x1.9cd70b636bc52p+221) (f32.const 0x1.3f3ac6p-122)) (f32.const 0x1.01676p+100))
+(assert_return (invoke "no_demote_mixed_mul" (f64.const 0x1.c56b4c2991a3cp-170) (f32.const 0x1.1ad242p+48)) (f32.const 0x1.f4ec98p-122))
+
+(assert_return (invoke "no_demote_mixed_mul_commuted" (f32.const 0x1.858cbep+113) (f64.const 0x1.a19789e5aa475p-202)) (f32.const 0x1.3db86cp-88))
+(assert_return (invoke "no_demote_mixed_mul_commuted" (f32.const 0x1.2ef826p-107) (f64.const 0x1.8f0e6a5a53f15p+140)) (f32.const 0x1.d845d2p+33))
+(assert_return (invoke "no_demote_mixed_mul_commuted" (f32.const 0x1.a9255p-57) (f64.const 0x1.f03aa769e296cp+176)) (f32.const 0x1.9c0cdap+120))
+(assert_return (invoke "no_demote_mixed_mul_commuted" (f32.const 0x1.3f3ac6p-122) (f64.const 0x1.9cd70b636bc52p+221)) (f32.const 0x1.01676p+100))
+(assert_return (invoke "no_demote_mixed_mul_commuted" (f32.const 0x1.1ad242p+48) (f64.const 0x1.c56b4c2991a3cp-170)) (f32.const 0x1.f4ec98p-122))
+
+;; Test that demote(x/promote(y)) is not folded to demote(x)/y, and that
+;; demote(promote(y)/x) is not folded to y/demote(x).
+
+(module
+ (func (export "no_demote_mixed_div") (param $x f64) (param $y f32) (result f32)
+ (f32.demote_f64 (f64.div (local.get $x) (f64.promote_f32 (local.get $y)))))
+ (func (export "no_demote_mixed_div_commuted") (param $y f32) (param $x f64) (result f32)
+ (f32.demote_f64 (f64.div (f64.promote_f32 (local.get $y)) (local.get $x))))
+)
+
+(assert_return (invoke "no_demote_mixed_div" (f64.const 0x1.40d0b55d4cee1p+150) (f32.const 0x1.6c7496p+103)) (f32.const 0x1.c2b158p+46))
+(assert_return (invoke "no_demote_mixed_div" (f64.const 0x1.402750f34cd98p-153) (f32.const 0x1.3db8ep-82)) (f32.const 0x1.01f586p-71))
+(assert_return (invoke "no_demote_mixed_div" (f64.const 0x1.3f7ece1a790a7p-37) (f32.const 0x1.a5652p-128)) (f32.const 0x1.8430dp+90))
+(assert_return (invoke "no_demote_mixed_div" (f64.const 0x1.5171328e16885p-138) (f32.const 0x1.10636ap-88)) (f32.const 0x1.3d23cep-50))
+(assert_return (invoke "no_demote_mixed_div" (f64.const 0x1.d3a380fc986ccp+74) (f32.const 0x1.f095b6p+88)) (f32.const 0x1.e227c4p-15))
+
+(assert_return (invoke "no_demote_mixed_div_commuted" (f32.const 0x1.d78ddcp-74) (f64.const 0x1.2c57e125069e2p-42)) (f32.const 0x1.91eed6p-32))
+(assert_return (invoke "no_demote_mixed_div_commuted" (f32.const 0x1.7db224p+26) (f64.const 0x1.1c291ec609ed4p+159)) (f32.const 0x1.57dfp-133))
+(assert_return (invoke "no_demote_mixed_div_commuted" (f32.const 0x1.e7a824p-40) (f64.const 0x1.f4bdb25ff00fcp-137)) (f32.const 0x1.f29f22p+96))
+(assert_return (invoke "no_demote_mixed_div_commuted" (f32.const 0x1.730b8p+80) (f64.const 0x1.880fb331a64cap+210)) (f32.const 0x1.e48ep-131))
+(assert_return (invoke "no_demote_mixed_div_commuted" (f32.const 0x1.7715fcp-73) (f64.const 0x1.6feb1fa66f11bp-198)) (f32.const 0x1.04fcb6p+125))
+
;; Test that converting between integer and float and back isn't folded away.
(module
From 5f7ae488bba28c544dd88769df60b133a2a211c3 Mon Sep 17 00:00:00 2001
From: Dan Gohman
Date: Mon, 19 Aug 2024 12:02:34 -0700
Subject: [PATCH 03/43] [test] Add more tests for sqrt (#1786)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add a sqrt test for values around ¼, where `sqrt(x) - x` is greatest.
And add a few more sqrt test values based on divergences in sqrt
implementations found in the wild.
---
test/core/float_misc.wast | 44 +++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/test/core/float_misc.wast b/test/core/float_misc.wast
index 3d83281d77..a2153cfabd 100644
--- a/test/core/float_misc.wast
+++ b/test/core/float_misc.wast
@@ -587,6 +587,50 @@
(assert_return (invoke "f64.sqrt" (f64.const 0x1.ffffffffffffep-1)) (f64.const 0x1.fffffffffffffp-1))
(assert_return (invoke "f64.sqrt" (f64.const 0x1.ffffffffffffdp-1)) (f64.const 0x1.ffffffffffffep-1))
+;; Test the values of sqrt around ¼, where `sqrt(x) - x` is greatest.
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.fffffep-3)) (f32.const 0x1.fffffep-2))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1p-2)) (f32.const 0x1p-1))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.000002p-2)) (f32.const 0x1p-1))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.000004p-2)) (f32.const 0x1.000002p-1))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.fffffffffffffp-3)) (f64.const 0x1.fffffffffffffp-2))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1p-2)) (f64.const 0x1p-1))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.0000000000001p-2)) (f64.const 0x1p-1))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.0000000000002p-2)) (f64.const 0x1.0000000000001p-1))
+
+;; Test some values that in some systems differ between CPU and DSP.
+;; https://e2e.ti.com/support/processors-group/processors/f/processors-forum/30725/sqrt-function-gives-slightly-different-results---may-be-rounding-problem
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.fb41d4p+37)) (f32.const 0x1.fd9f8p+18))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.fb41d442eeb1bp+37)) (f64.const 0x1.fd9f808a0b68dp+18))
+
+;; Test some values that in some systems differ between CPU and GPU.
+;; https://forums.developer.nvidia.com/t/sqrt-precision/18597
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.3c61b2p+33)) (f32.const 0x1.927ap+16))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.56bd4ep+51)) (f32.const 0x1.a2e80cp+25))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.65f02cp+44)) (f32.const 0x1.2eb544p+22))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.26580cp+30)) (f32.const 0x1.1280d6p+15))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.3c61b112p+33)) (f64.const 0x1.927ap+16))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.56bd4e65c8548p+51)) (f64.const 0x1.a2e80dp+25))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.65f02cc93a1p+44)) (f64.const 0x1.2eb544p+22))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.26580b4cp+30)) (f64.const 0x1.1280d62b818cfp+15))
+
+;; Test some values that in some systems differ between CPU and GPU.
+;; https://github.com/pytorch/pytorch/issues/31250
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.0817fcp-1)) (f32.const 0x1.6fb79ep-1))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.017b98p-1)) (f32.const 0x1.6b15eep-1))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.0817fcp-1)) (f64.const 0x1.6fb79d0dfaffap-1))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.017b98p-1)) (f64.const 0x1.6b15ed0071b95p-1))
+
+;; Test that sqrt is not a "good enough" approximation.
+;; https://sicp.sourceacademy.org/chapters/1.1.7.html
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.2p+3)) (f32.const 0x1.8p+1))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.12p+7)) (f32.const 0x1.768ce6p+3))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.c615dep+0)) (f32.const 0x1.54f2dp+0))
+(assert_return (invoke "f32.sqrt" (f32.const 0x1.f4p+9)) (f32.const 0x1.f9f6e4p+4))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.2p+3)) (f64.const 0x1.8p+1))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.12p+7)) (f64.const 0x1.768ce6d3c11ep+3))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.c615df07a57d3p+0)) (f64.const 0x1.54f2d015acf09p+0))
+(assert_return (invoke "f64.sqrt" (f64.const 0x1.f4p+9)) (f64.const 0x1.f9f6e4990f227p+4))
+
;; Test that the bitwise floating point operators are bitwise on NaN.
(assert_return (invoke "f32.abs" (f32.const nan:0x0f1e2)) (f32.const nan:0x0f1e2))
From fffad73626b84e5823ccaca3f0c9f9ad74f7bb39 Mon Sep 17 00:00:00 2001
From: Derek Schuff
Date: Tue, 20 Aug 2024 17:36:43 -0700
Subject: [PATCH 04/43] Update Makefiles for easier generation of different
document status
This is derived from #1764 but does not actually change the publication
status by default locally or on CI (ED is the default, and the w3c echidna
publication action overrides it to WD).
It also includes a fix to the echidna Makefile rules to exit with an error
in case an underlying step returns an error.
---
.github/workflows/w3c-publish.yml | 2 +-
document/Makefile | 12 ++++++------
document/core/Makefile | 7 ++++---
document/js-api/Makefile | 7 ++++---
document/web-api/Makefile | 7 ++++---
5 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/.github/workflows/w3c-publish.yml b/.github/workflows/w3c-publish.yml
index d68183abfc..8d64962fa2 100644
--- a/.github/workflows/w3c-publish.yml
+++ b/.github/workflows/w3c-publish.yml
@@ -30,7 +30,7 @@ jobs:
- 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_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 }}
diff --git a/document/Makefile b/document/Makefile
index 01a6d93423..50cb081d77 100644
--- a/document/Makefile
+++ b/document/Makefile
@@ -28,21 +28,21 @@ 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 $@;\
+ for dir in $(DIRS); do \
+ TAR=$(TAR) $(MAKE) -e -C $$dir $@ || exit 1; \
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 $@;\
+ for dir in $(DIRS); do \
+ $(MAKE) -e -C $$dir $@ || exit 1; \
done
.PHONY: WD-echidna-CI
WD-echidna-CI:
- for dir in $(DIRS); \
- do $(MAKE) -e -C $$dir $@;\
+ for dir in $(DIRS); do \
+ $(MAKE) -e -C $$dir $@ || exit 1; \
done
# Directory-specific targets.
diff --git a/document/core/Makefile b/document/core/Makefile
index 3ac2f1c814..f72ee715ea 100644
--- a/document/core/Makefile
+++ b/document/core/Makefile
@@ -2,6 +2,7 @@
#
# You can set these variables from the command line.
+W3C_STATUS = ED
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER = a4
@@ -154,7 +155,7 @@ bikeshed: $(GENERATED)
@echo
@echo =========================================================================
mkdir -p $(BUILDDIR)/bikeshed_mathjax/
- bikeshed spec $(STATUS) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
+ bikeshed spec --md-status=$(W3C_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 \
@@ -196,7 +197,7 @@ WD-echidna: WD-tar
-F "tar=@$(BUILDDIR)/WD.tar" \
-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`"
+ @echo "Published $(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
@@ -210,7 +211,7 @@ WD-echidna-CI: 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`"
+ @echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
.PHONY: diff
diff: bikeshed
diff --git a/document/js-api/Makefile b/document/js-api/Makefile
index fcc69f7b39..3880f240fa 100644
--- a/document/js-api/Makefile
+++ b/document/js-api/Makefile
@@ -1,3 +1,4 @@
+W3C_STATUS = ED
BUILDDIR = _build
STATICDIR = _static
DOWNLOADDIR = _download
@@ -8,7 +9,7 @@ TAR = tar
.PHONY: all
all:
mkdir -p $(BUILDDIR)/html
- bikeshed spec index.bs $(BUILDDIR)/html/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html."
.PHONY: publish
@@ -33,7 +34,7 @@ diff: all
# 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: all
- bikeshed spec --md-status=WD index.bs $(BUILDDIR)/html/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
$(TAR) -C $(BUILDDIR)/html --transform="s/index.html/Overview.html/" -cf $(BUILDDIR)/WD.tar index.html
@echo "Built $(BUILDDIR)/WD.tar."
@@ -62,4 +63,4 @@ WD-echidna-CI: WD-tar
-F "token=$(W3C_ECHIDNA_TOKEN_JSAPI)" \
-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`"
+ @echo "Published w$(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
diff --git a/document/web-api/Makefile b/document/web-api/Makefile
index 675593d865..3e8f0632a2 100644
--- a/document/web-api/Makefile
+++ b/document/web-api/Makefile
@@ -1,3 +1,4 @@
+W3C_STATUS = ED
BUILDDIR = _build
STATICDIR = _static
DOWNLOADDIR = _download
@@ -8,7 +9,7 @@ TAR = tar
.PHONY: all
all:
mkdir -p $(BUILDDIR)/html
- bikeshed spec index.bs $(BUILDDIR)/html/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html."
.PHONY: publish
@@ -33,7 +34,7 @@ diff: all
# 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: all
- bikeshed spec --md-status=WD index.bs $(BUILDDIR)/html/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
$(TAR) -C $(BUILDDIR)/html --transform="s/index.html/Overview.html/" -cf $(BUILDDIR)/WD.tar index.html
@echo "Built $(BUILDDIR)/WD.tar."
@@ -62,4 +63,4 @@ WD-echidna-CI: WD-tar
-F "token=$(W3C_ECHIDNA_TOKEN_WEBAPI)" \
-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`"
+ @echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
From ab41b8834b375fe037d8e84223398025fce270fb Mon Sep 17 00:00:00 2001
From: Derek Schuff
Date: Wed, 21 Aug 2024 16:05:45 -0700
Subject: [PATCH 05/43] Add Implementation Report fields to metadata for JS and
Web API specs
Also needed for CR generation
---
document/js-api/index.bs | 1 +
document/web-api/index.bs | 1 +
2 files changed, 2 insertions(+)
diff --git a/document/js-api/index.bs b/document/js-api/index.bs
index 0b9ffd53c5..d6cabb20f3 100644
--- a/document/js-api/index.bs
+++ b/document/js-api/index.bs
@@ -7,6 +7,7 @@ Issue Tracking: GitHub https://github.com/WebAssembly/spec/issues
Level: 2
TR: https://www.w3.org/TR/wasm-js-api-2/
ED: https://webassembly.github.io/spec/js-api/
+Implementation Report: https://webassembly.org/features/
Editor: Ms2ger, w3cid 46309, Igalia
Repository: WebAssembly/spec
Markup Shorthands: css no, markdown yes
diff --git a/document/web-api/index.bs b/document/web-api/index.bs
index 5bd1dac2c6..0269f96bc3 100644
--- a/document/web-api/index.bs
+++ b/document/web-api/index.bs
@@ -7,6 +7,7 @@ Issue Tracking: GitHub https://github.com/WebAssembly/spec/issues
Level: 2
TR: https://www.w3.org/TR/wasm-web-api-2/
ED: https://webassembly.github.io/spec/web-api/
+Implementation Report: https://webassembly.org/features/
Editor: Ms2ger, w3cid 46309, Igalia
Repository: WebAssembly/spec
Abstract: This document describes the integration of WebAssembly with the broader web platform.
From ee82c8e50c5106e0cedada0a083d4cc4129034a2 Mon Sep 17 00:00:00 2001
From: Derek Schuff
Date: Thu, 22 Aug 2024 08:35:20 -0700
Subject: [PATCH 06/43] Add input for workflow dispatch for W3C publish
workflow (#1791)
When manually dispatching workflows, inputs can be collected from the
dispatching user and passed to the workflow. Use this feature to
allow manually setting the W3C_STATE of the document. This will
let us publish CR drafts on every push (once we update the default
state from WD) and CR snapshots on demand.
Co-authored-by: Ms2ger
---
.github/workflows/w3c-publish.yml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/w3c-publish.yml b/.github/workflows/w3c-publish.yml
index 8d64962fa2..d1b2675921 100644
--- a/.github/workflows/w3c-publish.yml
+++ b/.github/workflows/w3c-publish.yml
@@ -7,6 +7,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
+ inputs:
+ w3c-status:
+ required: true
+ type: string
jobs:
publish-to-w3c-TR:
@@ -30,7 +34,7 @@ jobs:
- name: Publish all specs to their https://www.w3.org/TR/ URLs
run: cd document && make -e WD-echidna-CI
env:
- W3C_STATUS: WD
+ W3C_STATUS: ${{ github.event_name == 'push' && 'WD' || 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 }}
From 71755b3feb8e7dc673bce891112e697f122c4a5e Mon Sep 17 00:00:00 2001
From: Diego Frias
Date: Wed, 28 Aug 2024 05:17:06 -0700
Subject: [PATCH 07/43] [test] Add tests ensuring table type is grown in
`table.grow` (#1784)
---
test/core/imports.wast | 21 ---------------------
test/core/memory_grow.wast | 21 +++++++++++++++++++++
test/core/table_grow.wast | 21 +++++++++++++++++++++
3 files changed, 42 insertions(+), 21 deletions(-)
diff --git a/test/core/imports.wast b/test/core/imports.wast
index 0cc07cb1a9..009cc3f345 100644
--- a/test/core/imports.wast
+++ b/test/core/imports.wast
@@ -378,7 +378,6 @@
(assert_trap (invoke "call" (i32.const 3)) "uninitialized element")
(assert_trap (invoke "call" (i32.const 100)) "undefined element")
-
(module
(import "spectest" "table" (table 0 funcref))
(import "spectest" "table" (table 0 funcref))
@@ -578,26 +577,6 @@
(assert_return (invoke "grow" (i32.const 1)) (i32.const -1))
(assert_return (invoke "grow" (i32.const 0)) (i32.const 2))
-(module $Mgm
- (memory (export "memory") 1) ;; initial size is 1
- (func (export "grow") (result i32) (memory.grow (i32.const 1)))
-)
-(register "grown-memory" $Mgm)
-(assert_return (invoke $Mgm "grow") (i32.const 1)) ;; now size is 2
-(module $Mgim1
- ;; imported memory limits should match, because external memory size is 2 now
- (memory (export "memory") (import "grown-memory" "memory") 2)
- (func (export "grow") (result i32) (memory.grow (i32.const 1)))
-)
-(register "grown-imported-memory" $Mgim1)
-(assert_return (invoke $Mgim1 "grow") (i32.const 2)) ;; now size is 3
-(module $Mgim2
- ;; imported memory limits should match, because external memory size is 3 now
- (import "grown-imported-memory" "memory" (memory 3))
- (func (export "size") (result i32) (memory.size))
-)
-(assert_return (invoke $Mgim2 "size") (i32.const 3))
-
;; Syntax errors
diff --git a/test/core/memory_grow.wast b/test/core/memory_grow.wast
index aa56297d25..882e4b5893 100644
--- a/test/core/memory_grow.wast
+++ b/test/core/memory_grow.wast
@@ -309,6 +309,27 @@
(assert_return (invoke "as-memory.grow-size") (i32.const 1))
+(module $Mgm
+ (memory (export "memory") 1) ;; initial size is 1
+ (func (export "grow") (result i32) (memory.grow (i32.const 1)))
+)
+(register "grown-memory" $Mgm)
+(assert_return (invoke $Mgm "grow") (i32.const 1)) ;; now size is 2
+(module $Mgim1
+ ;; imported memory limits should match, because external memory size is 2 now
+ (memory (export "memory") (import "grown-memory" "memory") 2)
+ (func (export "grow") (result i32) (memory.grow (i32.const 1)))
+)
+(register "grown-imported-memory" $Mgim1)
+(assert_return (invoke $Mgim1 "grow") (i32.const 2)) ;; now size is 3
+(module $Mgim2
+ ;; imported memory limits should match, because external memory size is 3 now
+ (import "grown-imported-memory" "memory" (memory 3))
+ (func (export "size") (result i32) (memory.size))
+)
+(assert_return (invoke $Mgim2 "size") (i32.const 3))
+
+
(assert_invalid
(module
(memory 0)
diff --git a/test/core/table_grow.wast b/test/core/table_grow.wast
index 9a931a7fa2..5345a800ff 100644
--- a/test/core/table_grow.wast
+++ b/test/core/table_grow.wast
@@ -108,6 +108,27 @@
(assert_return (invoke "check-table-null" (i32.const 0) (i32.const 19)) (ref.null func))
+(module $Tgt
+ (table (export "table") 1 funcref) ;; initial size is 1
+ (func (export "grow") (result i32) (table.grow (ref.null func) (i32.const 1)))
+)
+(register "grown-table" $Tgt)
+(assert_return (invoke $Tgt "grow") (i32.const 1)) ;; now size is 2
+(module $Tgit1
+ ;; imported table limits should match, because external table size is 2 now
+ (table (export "table") (import "grown-table" "table") 2 funcref)
+ (func (export "grow") (result i32) (table.grow (ref.null func) (i32.const 1)))
+)
+(register "grown-imported-table" $Tgit1)
+(assert_return (invoke $Tgit1 "grow") (i32.const 2)) ;; now size is 3
+(module $Tgit2
+ ;; imported table limits should match, because external table size is 3 now
+ (import "grown-imported-table" "table" (table 3 funcref))
+ (func (export "size") (result i32) (table.size))
+)
+(assert_return (invoke $Tgit2 "size") (i32.const 3))
+
+
;; Type errors
(assert_invalid
From 1c238abcf0900194f27c5d1986e568d9764d5250 Mon Sep 17 00:00:00 2001
From: Derek Schuff
Date: Thu, 29 Aug 2024 17:18:07 -0700
Subject: [PATCH 08/43] Update DECISION_URL for Wasm 2.0 CR advancement (#1794)
---
document/core/Makefile | 2 +-
document/js-api/Makefile | 2 +-
document/web-api/Makefile | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/document/core/Makefile b/document/core/Makefile
index f72ee715ea..2ca6e828a9 100644
--- a/document/core/Makefile
+++ b/document/core/Makefile
@@ -10,7 +10,7 @@ BUILDDIR = _build
STATICDIR = _static
DOWNLOADDIR = _download
NAME = WebAssembly
-DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2017/WG-12-06.md
+DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2024/WG-06-12.md
TAR = tar
# Internal variables.
diff --git a/document/js-api/Makefile b/document/js-api/Makefile
index 3880f240fa..df8b7097cb 100644
--- a/document/js-api/Makefile
+++ b/document/js-api/Makefile
@@ -3,7 +3,7 @@ BUILDDIR = _build
STATICDIR = _static
DOWNLOADDIR = _download
NAME = WebAssembly
-DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2017/WG-12-06.md
+DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2024/WG-06-12.md
TAR = tar
.PHONY: all
diff --git a/document/web-api/Makefile b/document/web-api/Makefile
index 3e8f0632a2..c5bda0b7a5 100644
--- a/document/web-api/Makefile
+++ b/document/web-api/Makefile
@@ -3,7 +3,7 @@ BUILDDIR = _build
STATICDIR = _static
DOWNLOADDIR = _download
NAME = WebAssembly
-DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2017/WG-12-06.md
+DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2024/WG-06-12.md
TAR = tar
.PHONY: all
From 1726692e6c4db3183c5b4022f973ad39d0a51f9d Mon Sep 17 00:00:00 2001
From: Derek Schuff
Date: Tue, 3 Sep 2024 10:44:31 -0700
Subject: [PATCH 09/43] Generate deadline and pass to bikeshed as metadata
(#1795)
The Makefiles now generate a date 30 days in the future, and pass this date to bikeshed as
the standard 'Deadline' metadata.
Along with speced/bikeshed-boilerplate#98, this causes the document
status section to generate with a transition deadline always 30 from the generation time.
---
document/core/Makefile | 3 ++-
document/js-api/Makefile | 7 ++++---
document/web-api/Makefile | 5 +++--
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/document/core/Makefile b/document/core/Makefile
index 2ca6e828a9..df245c881c 100644
--- a/document/core/Makefile
+++ b/document/core/Makefile
@@ -12,6 +12,7 @@ DOWNLOADDIR = _download
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)
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
@@ -155,7 +156,7 @@ bikeshed: $(GENERATED)
@echo
@echo =========================================================================
mkdir -p $(BUILDDIR)/bikeshed_mathjax/
- bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) --md-deadline=$(DEADLINE) 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 \
diff --git a/document/js-api/Makefile b/document/js-api/Makefile
index df8b7097cb..7893918d46 100644
--- a/document/js-api/Makefile
+++ b/document/js-api/Makefile
@@ -5,11 +5,12 @@ DOWNLOADDIR = _download
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)
.PHONY: all
all:
mkdir -p $(BUILDDIR)/html
- bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) --md-deadline=$(DEADLINE) index.bs $(BUILDDIR)/html/index.html
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html."
.PHONY: publish
@@ -34,7 +35,7 @@ diff: all
# 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: all
- bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) --md-deadline=$(DEADLINE) index.bs $(BUILDDIR)/html/index.html
$(TAR) -C $(BUILDDIR)/html --transform="s/index.html/Overview.html/" -cf $(BUILDDIR)/WD.tar index.html
@echo "Built $(BUILDDIR)/WD.tar."
@@ -63,4 +64,4 @@ WD-echidna-CI: WD-tar
-F "token=$(W3C_ECHIDNA_TOKEN_JSAPI)" \
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
@echo
- @echo "Published w$(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
+ @echo "Published $(W3C_STATUS). Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
diff --git a/document/web-api/Makefile b/document/web-api/Makefile
index c5bda0b7a5..2ea8f11ac5 100644
--- a/document/web-api/Makefile
+++ b/document/web-api/Makefile
@@ -5,11 +5,12 @@ DOWNLOADDIR = _download
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)
.PHONY: all
all:
mkdir -p $(BUILDDIR)/html
- bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) --md-deadline=$(DEADLINE) index.bs $(BUILDDIR)/html/index.html
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html."
.PHONY: publish
@@ -34,7 +35,7 @@ diff: all
# 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: all
- bikeshed spec --md-status=$(W3C_STATUS) index.bs $(BUILDDIR)/html/index.html
+ bikeshed spec --md-status=$(W3C_STATUS) --md-deadline=$(DEADLINE) index.bs $(BUILDDIR)/html/index.html
$(TAR) -C $(BUILDDIR)/html --transform="s/index.html/Overview.html/" -cf $(BUILDDIR)/WD.tar index.html
@echo "Built $(BUILDDIR)/WD.tar."
From a6a6b9af56acaa725cfe015bbbcb487dd27a32f5 Mon Sep 17 00:00:00 2001
From: Andreas Rossberg
Date: Wed, 4 Sep 2024 10:58:47 +0200
Subject: [PATCH 10/43] [ci] Bump uplooad/download-artifact to v4 (#1798)
---
.github/workflows/ci-spec.yml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/ci-spec.yml b/.github/workflows/ci-spec.yml
index e88a224d61..a3b4dd875e 100644
--- a/.github/workflows/ci-spec.yml
+++ b/.github/workflows/ci-spec.yml
@@ -35,7 +35,7 @@ jobs:
- name: Run Bikeshed
run: cd document/core && make bikeshed
- name: Upload artifact
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: core-rendered
path: document/core/_build/html
@@ -50,7 +50,7 @@ jobs:
- name: Run Bikeshed
run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html"
- name: Upload artifact
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: js-api-rendered
path: document/js-api/index.html
@@ -65,7 +65,7 @@ jobs:
- name: Run Bikeshed
run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html"
- name: Upload artifact
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: web-api-rendered
path: document/web-api/index.html
@@ -79,17 +79,17 @@ jobs:
- name: Create output directory
run: mkdir _output && cp document/index.html _output/index.html
- name: Download core spec artifact
- uses: actions/download-artifact@v2
+ uses: actions/download-artifact@v4
with:
name: core-rendered
path: _output/core
- name: Download JS API spec artifact
- uses: actions/download-artifact@v2
+ uses: actions/download-artifact@v4
with:
name: js-api-rendered
path: _output/js-api
- name: Download Web API spec artifact
- uses: actions/download-artifact@v2
+ uses: actions/download-artifact@v4
with:
name: web-api-rendered
path: _output/web-api
From 4e722fb12824001f586aed7afe3ed18e3e2a7f2f Mon Sep 17 00:00:00 2001
From: "Soni L."
Date: Thu, 12 Sep 2024 12:10:30 -0300
Subject: [PATCH 11/43] [test] Data count without data segment (#1801)
---
test/core/binary.wast | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/test/core/binary.wast b/test/core/binary.wast
index 466b344f0a..252a86a43d 100644
--- a/test/core/binary.wast
+++ b/test/core/binary.wast
@@ -469,6 +469,28 @@
"\01\00") ;; Passive data section
"data count and data section have inconsistent lengths")
+;; Data count section without data segment section
+(assert_malformed
+ (module binary
+ "\00asm" "\01\00\00\00"
+ "\01\04\01\60\00\00" ;; Type section: 1 type
+ "\03\02\01\00" ;; Function section: 1 function
+ "\05\03\01\00\01" ;; Memory section: 1 memory
+ "\08\01\00" ;; Start section: function 0
+ "\0c\01\01" ;; Data Count section: 1 segment
+ "\0a\0e\01" ;; Code section: 1 function
+
+ ;; function 0
+ "\0c\00"
+ "\41\00" ;; i32.const 0
+ "\41\00" ;; i32.const 0
+ "\41\00" ;; i32.const 0
+ "\fc\08\00\00" ;; memory.init dataidx=0 memidx=0
+ "\0b" ;; end
+ )
+ "data count and data section have inconsistent lengths"
+)
+
;; memory.init requires a datacount section
(assert_malformed
(module binary
From 7ff01f577b3cb0695bddd9083b7d09a289a3ea21 Mon Sep 17 00:00:00 2001
From: Andreas Rossberg
Date: Thu, 12 Sep 2024 17:19:35 +0200
Subject: [PATCH 12/43] [test] Redundant data count section
---
test/core/binary.wast | 90 +++++++++++++++++++++++--------------------
1 file changed, 48 insertions(+), 42 deletions(-)
diff --git a/test/core/binary.wast b/test/core/binary.wast
index 252a86a43d..7b8cec0b60 100644
--- a/test/core/binary.wast
+++ b/test/core/binary.wast
@@ -449,49 +449,47 @@
"\0a\01\00" ;; Code section with 0 functions
)
-;; Fewer passive segments than datacount
+;; Fewer passive segments than data count
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
- "\0c\01\03" ;; Datacount section with value "3"
- "\0b\05\02" ;; Data section with two entries
- "\01\00" ;; Passive data section
- "\01\00") ;; Passive data section
- "data count and data section have inconsistent lengths")
+ "\0c\01\03" ;; Data count section with value 3
+ "\0b\05\02" ;; Data section with two entries
+ "\01\00" ;; Passive data section
+ "\01\00" ;; Passive data section
+ )
+ "data count and data section have inconsistent lengths"
+)
-;; More passive segments than datacount
+;; More passive segments than data count
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
- "\0c\01\01" ;; Datacount section with value "1"
- "\0b\05\02" ;; Data section with two entries
- "\01\00" ;; Passive data section
- "\01\00") ;; Passive data section
- "data count and data section have inconsistent lengths")
+ "\0c\01\01" ;; Data count section with value 1
+ "\0b\05\02" ;; Data section with two entries
+ "\01\00" ;; Passive data section
+ "\01\00" ;; Passive data section
+ )
+ "data count and data section have inconsistent lengths"
+)
-;; Data count section without data segment section
+;; Non-zero data count section without data section
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
- "\01\04\01\60\00\00" ;; Type section: 1 type
- "\03\02\01\00" ;; Function section: 1 function
- "\05\03\01\00\01" ;; Memory section: 1 memory
- "\08\01\00" ;; Start section: function 0
- "\0c\01\01" ;; Data Count section: 1 segment
- "\0a\0e\01" ;; Code section: 1 function
-
- ;; function 0
- "\0c\00"
- "\41\00" ;; i32.const 0
- "\41\00" ;; i32.const 0
- "\41\00" ;; i32.const 0
- "\fc\08\00\00" ;; memory.init dataidx=0 memidx=0
- "\0b" ;; end
+ "\05\03\01\00\01" ;; Memory section with one entry
+ "\0c\01\01" ;; Data count section with value 1
)
"data count and data section have inconsistent lengths"
)
-;; memory.init requires a datacount section
+;; Zero data count section without data section
+(module binary
+ "\00asm" "\01\00\00\00"
+ "\0c\01\00" ;; Data count section with value 0
+)
+
+;; memory.init requires a data count section
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
@@ -511,9 +509,10 @@
"\0b\03\01\01\00" ;; Data section
) ;; end
- "data count section required")
+ "data count section required"
+)
-;; data.drop requires a datacount section
+;; data.drop requires a data count section
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
@@ -530,7 +529,8 @@
"\0b\03\01\01\00" ;; Data section
) ;; end
- "data count section required")
+ "data count section required"
+)
;; passive element segment containing illegal opcode
(assert_malformed
@@ -555,8 +555,10 @@
;; function 0
"\02\00"
- "\0b") ;; end
- "illegal opcode")
+ "\0b" ;; end
+ )
+ "illegal opcode"
+)
;; passive element segment containing type other than funcref
(assert_malformed
@@ -581,8 +583,10 @@
;; function 0
"\02\00"
- "\0b") ;; end
- "malformed reference type")
+ "\0b" ;; end
+ )
+ "malformed reference type"
+)
;; passive element segment containing opcode ref.func
(module binary
@@ -606,7 +610,8 @@
;; function 0
"\02\00"
- "\0b") ;; end
+ "\0b" ;; end
+)
;; passive element segment containing opcode ref.null
(module binary
@@ -630,7 +635,8 @@
;; function 0
"\02\00"
- "\0b") ;; end
+ "\0b" ;; end
+)
;; Type count can be zero
@@ -1195,8 +1201,8 @@
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
- "\0c\01\01" ;; Datacount section with value "1"
- "\0c\01\01" ;; Datacount section with value "1"
+ "\0c\01\01" ;; Data count section with value "1"
+ "\0c\01\01" ;; Data count section with value "1"
)
"unexpected content after last section"
)
@@ -1367,18 +1373,18 @@
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
- "\0c\01\01" ;; Datacount section with value "1"
+ "\0c\01\01" ;; Data count section with value "1"
"\09\01\00" ;; Element section with zero entries
)
"unexpected content after last section"
)
-;; Datacount section out of order
+;; Data count section out of order
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\0a\01\00" ;; Code section with zero entries
- "\0c\01\01" ;; Datacount section with value "1"
+ "\0c\01\01" ;; Data count section with value "1"
)
"unexpected content after last section"
)
From 50429509db9a1cd0f71f8a8b93ded37e4720d4a9 Mon Sep 17 00:00:00 2001
From: Derek Schuff
Date: Thu, 12 Sep 2024 20:08:12 -0700
Subject: [PATCH 13/43] Update W3C TR build from WD to CRD (#1797)
---
.github/workflows/w3c-publish.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/w3c-publish.yml b/.github/workflows/w3c-publish.yml
index d1b2675921..7efbd3d84e 100644
--- a/.github/workflows/w3c-publish.yml
+++ b/.github/workflows/w3c-publish.yml
@@ -34,7 +34,7 @@ jobs:
- name: Publish all specs to their https://www.w3.org/TR/ URLs
run: cd document && make -e WD-echidna-CI
env:
- W3C_STATUS: ${{ github.event_name == 'push' && 'WD' || inputs.w3c-status }}
+ 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 }}
From 8f4ae91316caa9f6c5b8fb83b8dae6c85cb63866 Mon Sep 17 00:00:00 2001
From: Andreas Rossberg
Date: Fri, 13 Sep 2024 15:15:55 +0200
Subject: [PATCH 14/43] [spec] Bump copyright date
---
document/core/conf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/document/core/conf.py b/document/core/conf.py
index 3952701bdf..07185d562d 100644
--- a/document/core/conf.py
+++ b/document/core/conf.py
@@ -60,7 +60,7 @@
name = 'WebAssembly'
project = u'WebAssembly'
title = u'WebAssembly Specification'
-copyright = u'2022, WebAssembly Community Group'
+copyright = u'2024, WebAssembly Community Group'
author = u'WebAssembly Community Group'
editor = u'Andreas Rossberg (editor)'
logo = 'static/webassembly.png'
From 836b00ef3f7dc6526e7ac432084d3885504c1cf5 Mon Sep 17 00:00:00 2001
From: Andreas Rossberg
Date: Fri, 13 Sep 2024 16:01:16 +0200
Subject: [PATCH 15/43] Make builds of old spec versions available
---
document/Makefile | 4 ++--
document/index.html | 9 +++++++++
document/versions/Makefile | 14 ++++++++++++++
document/versions/core/WebAssembly-1.0.pdf | Bin 0 -> 1161150 bytes
document/versions/core/WebAssembly-2.0.pdf | Bin 0 -> 1504529 bytes
.../versions/core/WebAssembly-3.0-draft.pdf | Bin 0 -> 2196704 bytes
6 files changed, 25 insertions(+), 2 deletions(-)
create mode 100644 document/versions/Makefile
create mode 100644 document/versions/core/WebAssembly-1.0.pdf
create mode 100644 document/versions/core/WebAssembly-2.0.pdf
create mode 100644 document/versions/core/WebAssembly-3.0-draft.pdf
diff --git a/document/Makefile b/document/Makefile
index 50cb081d77..ed1b7583b5 100644
--- a/document/Makefile
+++ b/document/Makefile
@@ -1,4 +1,4 @@
-DIRS = js-api web-api core
+DIRS = js-api web-api core versions
FILES = index.html
BUILDDIR = _build
TAR = tar
@@ -60,7 +60,7 @@ $(DIRS:%=build-%): build-%:
(cd $(@:build-%=%); make BUILDDIR=$(BUILDDIR) all)
.PHONY: $(DIRS:%=dir-%)
-$(DIRS:%=dir-%): dir-%:
+$(DIRS:%=dir-%): dir-%: $(BUILDDIR)
mkdir -p $(BUILDDIR)/$(@:dir-%=%)
rm -rf $(BUILDDIR)/$(@:dir-%=%)/*
cp -R $(@:dir-%=%)/$(BUILDDIR)/html/* $(BUILDDIR)/$(@:dir-%=%)/
diff --git a/document/index.html b/document/index.html
index 37eed9762e..6a6508347f 100644
--- a/document/index.html
+++ b/document/index.html
@@ -67,6 +67,15 @@ Embedder specifications
here.
+
+All versions
+
+
+