Skip to content

Commit bf7c787

Browse files
committed
Admit wasm simd128 runtime dispatch
1 parent f19b9af commit bf7c787

25 files changed

Lines changed: 724 additions & 234 deletions

CHANGELOG.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22

33
## 1.3.3 - 2026-07-03
44

5-
- Recorded the wasm `simd128` runtime-dispatch decision: wasm vector code
6-
remains compile/codegen evidence only and is not admitted as an active
7-
runtime backend.
5+
- Admitted narrow wasm `simd128` runtime dispatch for Standard and URL-safe
6+
public encode plus normal strict decode when `wasm32` binaries are compiled
7+
with `target-feature=+simd128`, `simd`, and the explicit
8+
`allow-wasm32-best-effort-wipe` feature.
9+
- Added Node/V8 and Wasmtime runtime smoke evidence requiring
10+
`wasm-simd128` candidate, active encode, and active decode backend reporting
11+
plus Standard and URL-safe public API round trips.
812
- Added `scripts/generate_wasm_simd_evidence.sh` and wired it into the local
913
release checks so installed wasm targets emit release test-harness LLVM IR
1014
with `target-feature=+simd128` and checked vector-codegen markers.
11-
- Added `WASM_SIMD128_RUNTIME_REVIEW.md` and release-gated posture validation
12-
documenting that wasm candidate reporting is distinct from active dispatch,
13-
and that runtime/JIT timing, cleanup, fallback, and benchmark evidence remain
14-
required before admission.
15+
- Updated `WASM_SIMD128_RUNTIME_REVIEW.md` and release-gated posture
16+
validation to document the narrow admitted runtime profile, remaining
17+
browser/runtime timing caveats, wasm cleanup caveats, and future broadening
18+
requirements.
1519
- Added `Engine::profile_with_wrap` and `Engine::checked_profile_with_wrap`
1620
convenience helpers for turning an engine into a strict wrapped profile.
1721
- Synchronized all workspace crate package versions to `1.3.3`.

README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,27 @@ The crate starts conservative: a small scalar implementation, strict RFC 4648 be
3131

3232
The current public release is `1.3.3`.
3333

34-
`1.3.3` is a focused wasm SIMD posture and profile-ergonomics patch on top of
35-
the `1.3.0` implementation-completion release, the `1.3.1` Tokio writer patch,
36-
and the `1.3.2` non-standard SIMD surface review. It keeps the conservative
37-
`1.2.x` encode acceleration posture and the admitted `1.3.0` normal strict
38-
SIMD decode scope for Standard and URL-safe alphabet families on std
39-
`x86`/`x86_64` AVX-512 VBMI, AVX2, SSSE3/SSE4.1, and little-endian std
34+
`1.3.3` is a focused wasm SIMD runtime-dispatch and profile-ergonomics patch
35+
on top of the `1.3.0` implementation-completion release, the `1.3.1` Tokio
36+
writer patch, and the `1.3.2` non-standard SIMD surface review. It keeps the
37+
admitted `1.2.x` native encode acceleration posture and the admitted `1.3.0`
38+
normal strict SIMD decode scope for Standard and URL-safe alphabet families on
39+
std `x86`/`x86_64` AVX-512 VBMI, AVX2, SSSE3/SSE4.1, and little-endian std
4040
`aarch64` NEON after whole-input scalar validation.
4141

4242
Encode acceleration remains active only for admitted Standard and URL-safe
4343
fixed-block surfaces. Decode acceleration remains limited to normal strict
4444
decode. Wrapped decode, legacy whitespace decode, custom alphabets,
45-
bcrypt-style and `crypt(3)` profiles, in-place decode, `no_std`, wasm runtime
46-
dispatch, and constant-time-oriented secret decode remain scalar.
45+
bcrypt-style and `crypt(3)` profiles, in-place decode, `no_std`, and
46+
constant-time-oriented secret decode remain scalar. Wasm `simd128` is admitted
47+
only for Standard and URL-safe public encode and normal strict decode when the
48+
binary is compiled with `target-feature=+simd128`, the `simd` feature, and the
49+
explicit `allow-wasm32-best-effort-wipe` feature.
4750

