Bug 97002 - dEQP-GLES3.functional.shaders.derivate.dfdx.fbo_float.vec2_highp fails
Summary: dEQP-GLES3.functional.shaders.derivate.dfdx.fbo_float.vec2_highp fails
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 11.2
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-20 07:34 UTC by xinghua
Modified: 2016-07-26 06:13 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description xinghua 2016-07-20 07:34:31 UTC
We found this issue when running WebGL 2.0 test as there is a case ported from native dEQP. However, this also fails with native dEQP test.
Steps to repro:
1. ./deqp-gles3 -n dEQP-GLES3.functional.shaders.derivate.dfdx.fbo_float_vec2_highp

Result:
This case fail. In fact, there are other 18 failure cases related with dfdx.

Notes:
We found these failure dfdx cases only exist on Broadwell machine. But these cases pass on Skylake machine. And dfdy cases pass on Broadwell and SKylake machine. 

Are there some good reason to explain it, thank you.
Comment 1 Yang Gu 2016-07-20 11:28:59 UTC
The following results are from WebGL port of this deqp test, but I think native case might be similiar.
Taking this case (fbo_float_vec2_highp) as example, at (x=97, y=2), 
threshold = [0.00006097555160522461, 9.80908925027372e-45, 0.000030502676963806152, 0.000030516646802425385]
On BDW machine:
reference = [0.8464646464646465, -0, -0.13636363636363638, -0.010101010101010102], resDerivate = [0.8464641571044922, -1.1920928955078125e-7, 0, 1]
On SKL machine:
reference = [0.8464646464646465, -0, -0.13636363636363638, -0.010101010101010102], resDerivate = [0.8464641571044922, 0, -0.13636398315429688, 1]

You may see, the 2nd value of derivate should be 0 (On both SKL and NVIDIA platform, it's 0 here), but I got -1.1920928955078125e-7 on BDW.

Actually there are two checkes there in LinearDerivateCase::verify() of es3fShaderDerivateTests.cpp, one is "verifyConstantDerivate(m_testCtx.getLog(), result, errorMask, m_dataType, reference, threshold, m_derivScale, m_derivBias, LOG_NOTHING)", while the other is “reverifyConstantDerivateWithFlushRelaxations(m_testCtx.getLog(), result, errorMask, m_dataType, m_precision, m_derivScale, m_derivBias, surfaceThreshold, m_func, function)”. Due to the non-zero value above, it fails with first check. But in second check, as the threshold there is "surfaceThreshold" (all 0s) instead of threshold (max(surfaceThreshold, opThreshold)), it fails sooner than in first check
Is it a problem here that we need to use threshold instead of surfaceThreshold in second check? I did a test, and it got these cases pass.
Comment 2 Mark Janes 2016-07-20 16:00:17 UTC
This test is not in the android "must pass" list:
https://android.googlesource.com/platform/external/deqp/+/master/android/cts/master/gles3-master.txt

Mesa's requirements are currently limited to the must-pass list.
Comment 3 xinghua 2016-07-21 02:05:19 UTC
(In reply to Mark Janes from comment #2)
> This test is not in the android "must pass" list:
> https://android.googlesource.com/platform/external/deqp/+/master/android/cts/
> master/gles3-master.txt
> 
> Mesa's requirements are currently limited to the must-pass list.

Hi, Mark, I think this case exists on must-pass list.
on line 15703 dEQP-GLES3.functional.shaders.derivate.dfdx.fbo.vec2_highp
Comment 4 xinghua 2016-07-21 02:19:07 UTC
Mark, sorry, I had checked these two cases again, they may be not the same cases.
Comment 5 Kenneth Graunke 2016-07-21 03:41:56 UTC
Interestingly, the majority of the results are correct - there's just one tiny spot near the upper right corner that seems to be wrong.

Also, the copy I have of the "other driver" fails in exactly the same way...
Comment 6 Kenneth Graunke 2016-07-22 17:57:29 UTC
I agree with Mark.  I don't think we can pass these.  It looks like they were removed from the mustpass list in:

commit ea026b329e6bf73f109cda914c90f08d5f7a5b8d
Author: Pyry Haulos <phaulos@google.com>
Date:   Tue Jul 21 15:12:53 2015 -0700

    Remove highp float FBO dfd*() tests from mustpass
    
    Bug: 22628471
    Bug: 22632003
    Change-Id: Ia9d2b9a5e04ad317cbcc8782c9efaeedd94a0a58

Sadly, the commit messages offer no explanation as to why, and I believe those bug IDs are for a Google-internal bug tracker.  (I suppose we could ask Pyry.)

Having looked around for documentation that could explain the problems, I found
https://hsdes.intel.com/appstore/article/#/1208680029/main
which indicates that the Intel Android team isn't planning on fixing these tests either.

I found another HSD somewhere which suggested this comes down to numerical imprecision when interpolating inputs, and that testing dFdx is hard.  I'm guessing that Skylake must have gotten a little better in that regard; these tests fail on both Broadwell and Haswell, despite us using the exact same code.

So I don't think we can fix this.  Someone will probably want to follow up with the WebGL conformance developers and Google developers and remove tests ported from blacklisted dEQP tests.

Sorry :(
Comment 7 xinghua 2016-07-26 06:13:27 UTC
We had find an issue when porting from the native code to webgl code, https://github.com/KhronosGroup/WebGL/pull/1931. After correcting it, we found that this issue passed on chrome.
And we had debugged why it passed on chrome and failed on native code, the root cause is interpolation value range is different between webgl and native, but the dfdx value is nearly same. For example, dfdx value of the same pixel R channel,
Native:
interpolation value range: [0.84646081924438477 0.84647130966186523]
dfdx value: 0.846460342 does not be in range, so fail.

WebGL:
interpolation value range: [0.846458911895752 0.8464700281620026]
dfdx value: 0.8464603424072266 does be in range, so pass.

It seems that the range computed by CPU(native) and JS(WebGL) is different, We suspect that the range computed by JS(64-bits) is more precise, so it is reasonable that passes on WebGL. I hope the info is useful for you. Thank you.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.