Repository navigation
docs(book): the fuzzing chapter says the adapter rejects five types it accepts - #1069
Merged
Merged
Conversation
…t accepts
`fuzzing-and-differential-testing.md` documents the trace API's type support as
nine scalars and then rules out five more:
Today the trace supports:
bool, i8, i16, i32, i64, u8, u16, u32, u64
It does not yet support `u128`, `i128`, `usize`, `isize`, or `char`.
`SCALAR_TRACE_TYPES` in `crates/fuzzer/tools/mir_generator.py` holds sixteen,
including all five of those plus `f32` and `f64`, and `supported_trace_type`
gates the adapter on exactly that set. Executing the real predicate:
u128 True i128 True usize True isize True char True
f32 True f64 True [u128; 4] True (u32, char) True
*const i8 False &i32 False (i8,i8,i8,i8,i8,i8) False
So the paragraph is wrong about every type it names, and understates the rest:
support is not set membership but a recursive question, because an array or
tuple folds by its leaves up to arity 5
([NVIDIA#792](NVIDIA#792)) -- and `f32`/`f64`
have been in since [NVIDIA#484](NVIDIA#484).
`crates/fuzzer/README.md` already states all of this correctly, listing the
same sixteen scalars and the folding rule. The book page is the one outlier, so
this brings it in line with the README and the code rather than inventing a
third description.
Two consequences follow:
- The sample `UNSUPPORTED [adapter]` line used `u128` as its rejected type,
which the adapter now accepts, so the example cannot be produced. It becomes
`*const i8`, which the predicate does reject (measured above) and which the
fuzzer README already uses as its own example of an adapter refusal.
- The widening plan listed "Add trace support for more scalar types (`u128`,
`i128`, `usize`, `isize`)" and "Add arrays, tuples, and eventually
structs/enums" as future work. The first is done and the second is half done,
so the plan now records what landed and keeps structs and enums as what
remains.
Left alone deliberately: the `RigidTy(Char)` backend classification in the same
sample output. `char` behaviour is in flux -- translation maps it to `u32`, and
whether `#[device]` extern signatures accept it is an open question
([NVIDIA#875](NVIDIA#875)) -- and I did not
reproduce that line end to end, so it is not mine to rewrite here.
Verified: the predicate results above come from importing `mir_generator.py`
and calling `supported_trace_type`, not from reading it. Book builds clean
under `sphinx-build -W`; `check-book-api-names.sh` passes.
Signed-off-by: Vyncint Ng <[email protected]>
…n the folding text
Collaborator
|
nihalpasham
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fuzzing-and-differential-testing.mddocuments the trace API's type support as nine scalars and then rules out five more:SCALAR_TRACE_TYPESincrates/fuzzer/tools/mir_generator.pyholds sixteen, including all five of those plusf32andf64, andsupported_trace_typegates the adapter on exactly that set. Importing the module and calling the real predicate:So the paragraph is wrong about every type it names, and understates the rest: support is not set membership but a recursive question, because an array or tuple folds by its leaves up to arity 5 (#792) — and
f32/f64have been in since #484.crates/fuzzer/README.mdalready states all of this correctly, listing the same sixteen scalars and the folding rule. The book page is the one outlier, so this brings it in line with the README and the code rather than inventing a third description.Two consequences
The sample
UNSUPPORTED [adapter]line usedu128as its rejected type, which the adapter now accepts, so that example cannot be produced. It becomes*const i8, which the predicate does reject (measured above) and which the fuzzer README already uses as its own example of an adapter refusal.The widening plan listed "Add trace support for more scalar types (
u128,i128,usize,isize)" and "Add arrays, tuples, and eventually structs/enums" as future work. The first is done and the second is half done, so the plan now records what landed and keeps structs and enums as what remains.Left alone deliberately
The
RigidTy(Char)backend classification in the same sample output.charbehaviour is nuanced — translation maps it tou32(mir-importer/src/translator/types.rs:543), while whether#[device]extern signatures accept it is open (#875) — and I did not reproduce that line end to end, so it is not mine to rewrite here.Verified: the predicate results above come from importing
mir_generator.pyand callingsupported_trace_type, not from reading it. Book builds clean undersphinx-build -W;check-book-api-names.shpasses.