Skip to content

Commit 4ff66b3

Browse files
committed
Merge WebAssembly/spec/main
To bring in the wasm-latest directory in which we will update the spectec for custom descriptors.
2 parents f76e5ce + a20e214 commit 4ff66b3

File tree

109 files changed

+25800
-16439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+25800
-16439
lines changed

.github/workflows/ci-spec.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,25 @@ name: CI for specs
33
on:
44
push:
55
branches: [ main, wasm-3.0 ]
6-
paths: [ .github/**, document/**, spectec/** ]
6+
paths: [ .github/**, document/**, spectec/**, specification/** ]
77

88
pull_request:
99
branches: [ main, wasm-3.0 ]
10-
paths: [ .github/**, document/**, spectec/** ]
10+
paths: [ .github/**, document/**, spectec/**, specification/** ]
1111

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

1515
jobs:
16+
ensure-wasm-latest:
17+
if: ${{ github.repository == 'WebAssembly/spec' }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
- name: Diff wasm-latest
23+
run: bash .github/workflows/diff-wasm-latest.sh
24+
1625
build-core-spec:
1726
runs-on: ubuntu-latest
1827
steps:
@@ -145,6 +154,7 @@ jobs:
145154
publish-spec:
146155
runs-on: ubuntu-latest
147156
needs:
157+
- ensure-wasm-latest
148158
- build-core-spec
149159
- build-js-api-spec
150160
- build-web-api-spec
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Identify the highest versioned directory
4+
HIGHEST_VER=$(ls -d specification/wasm-[0-9]* 2>/dev/null | sort -V | tail -n 1)
5+
6+
if [ -z "$HIGHEST_VER" ]; then
7+
echo "❌ Error: No wasm-X.Y versioned directories found in specification/"
8+
exit 1
9+
fi
10+
11+
LATEST="specification/wasm-latest"
12+
13+
# Check that wasm-latest exists
14+
if [ ! -d "$LATEST" ]; then
15+
echo "❌ Error: $LATEST does not exist."
16+
exit 1
17+
fi
18+
19+
# Diff the highest version with wasm-latest and check that the diff is empty
20+
echo "Checking for differences between $HIGHEST_VER and $LATEST..."
21+
22+
if diff -qr "$HIGHEST_VER" "$LATEST" > /dev/null; then
23+
echo "✅ Success: Contents match. No changes needed."
24+
else
25+
echo "🔍 Differences detected:"
26+
echo "--------------------------------"
27+
diff -r "$HIGHEST_VER" "$LATEST"
28+
echo "--------------------------------"
29+
exit 1
30+
fi

.github/workflows/w3c-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
push:
55
# Disable on forks!
66
branches: [ main ]
7-
paths: [ .github/**, document/** ]
7+
paths: [ .github/**, document/**, specification/** ]
88
pull_request:
9-
paths: [ .github/**, document/** ]
9+
paths: [ .github/**, document/**, specification/** ]
1010

1111
# Allows you to run this workflow manually from the Actions tab, gh CLI tool,
1212
# or REST API. THe w3c-status options correspond to the valid options for

document/core/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SPHINXBUILD = sphinx-build
88
PAPER = a4
99
ROOTDIR = $(shell dirname `ls -d ../core 2>/dev/null || ls -d ../../core`)/..
1010
SPECTECDIR = $(ROOTDIR)/spectec
11-
SPECTECSPEC = $(ROOTDIR)/specification/wasm-3.0
11+
SPECTECSPEC = $(ROOTDIR)/specification/wasm-latest
1212
SPECTECEXT = spectec
1313
SPECTEC = $(SPECTECDIR)/spectec
1414
SPLICEDIR = _spectec

document/core/appendix/index-instructions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def Instruction(version, name, opcode, type=None, validation=None, execution=Non
359359
Instruction(3.0, r'\REFI31', r'\hex{FB}~\hex{1C}', r'[\I32] \to [(\REF~\I31)]', r'valid-ref.i31', r'exec-ref.i31'),
360360
Instruction(3.0, r'\I31GETS', r'\hex{FB}~\hex{1D}', r'[\I31REF] \to [\I32]', r'valid-i31.get', r'exec-i31.get'),
361361
Instruction(3.0, r'\I31GETU', r'\hex{FB}~\hex{1E}', r'[\I31REF] \to [\I32]', r'valid-i31.get', r'exec-i31.get'),
362-
Instruction(0.0, None, r'\hex{FB}~\hex{1E} \dots'),
362+
Instruction(0.0, None, r'\hex{FB}~\hex{1F} \dots'),
363363
Instruction(2.0, r'\I32.\TRUNC\K{\_sat\_}\F32\K{\_s}', r'\hex{FC}~\hex{00}', r'[\F32] \to [\I32]', r'valid-cvtop', r'exec-cvtop', r'op-trunc_sat'),
364364
Instruction(2.0, r'\I32.\TRUNC\K{\_sat\_}\F32\K{\_u}', r'\hex{FC}~\hex{01}', r'[\F32] \to [\I32]', r'valid-cvtop', r'exec-cvtop', r'op-trunc_sat'),
365365
Instruction(2.0, r'\I32.\TRUNC\K{\_sat\_}\F64\K{\_s}', r'\hex{FC}~\hex{02}', r'[\F64] \to [\I32]', r'valid-cvtop', r'exec-cvtop', r'op-trunc_sat'),

document/core/appendix/properties.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ Results
270270
\qquad
271271
\vdashresulttype [t^\ast] : \OKresulttype
272272
}{
273-
S \vdashresult (\REFEXNADDR~a)~\THROWREF : [{t'}^\ast]
273+
S \vdashresult (\REFEXNADDR~a)~\THROWREF : [t^\ast]
274274
}
275275
276276

document/core/exec/runtime.rst

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ Traps are bubbled up through nested instruction sequences, ultimately reducing t
621621
.. _syntax-config:
622622

623623
Configurations
624-
..............
624+
~~~~~~~~~~~~~~
625625

626626
A *configuration* describes the current computation.
627627
It consists of the computations's *state* and the sequence of :ref:`instructions <syntax-instr>` left to execute.
@@ -646,3 +646,28 @@ $${syntax: config state}
646646
.. note::
647647
The current version of WebAssembly is single-threaded,
648648
but configurations with multiple threads may be supported in the future.
649+
650+
651+
Conventions
652+
...........
653+
654+
* The meta variable ${state: z} ranges over frame states where clear from context.
655+
656+
* The following shorthands are defined for accessing a state ${:z = (s; f)}:
657+
658+
- ${definition: type}
659+
- ${definition: tag}
660+
- ${definition: global}
661+
- ${definition: mem}
662+
- ${definition: table}
663+
- ${definition: func}
664+
- ${definition: data}
665+
- ${definition: elem}
666+
- ${definition: local}
667+
668+
* These shorthands also extend to :ref:`notation <notation-replace>` for updating state:
669+
670+
- ${definition: with_global}
671+
- ${definition: with_mem}
672+
- ${definition: with_table}
673+
- ${definition: with_local}

document/core/syntax/conventions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ Moreover, the following conventions are employed:
9696
but implicitly also defines ${:i^n} to be the sequence of values ${:0} to ${:($(n-1))}.
9797

9898
.. note::
99-
For example, if ${:x^n} is the sequence ${:a b c}, then ${:($($f(x) + 1))^n} denotes the sequence ${:($($f(a) + 1)) ($($f(b) + 1)) ($($f(c) + 1))}.
99+
For example, if ${:x^n} is the sequence ${:a b c}, then ${-:($($f(x) + 1))^n} denotes the sequence ${-:($($f(a) + 1)) ($($f(b) + 1)) ($($f(c) + 1))}.
100100

101101
The form ${:e^(i<n)} additionally gives access to an index variable inside the iteration.
102-
For example, ${:($($f(x) + i))^(i<n)} denotes the sequence ${:($($f(a) + 0)) ($($f(b) + 1)) ($($f(c) + 2))}.
102+
For example, ${-:($($f(x) + i))^(i<n)} denotes the sequence ${-:($($f(a) + 0)) ($($f(b) + 1)) ($($f(c) + 2))}.
103103

104104
Productions of the following form are interpreted as *records* that map a fixed set of fields ${:FIELD_ i} to "values" ${:A_i}, respectively:
105105

document/core/syntax/instructions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ The former merely returns the result of the test,
254254
while the latter performs a downcast and :ref:`traps <trap>` if the operand's type does not match.
255255

256256
.. note::
257-
The ${:BR_ON_NULL} and ${:BR_ON_NON_NULL} instructions provide versions of ${:REF.AS_NULL} that branch depending on the success of failure of a null test instead of trapping.
257+
The ${:BR_ON_NULL} and ${:BR_ON_NON_NULL} instructions provide versions of ${:REF.AS_NON_NULL} that branch depending on the success or failure of a null test instead of trapping.
258258
Similarly, the ${:BR_ON_CAST} and ${:BR_ON_CAST_FAIL} instructions provides versions of ${:REF.CAST} that branch depending on the success of the downcast instead of trapping.
259259

260260
An additional instruction operating on function references is the :ref:`control instruction <syntax-instr-control>` ${:CALL_REF}.

document/core/syntax/modules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Indices
6868
Definitions are referenced with zero-based *indices*.
6969
Each class of definition has its own *index space*, as distinguished by the following classes.
7070

71-
$${syntax: {typeidx funcidx globalidx tableidx memidx tagidx elemidx dataidx labelidx localidx fieldidx}}
71+
$${syntax: {idx typeidx funcidx globalidx tableidx memidx tagidx elemidx dataidx labelidx localidx fieldidx}}
7272

7373
The index space for
7474
:ref:`tags <syntax-tag>`,

0 commit comments

Comments
 (0)