48-
The latest patch in this line is `1.3.3`, which records that wasm `simd128`
49-
runtime dispatch remains unadmitted, adds release-gated wasm codegen evidence
50-
for the inactive prototype, and adds wrapped-profile helper ergonomics. The
51-
workspace crate family stays version-aligned at `1.3.3`.
51+
The latest patch in this line is `1.3.3`, which admits narrow wasm `simd128`
52+
runtime dispatch with Node/V8 and Wasmtime smoke evidence, keeps the wasm
53+
cleanup caveat fail-closed by default, and adds wrapped-profile helper
54+
ergonomics. The workspace crate family stays version-aligned at `1.3.3`.
5255

5356
Implemented on this branch now:
5457

@@ -101,6 +104,12 @@ Implemented on this branch now:
101104
whole-input scalar validation. Unsupported CPUs, big-endian AArch64,
102105
`no_std`, custom alphabets, short inputs, tails, wrapped decode, legacy
103106
decode, in-place decode, and CT secret decode stay scalar.
107+
- Runtime-dispatched wasm `simd128` fixed-block encode and normal strict
108+
decode for Standard and URL-safe alphabets when built for `wasm32` with
109+
`target-feature=+simd128`, `simd`, and
110+
`allow-wasm32-best-effort-wipe`. The admission is backed by Node/V8 and
111+
Wasmtime runtime smoke evidence; unsupported wasm builds stay scalar by
112+
compiling without `+simd128`.
104113
- Optional `base64-ng-sanitization` companion crate for applications that
105114
already admit `sanitization` and want direct CT decode helpers into
106115
clear-on-drop secret containers.
@@ -120,9 +129,9 @@ Planned behind admission evidence:
120129
alphabets, no bcrypt/crypt profiles, and no constant-time-oriented secret
121130
decode. Default builds, unsupported runtime CPUs, `no_std`, and all
122131
out-of-scope decode surfaces remain scalar.
123-
- Additional admitted wasm `simd128`, custom alphabet, and in-place encode
124-
fast paths only after separate SIMD admission evidence is complete. Default
125-
builds and unsupported runtime CPUs remain scalar.
132+
- Additional custom alphabet, wrapped/legacy, in-place, and broader wasm
133+
runtime/browser fast paths only after separate SIMD admission evidence is
134+
complete. Default builds and unsupported runtime CPUs remain scalar.
126135
- Async reader and writer streaming is available through the optional
127136
`base64-ng-tokio` companion crate after cancellation-safety, accepted-byte,
128137
and backpressure review. The core `tokio` feature remains inert; use the
@@ -140,7 +149,7 @@ Planned behind admission evidence:
140149
| MSRV | Rust `1.90.0` |
141150
| Runtime dependencies | Zero external crates |
142151
| Unsafe policy | Scalar encode/decode remains safe Rust; audited unsafe is limited to volatile wiping, CT comparison/barrier helpers, and the reviewed SIMD boundary |
143-
| Active backend | Scalar by default; std x86/x86_64 AVX-512 VBMI preferred, then AVX2, then SSSE3/SSE4.1, plus little-endian std aarch64 NEON, when `simd` is enabled and platform checks pass |
152+
| Active backend | Scalar by default; std x86/x86_64 AVX-512 VBMI preferred, then AVX2, then SSSE3/SSE4.1, plus little-endian std aarch64 NEON, and wasm `simd128` when the admitted feature/runtime profile is present |
144153
| Strict decoding | Default, canonical, no whitespace |
145154
| Legacy compatibility | Explicit opt-in APIs |
146155
| Constant-time posture | Constant-time-oriented scalar validation/decode with isolated dudect-style timing evidence; no formal cryptographic guarantee |

docs/CRATE_VERSION_MATRIX.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ sets.
88
## 1.3.3 Release Plan
99

