Skip to content

Add support for the compact imports proposal - #14335

Merged
fitzgen merged 4 commits into
bytecodealliance:mainfrom
chacailline:compact-imports
Sep 23, 2026
Merged

fitzgen merged 4 commits into
bytecodealliance:mainfrom
chacailline:compact-imports

Conversation

@chacailline

Copy link
Copy Markdown
Contributor

Adds support for the compact imports proposal, part of #14108.

Adds:

  • Config::wasm_compact_imports option, default false
  • CLI, TOML, and C/C++ API configuration options
  • WAST test covering both types of compact imports
  • Documentation updates

Waiting on 1 week of fuzzer runs to move the proposal to tier 1 and enable the proposal by default.

Please let me know if anything else needs to be added.

@chacailline
chacailline requested review from a team as code owners September 14, 2026 22:15
@chacailline
chacailline requested review from fitzgen and removed request for a team September 14, 2026 22:15
@github-actions github-actions Bot added fuzzing Issues related to our fuzzing infrastructure wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:c-api Issues pertaining to the C API. wasmtime:config Issues related to the configuration of Wasmtime wasmtime:docs Issues related to Wasmtime's documentation labels Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Subscribe to Label Action

cc @fitzgen

Details This issue or pull request has been labeled: "fuzzing", "wasmtime:api", "wasmtime:c-api", "wasmtime:config", "wasmtime:docs"

Thus the following users have been cc'd because of the following labels:

  • fitzgen: fuzzing

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@github-actions

Copy link
Copy Markdown
Contributor

Label Messager: wasmtime:config

It looks like you are changing Wasmtime's configuration options. Make sure to
complete this check list:

  • If you added a new Config method, you wrote extensive documentation for
    it.

    Details

    Our documentation should be of the following form:

    Short, simple summary sentence.
    
    More details. These details can be multiple paragraphs. There should be
    information about not just the method, but its parameters and results as
    well.
    
    Is this method fallible? If so, when can it return an error?
    
    Can this method panic? If so, when does it panic?
    
    # Example
    
    Optional example here.
    
  • If you added a new Config method, or modified an existing one, you
    ensured that this configuration is exercised by the fuzz targets.

    Details

    For example, if you expose a new strategy for allocating the next instance
    slot inside the pooling allocator, you should ensure that at least one of our
    fuzz targets exercises that new strategy.

    Often, all that is required of you is to ensure that there is a knob for this
    configuration option in wasmtime_fuzzing::Config (or one
    of its nested structs).

    Rarely, this may require authoring a new fuzz target to specifically test this
    configuration. See our docs on fuzzing for more details.

  • If you are enabling a configuration option by default, make sure that it
    has been fuzzed for at least two weeks before turning it on by default.


Details

To modify this label's message, edit the .github/label-messager/wasmtime-config.md file.

To add new label messages or remove existing label messages, edit the
.github/label-messager.json configuration file.

Learn more.

@chacailline

Copy link
Copy Markdown
Contributor Author

New config method has documentation in line with other feature config functions.

In local fuzzing runs, instantiate generated compact import statements. I think other ones that use wasm-smith should as well.

Config is off by default pending fuzzing. Btw docs Wasm Proposals says 1 week of fuzzing, but reminder bot says 2 weeks.

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, modulo two minor things below. Thanks!

Comment thread crates/wasmtime/src/config.rs Outdated
Comment on lines +988 to +992
/// Configures whether the WebAssembly compact imports proposal is enabled.
///
/// This feature is `false` by default.
///
/// [proposal]: https://github.com/WebAssembly/compact-import-section

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The [proposal] link is not actually used in the docs above, but should be.

We should a short paragraph summary of what the proposal actually is/enables here as well, similar to other Wasm proposal knobs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the spec testsuite not cover compact imports? I would have expected that we also enable running the spec tests for compact imports somewhere in crates/test-util/src/wast.rs or something.

@chacailline

chacailline commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

I've updated the config documentation.

As of last week, the spec tests do have compact-imports tests. I updated the submodule revision and configured features for new tests.

Some of the compact import tests currently fail because we reject zero-length compact import encoding groups. bytecodealliance/wasm-tools#2664 should fix that once Wasmtime uses a version of wasm-tools with the change.

I'm not really sure what to do with the other test failures. Looks like type-subtyping and some extended-name-section tests are giving errors, but I'm not familiar with either.

@alexcrichton

Copy link
Copy Markdown
Member

Can you flag all those tests somewhere around in this function as "should fail"? Those are mostly expected failures for now and we'll get them fixed when the proposals are fully implemented.

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thansk!

@fitzgen
fitzgen added this pull request to the merge queue Sep 23, 2026
Merged via the queue into bytecodealliance:main with commit 08c1bc4 Sep 23, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fuzzing Issues related to our fuzzing infrastructure wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:c-api Issues pertaining to the C API. wasmtime:config Issues related to the configuration of Wasmtime wasmtime:docs Issues related to Wasmtime's documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants