Stream: git-wasmtime

Topic: wasmtime / PR #4590 cranelift: Build a runtest case from ...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2022 at 08:49):

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

view this post on Zulip Wasmtime GitHub notifications bot (Aug 03 2022 at 08:52):

afonso360 updated PR #4590 from fuzz-fmt to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 18:26):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 18:26):

jameysharp created PR review comment:

How about emitting a type-appropriate default value, like 0 or 0x0.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.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 18:26):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 18:39):

afonso360 submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 18:39):

afonso360 created PR review comment:

That sounds like a great idea!

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 19:07):

afonso360 updated PR #4590 from fuzz-fmt to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 19:19):

afonso360 requested jameysharp for a review on PR #4590.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 19:26):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 19:26):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 19:26):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 20:02):

afonso360 updated PR #4590 from fuzz-fmt to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 20:05):

afonso360 updated PR #4590 from fuzz-fmt to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 20:05):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 20:05):

jameysharp submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 09 2022 at 20:06):

jameysharp has enabled auto merge for PR #4590.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 19:35):

jameysharp has disabled auto merge for PR #4590.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 19:35):

afonso360 updated PR #4590 from fuzz-fmt to main.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 21:06):

jameysharp has enabled auto merge for PR #4590.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2022 at 21:17):

jameysharp merged PR #4590.


Last updated: Dec 23 2024 at 12:05 UTC