khagankhan opened PR #14276 from khagankhan:ctr to bytecodealliance:main:
The gc_ops fuzzer never generated non-nullable reference fields. Fixup forced every reference field to nullable, so the generator only ever emitted
(ref null $t)andstructref. This change lets non-nullable fields survive, so the fuzzer now exercises(ref $t)and(ref struct)as well.Two design choices:
Briefly,
inhabitableproves types buildable by fixpoint, so anything it never admits is uninhabitable.fix_uninhabitabletakes one such type per pass and relaxes only the fields that cannot be satisfied to nullable, then re-runs the analysis until every type is admitted. A nullable field can always be filled withref.null, so relaxing one gives the cycle a base case, which usually unblocks several other types at once and leaves well founded non-nullable references untouched.
emit_newbuilds a real object for non-null, pushing a value per field and ending withstruct.new.emit_ref_todecides build versus reuse. Types costing 8 instructions or less are built fresh at every use, and anything more expensive gets one shared object per loop iteration held in a local and read back withlocal.get+ref.as_non_null. Building cheap types fresh keeps many distinct objects on the heap instead of every reference aliasing one while the prototype stop a deep graph from expanding exponentially.P.S. I realized certain functions are very big (like
fixupnow). The next PR will be clean-up about these.+cc @fitzgen
khagankhan requested alexcrichton for a review on PR #14276.
khagankhan requested wasmtime-fuzz-reviewers for a review on PR #14276.
:memo: khagankhan submitted PR review.
:speech_balloon: khagankhan created PR review comment:
reports whether a field type has a default value. Only non-nullable references do not.
:memo: khagankhan submitted PR review.
:speech_balloon: khagankhan created PR review comment:
tells whether a field can be given a value using only a given set of buildable types. A non-nullable concrete reference needs its target in that set. A non-nullable need any non-array in that set.
:memo: khagankhan submitted PR review.
:speech_balloon: khagankhan created PR review comment:
this picks the buildable struct with the lowest round number. This is the struct built to fill a non-nullable (ref struct) field.
:memo: khagankhan submitted PR review.
:speech_balloon: khagankhan created PR review comment:
This decides which types get shared prototype. It costs each type as one instruction per field plus one using each referent's own cost and hoists anything over the budget that something actually points at. So when a nonnull struct needed a new one is created till total # is < 8 after that they were reused. This also may be considered "the first step" to places paradigm.
khagankhan updated PR #14276.
github-actions[bot] added the label fuzzing on PR #14276.
github-actions[bot] commented on PR #14276:
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:
- 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, thanks!
fitzgen added PR #14276 [gc_fuzz]: Add non-null types to the merge queue.
github-merge-queue[bot] removed PR #14276 [gc_fuzz]: Add non-null types from the merge queue.
fitzgen added PR #14276 [gc_fuzz]: Add non-null types to the merge queue.
:check: fitzgen merged PR #14276.
fitzgen removed PR #14276 [gc_fuzz]: Add non-null types from the merge queue.
Last updated: Sep 20 2026 at 18:08 UTC