1010
The `1.3.3` release keeps the workspace crate family synchronized. The main
11-
crate carries the wasm `simd128` runtime-posture decision, release-gated wasm
12-
codegen evidence, and wrapped-profile helper ergonomics. Companion crates
11+
crate carries the narrow wasm `simd128` runtime-dispatch admission, Node/V8 and
12+
Wasmtime smoke evidence, release-gated wasm codegen evidence, and
13+
wrapped-profile helper ergonomics. Companion crates
1314
receive synchronized package metadata so downstream users see one coherent
1415
crate-family version.
1516

docs/PLAN.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,27 +1043,29 @@ inside the `1.3.x` line if they remain evidence-gated and do not weaken the
10431043
- Pentest each admitted surface separately because this is several admission
10441044
surfaces, not one feature.
10451045

1046-
`1.3.3`: wasm `simd128` runtime-dispatch decision.
1047-
1048-
- Decide whether a specific wasm runtime/deployment profile can be admitted.
1049-
- First checkpoint: keep wasm `simd128` runtime dispatch unadmitted and record
1050-
the decision in
1051-
[WASM_SIMD128_RUNTIME_REVIEW.md](WASM_SIMD128_RUNTIME_REVIEW.md), because
1052-
current evidence is compile/codegen-only and does not prove runtime/JIT
1053-
timing, register-retention, cleanup, fallback, or benchmark posture.
1054-
- Second checkpoint: add `scripts/generate_wasm_simd_evidence.sh` to emit
1055-
release test-harness LLVM IR with `target-feature=+simd128` and check vector
1056-
codegen markers while still treating wasm as non-dispatchable runtime
1057-
evidence.
1058-
- If admitted, implement an explicit wasm dispatch boundary and evidence for
1059-
encode first, then decode only if the same evidence standard is met.
1046+
`1.3.3`: wasm `simd128` runtime-dispatch admission.
1047+
1048+
- Admit a narrow wasm `simd128` runtime profile for Standard and URL-safe
1049+
public encode plus normal strict decode when the binary is compiled with
1050+
`target-feature=+simd128`, `simd`, and the explicit
1051+
`allow-wasm32-best-effort-wipe` feature.
1052+
- Record the decision in
1053+
[WASM_SIMD128_RUNTIME_REVIEW.md](WASM_SIMD128_RUNTIME_REVIEW.md), including
1054+
the limits: this does not prove every browser/JIT, runtime timing,
1055+
register-retention, cleanup, fallback, or benchmark posture.
1056+
- Add `scripts/generate_wasm_simd_evidence.sh` to emit release test-harness
1057+
LLVM IR with `target-feature=+simd128` and check vector codegen markers.
1058+
- Add `scripts/check_wasm_runtime_dispatch.sh` to build a wasm smoke module and
1059+
execute it under Node/V8 and Wasmtime, requiring `wasm-simd128` candidate,
1060+
active encode, and active decode backend reporting plus Standard and
1061+
URL-safe public API round trips.
10601062
- Keep wasm wipe behavior fail-closed unless callers explicitly enable
10611063
`allow-wasm32-best-effort-wipe`.
10621064
- Document JIT, runtime, timing, and zeroization caveats without implying
10631065
hardware-like guarantees.
1064-
- Add CI target evidence and generated-code review for the admitted wasm
1065-
profile. If the runtime evidence is incomplete, keep wasm `simd128` as
1066-
compile/codegen evidence only.
1066+
- Keep broader wasm/browser profiles, custom alphabets, wrapped/legacy
1067+
surfaces, in-place decode, and CT secret decode scalar until separate
1068+
evidence admits them.
10671069

10681070
`1.3.4`: big-endian and niche-architecture acceleration review.
10691071

