adamrk opened PR #14637 from adamrk:abk/bforest-split-oom to bytecodealliance:main:
When we need to split nodes in a bforest to perform an insertion, allocate
the worst case depth + 1 nodes all up front so that the insertion
atomically completes or fails. Otherwise the bforest can drop nodes that
were in the tree.
adamrk requested alexcrichton for a review on PR #14637.
adamrk requested wasmtime-fuzz-reviewers for a review on PR #14637.
adamrk requested wasmtime-compiler-reviewers for a review on PR #14637.
:memo: adamrk submitted PR review.
:speech_balloon: adamrk created PR review comment:
A bunch of these tests change because the node ids are different now. This is because 1) when reserving, the nodes end up in the free list in the opposite order in which the were allocated and 2) we reserve the worst case each time instead of the exact amount needed. I was thinking that making those changes isn't worth the added complexity.
alexcrichton unassigned alexcrichton from PR #14637 bforest: Allocate all nodes upfront for insertion.
alexcrichton requested fitzgen for a review on PR #14637.
alexcrichton commented on PR #14637:
I'll defer this to @fitzgen as he's more familiar with this than I, but I'd recommend against a test-only bool to fail allocations and instead relying only on the OOM test/fuzz harness we have for handling that. Could the tests be moved over there for OOM-related things?
adamrk updated PR #14637.
github-actions[bot] added the label cranelift on PR #14637.
github-actions[bot] added the label fuzzing on PR #14637.
github-actions[bot] commented on PR #14637:
Subscribe to Label Action
cc @fitzgen
<details>
This issue or pull request has been labeled: "cranelift", "fuzzing"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>
:thumbs_up: fitzgen submitted PR review:
LGTM with nitpick below addressed -- thanks!
:speech_balloon: fitzgen created PR review comment:
Same.
:speech_balloon: fitzgen created PR review comment:
I think we should just be able to use https://github.com/bytecodealliance/wasmtime/blob/ee1a0973901d7c5a735c05a1b58996e74ebf2f9c/crates/core/src/alloc.rs#L82 here
adamrk updated PR #14637.
adamrk requested fitzgen for a review on PR #14637.
:thumbs_up: fitzgen submitted PR review:
Thanks!
fitzgen added PR #14637 bforest: Allocate all nodes upfront for insertion to the merge queue.
:check: fitzgen merged PR #14637.
fitzgen removed PR #14637 bforest: Allocate all nodes upfront for insertion from the merge queue.
Last updated: Oct 31 2026 at 23:03 UTC