afonso360 opened PR #4590 from fuzz-fmt
to main
:
:wave: Hey,
This is a quality of life improvement for the fuzzer. With the custom
Debug
impl we build a runtest test case that automatically executes in the interpreter and in the compiler backend.The test case needs some changes in order to be actually executable, since we don't know what the expected output of the function is. But an improvement in the future could be to run the interpreter in the
Debug
impl and print those results as the expected.The big thing here is that it also formats floats correctly, which with the previous impl we a pain to get into a runtest since they were printed in integer format.
Here's an example output:
;; Fuzzgen test case test interpret test run set enable_llvm_abi_extensions target aarch64 target s390x target x86_64 function u0:0(f64, i8, i32) system_v { ... function body } ; run: u0:0(-0x0.0ff7d7dff00ffp-1022, 32, 255) == TODO ; run: u0:0(0.0, 0, 0) == TODO
cc: @jameysharp
afonso360 updated PR #4590 from fuzz-fmt
to main
.
jameysharp submitted PR review.
jameysharp created PR review comment:
How about emitting a type-appropriate default value, like
0
or0x0.0
or whatever? Then someone trying to use this output can just run it and see from the error messages what the current implementation returns. If you use "TEST" like this then running the generated test just returns an unhelpful parse failure message.I'm happy to merge this as-is but I'll hold off in case you want to give that a try.
Fiddling around with this reveals some usability annoyances with
clif-util
too. It'd be nice if it reported what line number the error was on, and if it could optionally keep going after a failure to report all errors in the test.
jameysharp submitted PR review.
afonso360 submitted PR review.
afonso360 created PR review comment:
That sounds like a great idea!
afonso360 updated PR #4590 from fuzz-fmt
to main
.
afonso360 requested jameysharp for a review on PR #4590.
jameysharp submitted PR review.
jameysharp submitted PR review.
jameysharp created PR review comment:
I'm confused. Shouldn't this look at the function's signature to get the return type, rather than looking at the test inputs?
Other than that, this seems great. I like the way you're constructing the placeholders.
afonso360 updated PR #4590 from fuzz-fmt
to main
.
afonso360 updated PR #4590 from fuzz-fmt
to main
.
jameysharp submitted PR review.
jameysharp submitted PR review.
jameysharp has enabled auto merge for PR #4590.
jameysharp has disabled auto merge for PR #4590.
afonso360 updated PR #4590 from fuzz-fmt
to main
.
jameysharp has enabled auto merge for PR #4590.
jameysharp merged PR #4590.
Last updated: Dec 23 2024 at 12:05 UTC