Skip to content

Commit aedb2bb

Browse files
committed
Add a new fuzzer focused on component-model-async events
This commit adds a new fuzzer mode to the `misc` fuzzer of Wasmtime which is focused on async events and interleavings of components using the component-model-async proposal. This fuzzer works by having a precompiled guest program which serves as the component to run. This precompiled component has a custom `fuzz.wit` which is used to interface with the fuzzer itself. The fuzzer is then a fuzz-generated sequence of commands to send to the component which verifies that everything executes correctly, has no panics, etc. This fuzzer intends to stress async communication and task infrastructure with component-model-async. Notably this does not stress lifting/lowering or arbitrary type signatures. This does, however, permute all of the following: * Guest/host interactions (also guest/guest, host/host, etc). * Async functions, both ready and pending. * Future operations: reads, writes, cancellation, transfers, etc. * Stream operations: reads, writes, cancellation, transfers, etc. This is all throwing into a large "soup" and then asserted to work correctly. There's a few gotchas here and there for how this fuzzer is designed, such as some events requiring "yield N times to await this event happening". This is required because Wasmtime is allowed to non-deterministically select between a number of "ready events" and what to dispatch. This is not intended to be a one-size-fits-all fuzzer for component-model-async. The recent enhancements to the `component_api` fuzzer are intended to complement this fuzzer in terms of what's stressed where internally.
1 parent 058a9bc commit aedb2bb

File tree

92 files changed

+3657
-32
lines changed

Some content is hidden

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

92 files changed

+3657
-32
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ tokio-util = "0.7.16"
426426
arbtest = "0.3.2"
427427
rayon = "1.5.3"
428428
regex = "1.9.1"
429+
pin-project-lite = "0.2.14"
429430

430431
# =============================================================================
431432
#

crates/component-macro/tests/expanded/char.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ pub mod exports {
253253
pub mod chars {
254254
#[allow(unused_imports)]
255255
use wasmtime::component::__internal::{anyhow, Box};
256+
#[derive(Clone)]
256257
pub struct Guest {
257258
take_char: wasmtime::component::Func,
258259
return_char: wasmtime::component::Func,

crates/component-macro/tests/expanded/char_async.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ pub mod exports {
267267
pub mod chars {
268268
#[allow(unused_imports)]
269269
use wasmtime::component::__internal::{anyhow, Box};
270+
#[derive(Clone)]
270271
pub struct Guest {
271272
take_char: wasmtime::component::Func,
272273
return_char: wasmtime::component::Func,

crates/component-macro/tests/expanded/char_concurrent.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ pub mod exports {
246246
pub mod chars {
247247
#[allow(unused_imports)]
248248
use wasmtime::component::__internal::{anyhow, Box};
249+
#[derive(Clone)]
249250
pub struct Guest {
250251
take_char: wasmtime::component::Func,
251252
return_char: wasmtime::component::Func,

crates/component-macro/tests/expanded/char_tracing_async.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ pub mod exports {
296296
pub mod chars {
297297
#[allow(unused_imports)]
298298
use wasmtime::component::__internal::{anyhow, Box};
299+
#[derive(Clone)]
299300
pub struct Guest {
300301
take_char: wasmtime::component::Func,
301302
return_char: wasmtime::component::Func,

crates/component-macro/tests/expanded/conventions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ pub mod exports {
453453
>::ALIGN32
454454
);
455455
};
456+
#[derive(Clone)]
456457
pub struct Guest {
457458
kebab_case: wasmtime::component::Func,
458459
foo: wasmtime::component::Func,

crates/component-macro/tests/expanded/conventions_async.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ pub mod exports {
511511
>::ALIGN32
512512
);
513513
};
514+
#[derive(Clone)]
514515
pub struct Guest {
515516
kebab_case: wasmtime::component::Func,
516517
foo: wasmtime::component::Func,

crates/component-macro/tests/expanded/conventions_concurrent.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ pub mod exports {
459459
>::ALIGN32
460460
);
461461
};
462+
#[derive(Clone)]
462463
pub struct Guest {
463464
kebab_case: wasmtime::component::Func,
464465
foo: wasmtime::component::Func,

crates/component-macro/tests/expanded/conventions_tracing_async.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ pub mod exports {
671671
>::ALIGN32
672672
);
673673
};
674+
#[derive(Clone)]
674675
pub struct Guest {
675676
kebab_case: wasmtime::component::Func,
676677
foo: wasmtime::component::Func,

0 commit comments

Comments
 (0)