Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cranelift: Build a runtest case from fuzzer TestCase's #4590

Merged
merged 2 commits into from
Aug 10, 2022

Conversation

afonso360
Copy link
Contributor

👋 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

@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Aug 3, 2022
cranelift/fuzzgen/src/lib.rs Outdated Show resolved Hide resolved
@afonso360
Copy link
Contributor Author

afonso360 commented Aug 9, 2022

Now with a default expected output!

However the test case still doesn't execute by default, since we don't support u0:0 function names. But I can probably address that when we add multiple functions to the same testcase, shouldn't be too long now.

cranelift/fuzzgen/src/lib.rs Outdated Show resolved Hide resolved
@afonso360 afonso360 force-pushed the fuzz-fmt branch 2 times, most recently from 8d397bd to 63c2a9e Compare August 9, 2022 20:05
Copy link
Contributor

@jameysharp jameysharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@jameysharp jameysharp enabled auto-merge (squash) August 9, 2022 20:06
auto-merge was automatically disabled August 10, 2022 19:35

Head branch was pushed to by a user without write access

@jameysharp jameysharp enabled auto-merge (squash) August 10, 2022 21:06
@jameysharp jameysharp merged commit 11f0b00 into bytecodealliance:main Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants