jrandolf opened PR #14895 from jrandolf:fuzz-implements to bytecodealliance:main:
This adds a
component_implementsfuzzer, run by themiscfuzz target, for theimplementsandexternal-idname annotations. It supersedes #14802, which only toggledimplementson and off in thecomponent_apifuzzer.It generates components of many shapes:
- WIT packages come from
wit-smith, and the world either comes fromwit-smithor is generated over its interfaces. Interfaces are imported and exported both by their own names and under labels, often several labels for one interface.- Every world item, function and type gets a random
external-idor none.- A core module is generated where most exports forward to a random import of the same type.
wit-componentturns it into a component, optionally with canonical names.- Optionally, the component is nested in an outer one that instantiates it, possibly swapping labels of the same interface, and re-exports everything.
It then checks that:
component_type()has exactly the expected imports and exports, with the rightimplementsandexternal-id, before and afterserialize/deserialize.is_implementsmatches the interface and its semver-compatible versions, and nothing else.- A
Linkermissing an import fails to instantiate, even if the implemented interface is defined under its own name.- Each call to a forwarding export reaches exactly the import it's wired to, including when another import is stubbed with
define_unknown_imports_as_{traps,default_values}.It ran for 40 minutes, and for 30 minutes under AddressSanitizer, without failures. One case is skipped with a FIXME: with canonical names,
is_implementsdoesn't match the full version of an interface whose version has build metadata but no semver-compatible track (0.0.xor a prerelease), because theversion-suffixof names isn't kept.Run it with
FUZZER=component_implements cargo +nightly fuzz run misc.
:cross_mark: jrandolf closed without merge PR #14895.
Last updated: Oct 31 2026 at 23:03 UTC