[Piglit] [PATCH] arb_shader_precision: set tolerance for div/assign-div

Ilia Mirkin imirkin at alum.mit.edu
Tue Feb 3 14:21:14 PST 2015


On Tue, Feb 3, 2015 at 4:58 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Mon, Feb 2, 2015 at 6:04 AM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>> This makes the relevant tests pass on nvc0.
>>
>> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
>> ---
>>  generated_tests/gen_shader_precision_tests.py | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/generated_tests/gen_shader_precision_tests.py b/generated_tests/gen_shader_precision_tests.py
>> index b4664ea..0d24a80 100644
>> --- a/generated_tests/gen_shader_precision_tests.py
>> +++ b/generated_tests/gen_shader_precision_tests.py
>> @@ -58,7 +58,10 @@ tolerances = {'pow': 16.0,
>>                'log': 3.0,
>>                'log2': 3.0,
>>                'sqrt': 3.0,
>> -              'inversesqrt': 2.0}
>> +              'inversesqrt': 2.0,
>> +              'op-div': 2.5,
>> +              'op-assign-div': 2.5,
>> +              }
>
> Let me make sure I understand -- we're not /changing/ the tolerances
> in this patch, we're just adding some missing ones?

Right. Well, changing from the default, which was 0.

>
> If so, what tolerances were the tests using for division?

0 (the default). Can't say I _really_ understand what a tolerance of
2.5 ULP's really means, since as I (and the tests) understand it, the
error is always quantifiable in integer numbers of ULPs when the
result uses the same exponent, but that's what the spec says.

>
> Also if so,
>
> Reviewed-by: Matt Turner <mattst88 at gmail.com>

Thanks. This makes nvc0 pass the division ones, but there are
additional problems in many of the remaining tests due to... a number
of factors. The biggest and most annoying one is that the spec allows
a*b+c (and fma!) to act either like fma or like mul+add, at the
implementation's whim. That means that any mul+add can end up with a
ULP or so of error if it ends up being implemented as fma. This can
then get highly compounded with a mat4*mat4, for example. The test
generator has no concept of that, and I don't see a particularly easy
way of teaching it. (Nor what the correct thing to do is.) FWIW it
does not appear that nvc0 has a distinction between a fma that does
intermediate rounding and one that doesn't. I haven't traced the blob
yet though for these specific scenarios (nor will I have time to
anytime soon).

  -ilia


More information about the Piglit mailing list