aldanor / fast-float-rust

Super-fast float parser in Rust (now part of Rust core)
https://docs.rs/fast-float
Apache License 2.0
275 stars 20 forks source link

Fuzz: verify that roundtripping f64 through string results in the same value #8

Closed Shnatsel closed 3 years ago

aldanor commented 3 years ago

Looks good! What is the random float64 generator used by the fuzzer? I.e. would it often emit super large and super small floats? (in case it does you might also use ryu serializer because it will use scientific notation and standard library's to-string will not - thus giving you free code paths).

Shnatsel commented 3 years ago

would it often emit super large and super small floats?

It will, if it notices that they trigger different code paths. I'll copy the ryu setup from the exhaustive f32 roundtrip test and see if that changes anything.

aldanor commented 3 years ago

Thanks!

aldanor commented 3 years ago

@Shnatsel I kicked off fuzz testing 4 months ago and totally forgot about it...

#1099511627776  pulse  cov: 149 ft: 195 corp: 71/561b lim: 4096 exec/s: 148343 rss: 538Mb

1.1 trillion checks for each of the fuzz tests... I think it's safe to say it's safe enough 🤣