docs/RELEASE_EVIDENCE.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,19 @@ The release gate runs:
6060
- fail-closed wasm wipe policy check proving default `wasm32` builds reject
6161
compiler-fence-only cleanup and the explicit
6262
`allow-wasm32-best-effort-wipe` opt-in build succeeds
63-
- wasm SIMD posture validation proving wasm `simd128` remains
64-
compile/codegen evidence only and is not represented as an active backend
63+
- wasm SIMD posture validation proving the narrow wasm `simd128` runtime
64+
dispatch profile, its feature gates, its runtime smoke evidence, and its
65+
remaining JIT/zeroization caveats
6566
- wasm SIMD codegen evidence through
6667
`scripts/generate_wasm_simd_evidence.sh`, which emits release test-harness
6768
LLVM IR with `target-feature=+simd128` when the wasm target is installed and
6869
checks for vector shuffle, 128-bit byte-vector, and wasm bitselect markers
69-
without claiming runtime/JIT admission
70+
while leaving runtime/JIT behavior to the separate runtime smoke gate
71+
- wasm simd128 runtime smoke evidence through
72+
`scripts/check_wasm_runtime_dispatch.sh`, which builds a wasm32 smoke module
73+
with `target-feature=+simd128` and executes it under Node/V8 and Wasmtime
74+
when installed, requiring `wasm-simd128` active encode/decode reporting and
75+
Standard plus URL-safe round trips
7076
- fail-closed unsupported-native wipe policy documented through
7177
`allow-compiler-fence-only-wipe` for architectures without an implemented
7278
hardware wipe barrier
@@ -280,8 +286,8 @@ This currently proves `no_std` reserved builds for AVX2, SSSE3/SSE4.1, the
280286
AVX-512 Base64 candidate bundle (`avx512f`, `avx512bw`, `avx512vl`, and
281287
`avx512vbmi`), NEON, and wasm `simd128` when the corresponding Rust targets
282288
are installed. For wasm `simd128`, the script also builds the wasm test
283-
binaries with `target-feature=+simd128` so the inactive fixed-block prototype
284-
body remains typechecked and codegen-ready without requiring a wasm runtime.
289+
binaries with `target-feature=+simd128` so the admitted fixed-block wasm code
290+
remains typechecked and codegen-ready.
285291

286292
Capture local runtime backend and prototype evidence with:
287293

@@ -294,17 +300,18 @@ scalar-equivalence tests with `--nocapture`. The runtime report records
294300
`candidate_detection_mode`, which distinguishes x86/x86_64 `std` runtime CPU
295301
probing from compile-time target-feature reporting used by `no_std` and other
296302
compile-time-only targets. On CPUs with AVX-512 VBMI, AVX2, SSSE3/SSE4.1, or
297-
little-endian AArch64 NEON, an admitted encode path may be active for Standard
298-
and URL-safe alphabets. Big-endian AArch64 stays scalar, and 32-bit ARM NEON
299-
remains scaffold evidence. Wasm `simd128` evidence is kept in
300-
`scripts/check_simd_feature_bundles.sh` as compile/test-binary evidence only
301-
because runtime JIT behavior is outside the crate's release gate. The
302-
script writes
303+
little-endian AArch64 NEON, or wasm `simd128`, an admitted encode path may be
304+
active for Standard and URL-safe alphabets. Big-endian AArch64 stays scalar,
305+
and 32-bit ARM NEON remains scaffold evidence. Wasm `simd128` evidence is kept
306+
in `scripts/check_simd_feature_bundles.sh` as compile/test-binary evidence and
307+
in `scripts/check_wasm_runtime_dispatch.sh` as Node/V8 and Wasmtime runtime
308+
smoke evidence. Runtime/JIT timing behavior remains outside the crate's formal
309+
claim. The script writes
303310
`target/release-evidence/backend/MANIFEST.txt`, `runtime-backend-report.txt`,
304311
and `simd-prototype-equivalence.txt` so local CPU evidence can be archived. The
305312
manifest labels prototype-only evidence as `real-non-dispatchable` and
306313
separately records
307-
`active_backend_admitted=avx512-vbmi-or-avx2-or-ssse3-sse4.1-or-neon-encode`,
314+
`active_backend_admitted=avx512-vbmi-or-avx2-or-ssse3-sse4.1-or-neon-or-wasm-simd128-encode`,
308315
so audit logs do not confuse remaining fixed-block prototype execution with
309316
active dispatch admission.
310317

0 commit comments

Comments
 (0)