News for hackers. Stuff that matters.
Re:Falsify: Hypothesis-Inspired Shrinking for Haskell by gwern on Sunday April 20, 2025 @07:43PM (#43747380)
Really? Your examples seem the opposite. I am left immediately thinking, "hm, is it failing on a '!', some sort of shell issue? Or is it truncating the string on '#', maybe? Or wait, there's a space in the third one, that looks pretty dangerous, as well as noticeably longer so there could be a length issue..." As opposed to the shrunk version where I immediately think, "uh oh: one of them is not handling an empty input correctly." Also, way easier to read, copy-paste, and type.
Re:Falsify: Hypothesis-Inspired Shrinking for Haskell by dullcrisp on Sunday April 20, 2025 @09:27PM (#43747816)
Their point is that in the unshrunk example the “special” value stands out.

I guess if we were even more clever we could get to something more like (…, …, "", …).

Re:Falsify: Hypothesis-Inspired Shrinking for Haskell by tybug on Sunday April 20, 2025 @10:44PM (#43748112)
The Hypothesis explain phase [1][2] does this!

  fails_on_empty_third_arg(
      a = "",  # or any other generated value
      b = "",  # or any other generated value
      c = "",  
      d = "",  # or any other generated value
  )
[1] https://hypothesis.readthedocs.io/en/latest/reference/api.ht...

[2] https://github.com/HypothesisWorks/hypothesis/pull/3555

Re:Falsify: Hypothesis-Inspired Shrinking for Haskell by gwern on Sunday April 20, 2025 @09:33PM (#43747837)
The special value doesn't stand out, though. All three examples I gave were what I thought skimming his comment before my brain caught up to his caveat about an empty third argument. The empty string looked like it was by far the most harmless part... Whereas if they are all empty strings, then by definition the empty string stands out as the most suspicious possible part.
Re:Falsify: Hypothesis-Inspired Shrinking for Haskell by chriswarbo on Monday April 21, 2025 @02:54AM (#43749072)
> As opposed to the shrunk version where I immediately think, "uh oh: one of them is not handling an empty input correctly."

I agree that non-empty strings are worse, but unfortunately `("", "", "", "")` wouldn't only make me think of empty strings; e.g. I'd wonder whether duplicate/equal values are the problem.