[Mesa-dev] [Bug 106232] LLVM unit tests have error in random number handling

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 26 14:59:21 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=106232

--- Comment #3 from Roland Scheidegger <sroland at vmware.com> ---
(In reply to Jose Fonseca from comment #2)
> It's been a long time, but I think Tom's right.  This was a thinko, and my
> intent was the opposite.
Ok that makes sense. With this code only reversing sign with signed type, we'd
still not test full unsigned range though for uint32 types (but not smaller
types), looking at this again.

> 
> 
> > And float range is only from 0 to 2.0f?
> 
> That's correct.  That's sufficient to exercise the clamping.
> 
> Remember that if we generated a range between 0 and a VERY_LARGE_NUMBER,
> then only 1/VERY_LARGE_NUMBER of the cases would actually be in the most
> interesting range of 0..1
Ok, I think the problem is we don't know what we're going to convert to. If we
actually want to test float->int then we'd definitely want very large numbers
(in fact we'd wanted numbers which overflow the target type too) - values
between 0..2 aren't particularly interesting in this case. But for converting
to normalized this is right.
This code of course also does cases which are not really interesting and
probably not hit in practice, like unorm->unsigned (everything is 0 or 1 after
conversion).

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180426/4c7816bd/attachment.html>


More information about the mesa-dev mailing list