Stream: git-wasmtime

Topic: wasmtime / PR #9484 Add the "null" garbage collector


view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 17:23):

fitzgen requested alexcrichton for a review on PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 17:23):

fitzgen requested wasmtime-core-reviewers for a review on PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 17:23):

fitzgen requested wasmtime-default-reviewers for a review on PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 17:23):

fitzgen opened PR #9484 from fitzgen:null-gc to bytecodealliance:main:

The null collector does not actually collect any garbage, it simply bump-allocates until the heap is exhausted, at which point further allocation attempts will fail. It does not require any GC barriers.

Users can configure which collector to use via the wasmtime::Config::collector method or the -C collector=drc|null CLI flag. The wasmtime::Collector enumeration, similar to the wasmtime::Strategy enumeration but for choosing a collector rather than a compiler, additionally has a table summarizing the properties and characteristics of our current set of collector implementations.

Finally, we also run .wast tests that exercise GC types under both the DRC and null collectors. I tried to avoid running tests that are not related to GC under both configurations just to avoid a combinatorial blow up.


(This PR builds on top of https://github.com/bytecodealliance/wasmtime/pull/9483, which is the first commit.)

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 17:27):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 18:40):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 18:46):

fitzgen edited PR #9484:

The null collector does not actually collect any garbage, it simply bump-allocates until the heap is exhausted, at which point further allocation attempts will fail. It does not require any GC barriers.

Users can configure which collector to use via the wasmtime::Config::collector method or the -C collector=drc|null CLI flag. The wasmtime::Collector enumeration, similar to the wasmtime::Strategy enumeration but for choosing a collector rather than a compiler, additionally has a table summarizing the properties and characteristics of our current set of collector implementations.

Finally, we also run .wast tests that exercise GC types under both the DRC and null collectors. I tried to avoid running tests that are not related to GC under both configurations just to avoid a combinatorial blow up.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 18:49):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 18:58):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 19:52):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 21:44):

github-actions[bot] commented on PR #9484:

Subscribe to Label Action

cc @fitzgen

<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:config", "wasmtime:ref-types"

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

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

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 17 2024 at 22:45):

github-actions[bot] commented on PR #9484:

Label Messager: wasmtime:config

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

[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.

Learn more.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2024 at 16:37):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2024 at 16:37):

fitzgen requested wasmtime-fuzz-reviewers for a review on PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2024 at 16:37):

fitzgen edited a comment on PR #9484:

Label Messager: wasmtime:config

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

[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.

Learn more.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2024 at 16:37):

fitzgen edited a comment on PR #9484:

Label Messager: wasmtime:config

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

[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.

Learn more.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2024 at 16:37):

fitzgen edited a comment on PR #9484:

Label Messager: wasmtime:config

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

[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.

Learn more.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 18 2024 at 17:44):

github-actions[bot] commented on PR #9484:

Subscribe to Label Action

cc @fitzgen

<details>
This issue or pull request has been labeled: "fuzzing"

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

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

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 09:31):

alexcrichton submitted PR review:

Very nice! I like how this shaped up. I hope the #[cfg] wasn't too much to add, but it all looks relatively focused to be so it's hopefully just a one-time cost.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 09:31):

alexcrichton created PR review comment:

To confirm this technically isn't necessary right? (to specify -C collector=drc)

I think it's good to have in the test for future-proofing, but I want to double-check that as-is in isolation this isn't needed if we make no more changes to wasmtime in the future

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 09:31):

alexcrichton created PR review comment:

Instead of self.features() can you use the features that are in scope from above?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 09:31):

alexcrichton created PR review comment:

Could this get pushed into a Result-return of Config::collector or within Config::validate?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 16:50):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 16:50):

fitzgen created PR review comment:

Correct, this is just future-proofing for if/when we change the default collector.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 18:31):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 18:31):

fitzgen has enabled auto merge for PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 18:35):

fitzgen commented on PR #9484:

Very nice! I like how this shaped up.

Thanks!

I hope the #[cfg] wasn't too much to add, but it all looks relatively focused to be so it's hopefully just a one-time cost.

Indeed, it was mostly some shuffling to get rid of the disabled collector impl and then realizing that various things that were DRC-specific modules could actually be made a little more generic and reused with other collectors. I think adding the copying collector will be relatively small in comparison to this PR, which is kind of funny.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 23:47):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 21 2024 at 23:47):

fitzgen has enabled auto merge for PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2024 at 20:23):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2024 at 20:57):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 30 2024 at 20:57):

fitzgen has enabled auto merge for PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2024 at 17:33):

fitzgen updated PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2024 at 17:34):

fitzgen has enabled auto merge for PR #9484.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 31 2024 at 18:02):

fitzgen merged PR #9484.


Last updated: Dec 23 2024 at 12:05 UTC