alexcrichton requested fitzgen for a review on PR #13841.
alexcrichton requested wasmtime-fuzz-reviewers for a review on PR #13841.
alexcrichton opened PR #13841 from alexcrichton:gc-heap-initial-size to bytecodealliance:main:
Splitting this out of #13822 with some fuzzing/testing integration, updated to be a
Tunablefield, and some edits to comments.
alexcrichton requested wasmtime-core-reviewers for a review on PR #13841.
:thumbs_up: fitzgen submitted PR review:
Can we have a test for what happens when the gc heap's initial size is larger than the gc heap reservation?
Also, making the default larger than zero (and derived from the heap reservation) could be good because even if we've already reserved the space we will do collections on the way to growing the GC heap to fill that pre-reserved space, and that can make things much slower than they'd otherwise be.
:speech_balloon: fitzgen created PR review comment:
This should maybe link to
Collector::Copyingor something. Or maybe we should put the canonical "this collector splits the heap in half" note there, and just link to it from here in an "fyi ..." kind of way.
:speech_balloon: fitzgen created PR review comment:
/// The `bytes` size is rounded up to the GC heap's page size. Also note
alexcrichton updated PR #13841.
alexcrichton updated PR #13841.
alexcrichton commented on PR #13841:
Can we have a test for what happens when the gc heap's initial size is larger than the gc heap reservation?
Sure yeah, but I'll note that this behavior works ok, and is expected to work ok. This is how linear memories work at least.
This should maybe link to Collector::Copying or something
I just removed the docs, not worth worrying much about as it's just duplicating info.
Also, making the default larger than zero (and derived from the heap reservation)
I'm a bit hesitant to do this myself based on the impact it'll have on the resource limiter invocations. What are you thinking though? Are you thinking that the initial size sould be reservation/2 or something like that?
github-actions[bot] added the label fuzzing on PR #13841.
github-actions[bot] added the label wasmtime:api on PR #13841.
github-actions[bot] added the label wasmtime:config on PR #13841.
github-actions[bot] commented on PR #13841:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "fuzzing", "wasmtime:api", "wasmtime:config"Thus the following users have been cc'd because of the following labels:
- fitzgen: fuzzing
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
tschneidereit commented on PR #13841:
FWIW I didn't make this a tunable because it doesn't impact compilation, as I think the other tunables do. It seems like it'd be nice to be able to tweak this without invalidating compiled artifacts, which I don't know if that still works if it's a tunable.
alexcrichton commented on PR #13841:
Oh I commented over here but this does affect compilation w.r.t. static offsets and such. Given how subtle
MemoryTypeand its handling is (and historical mistakes have been CVEs-in-waiting) I'd want to keep everything pretty centralized (e.g. the inline update toTunables::gc_heap_memory_type). Having a separate tunable for "don't optimize based on minimum memory size" seems reasonable to have and at that point would mean we wouldn't need to compare the tunable during deserialization
github-actions[bot] commented on PR #13841:
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
Configmethod, you wrote extensive documentation for
it.<details>
Our documentation should be of the following form:
```text
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.
```</details>
[ ] If you added a new
Configmethod, 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][fuzzing-config] (or one
of its nestedstructs).Rarely, this may require authoring a new fuzz target to specifically test this
configuration. See [our docs on fuzzing][fuzzing-docs] for more details.</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.[fuzzing-config]: https://github.com/bytecodealliance/wasmtime/blob/ca0e8d0a1d8cefc0496dba2f77a670571d8fdcab/crates/fuzzing/src/generators.rs#L182-L194
[fuzzing-docs]: https://docs.wasmtime.dev/contributing-fuzzing.html
<details>
To modify this label's message, edit the <code>.github/label-messager/wasmtime-config.md</code> file.
To add new label messages or remove existing label messages, edit the
<code>.github/label-messager.json</code> configuration file.</details>
tschneidereit commented on PR #13841:
Oh, I had seen that comment, but skimmed over the part relevant to this—apologies!
fitzgen commented on PR #13841:
I'm a bit hesitant to do this myself based on the impact it'll have on the resource limiter invocations. What are you thinking though? Are you thinking that the initial size sould be reservation/2 or something like that?
reservation/4maybe? That gives us 2 doubling-growths and opportunities for the resource limiter to push back before reaching the initial heap reservation.But also, this can happen in a follow up, no need to block this PR on an existing thing.
fitzgen added PR #13841 Add a tunable knob for the GC heap initial size to the merge queue.
github-merge-queue[bot] removed PR #13841 Add a tunable knob for the GC heap initial size from the merge queue.
alexcrichton updated PR #13841.
alexcrichton has enabled auto merge for PR #13841.
alexcrichton added PR #13841 Add a tunable knob for the GC heap initial size to the merge queue.
github-merge-queue[bot] removed PR #13841 Add a tunable knob for the GC heap initial size from the merge queue.
alexcrichton added PR #13841 Add a tunable knob for the GC heap initial size to the merge queue.
:check: alexcrichton merged PR #13841.
alexcrichton removed PR #13841 Add a tunable knob for the GC heap initial size from the merge queue.
Last updated: Jul 29 2026 at 05:03 UTC