Commit 4137f4f
authored
relax intra-component stream/future read/write rules (#12181)
Per WebAssembly/component-model#580, we now allow
intra-component reads and writes for all numeric payloads.
While I was implementing this, Alex and I spotted a couple of bugs, which I've
fixed here:
- We can't treat `bool` and `char` payloads as "flat" (i.e. trivially copy-able) since not all bit patterns are valid for those types.
- We weren't enforcing the rules (old or new) for streams with non-"flat" payloads (i.e. the ones that most needed them enforced 🤦)
Also, now that WebAssembly/component-model#578 has been
merged, I've updated the `tests/component-model` submodule and reduced the list
of "expect fail" tests for that directory.
Finally, note that the `p3_http_middleware_host_to_host` test is still expected
to trap, but now for a different reason. Previously, it trapped because it
tried to do an intra-component read/write on a `stream<u8>`. Now that that's
allowed, it instead traps when doing an intra-component read/write on a
`future<result<option<trailers>, error-code>>`, which is still prohibited.
Signed-off-by: Joel Dice <[email protected]>1 parent 4898322 commit 4137f4f
File tree
7 files changed
+87
-48
lines changed- crates
- cranelift/src/compiler
- test-util/src
- wasi-http/tests/all/p3
- wasmtime/src/runtime/component/concurrent
- tests
- misc_testsuite/component-model/async
7 files changed
+87
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
866 | 867 | | |
867 | 868 | | |
868 | | - | |
869 | | - | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
870 | 872 | | |
871 | 873 | | |
872 | 874 | | |
| |||
875 | 877 | | |
876 | 878 | | |
877 | 879 | | |
878 | | - | |
879 | | - | |
| 880 | + | |
880 | 881 | | |
881 | 882 | | |
882 | 883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
189 | 190 | | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| |||
699 | 701 | | |
700 | 702 | | |
701 | 703 | | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
| 704 | + | |
718 | 705 | | |
719 | | - | |
720 | | - | |
721 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
722 | 710 | | |
723 | 711 | | |
724 | 712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
Lines changed: 45 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3042 | 3042 | | |
3043 | 3043 | | |
3044 | 3044 | | |
3045 | | - | |
| 3045 | + | |
3046 | 3046 | | |
3047 | | - | |
| 3047 | + | |
3048 | 3048 | | |
3049 | 3049 | | |
3050 | 3050 | | |
| |||
3084 | 3084 | | |
3085 | 3085 | | |
3086 | 3086 | | |
3087 | | - | |
3088 | | - | |
3089 | | - | |
3090 | | - | |
3091 | | - | |
3092 | | - | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
3093 | 3094 | | |
| 3095 | + | |
3094 | 3096 | | |
3095 | 3097 | | |
3096 | 3098 | | |
| |||
3122 | 3124 | | |
3123 | 3125 | | |
3124 | 3126 | | |
3125 | | - | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
3126 | 3141 | | |
3127 | 3142 | | |
3128 | 3143 | | |
| |||
4533 | 4548 | | |
4534 | 4549 | | |
4535 | 4550 | | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
4536 | 4572 | | |
4537 | 4573 | | |
4538 | 4574 | | |
| |||
Submodule component-model updated 24 files
- README.md+2-2
- design/mvp/Binary.md+4-2
- design/mvp/CanonicalABI.md+292-219
- design/mvp/Concurrency.md+330-260
- design/mvp/Explainer.md+70-81
- design/mvp/WIT.md+7-12
- design/mvp/canonical-abi/definitions.py+137-118
- design/mvp/canonical-abi/run_tests.py+180-145
- test/README.md+3-3
- test/async/async-calls-sync.wast+10-10
- test/async/cancel-stream.wast+11-11
- test/async/cancel-subtask.wast+5-5
- test/async/deadlock.wast+3-3
- test/async/drop-subtask.wast+6-6
- test/async/drop-waitable-set.wast+5-5
- test/async/empty-wait.wast+5-5
- test/async/partial-stream-copies.wast+3-3
- test/async/passing-resources.wast+8-8
- test/async/same-component-stream-future.wast+149
- test/async/sync-barges-in.wast+311
- test/async/trap-if-block-and-sync.wast+261
- test/async/trap-if-done.wast+25-25
- test/async/wait-during-callback.wast+1-1
- test/async/zero-length.wast+5-5
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | 12 | | |
8 | | - | |
| 13 | + | |
9 | 14 | | |
10 | | - | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
| |||
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | | - | |
| 55 | + | |
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | 12 | | |
8 | | - | |
| 13 | + | |
9 | 14 | | |
10 | | - | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
| |||
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
27 | | - | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
32 | | - | |
| 38 | + | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | | - | |
| 55 | + | |
0 commit comments