Commit 76ddd59
authored
Build WebAssembly tests for the
[WASI](https://wasi.dev/) is now mature enough that we can build
binaries that target WebAssembly, and they will "just work" if run in a
WebAssembly runtime.
This means we can get rid of the
[increasingly-unmaintained](https://blog.rust-lang.org/inside-rust/2025/07/21/sunsetting-the-rustwasm-github-org/)
`wasm-pack` and `wasm-bindgen` machinery, and run tests the same way we
do for any other target, including doctests.
We *could* add a `.cargo/config.toml` to this repository that specifies
the rustflags and runner, but that would affect every package and cargo
command. Not sure if that's desirable.
Note that some of the doctests for `wasm32-wasip1` fail to compile,
probably due to #105:
<details>
<summary>Error messages</summary>
```
---- fearless_simd/src/macros.rs - macros::dispatch (line 34) stdout ----
error[E0599]: no variant or associated item named `Fallback` found for enum `Level` in the current scope
--> fearless_simd/src/macros.rs:43:1
|
12 | dispatch!(level, simd => sigmoid(simd, &[/*...*/], &mut [/*...*/]));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Level`
|
= note: this error originates in the macro `$crate::dispatch` which comes from the expansion of the macro `dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0599`.
Couldn't compile the test.
---- fearless_simd/src/lib.rs - (line 23) stdout ----
error[E0599]: no variant or associated item named `Fallback` found for enum `Level` in the current scope
--> fearless_simd/src/lib.rs:33:1
|
13 | dispatch!(level, simd => sigmoid(simd, &[/*...*/], &mut [/*...*/]));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `Level`
|
= note: this error originates in the macro `$crate::dispatch` which comes from the expansion of the macro `dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)
```
</details>
I've `ignore`d those doctests for now.wasm32-wasip1 target and run them using wasmtime (#122)1 parent 9039b44 commit 76ddd59
File tree
7 files changed
+41
-222
lines changed- .github/workflows
- fearless_simd_dev_macros/src
- fearless_simd_tests
- tests
- fearless_simd/src
7 files changed
+41
-222
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
255 | 274 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | 275 | | |
261 | 276 | | |
262 | 277 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
104 | | - | |
| 103 | + | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
| |||
0 commit comments