randomness lost

Description

The patch for TCHECK-73, shipped in 0.8.1, loses precision by doing inappropriate double math. This leads to a loss of randomness in gen/choose when given extreme values (such as Long/MAX_VALUE).

Environment

None

Attachments

1

Activity

Show:

gfredericks September 12, 2015 at 8:49 PM

Released in 0.8.2.

gfredericks September 11, 2015 at 3:36 AM

Applied on master (a0e950f), thanks.

Steve Miner September 10, 2015 at 8:12 PM

Yes, good point about hoisting the long casts in gen/choose. I updated the patch with that fix and added your test.

Steve Miner September 10, 2015 at 8:09 PM

new patch with fix and tests

gfredericks September 10, 2015 at 2:22 AM

Thanks for the explanation, I like your approach better.

I think the only thing I would change about your patch is that your long calls inside of choose can be hoisted outside the function definition, so they only get run once.

If you do that and maybe add the regression test from my commit as well, I'll accept it.

Thanks!

Completed

Details

Assignee

Reporter

Patch

Priority

Created August 23, 2015 at 7:32 PM
Updated September 12, 2015 at 8:49 PM
Resolved September 12, 2015 at 8:49 PM