Bug 109249 - vkd3d test failures related to ordered/unordered comparisons in test_shader_instructions()
Summary: vkd3d test failures related to ordered/unordered comparisons in test_shader_i...
Status: NEW
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/Common (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-08 17:12 UTC by Józef Kucia
Modified: 2019-01-08 17:17 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Józef Kucia 2019-01-08 17:12:35 UTC
Radv and Anv are affected. Nir optimizations appear to flip ordered/unordered comparisons. Removing ~inot optimization from https://gitlab.freedesktop.org/mesa/mesa/blob/add5a2ec92f4b3f7ac8353e5986dc04186a7b6da/src/compiler/nir/nir_opt_algebraic.py#L160 fixes the vkd3d test failures.

See https://lists.freedesktop.org/archives/mesa-dev/2018-December/210780.html for a related discussion.

The problem produces the following test failures on Anv:

d3d12:8258:31:if_return: Test failed: Got {0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00}, expected {1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00} at (0, 0).
d3d12:8258:41:if_return: Test failed: Got {1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 0.00000000e+00}, expected {1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00} at (0, 0).
d3d12:8258:48:if_return: Test failed: Got {0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00}, expected {1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00} at (0, 0).


and the following test failures on Radv:

d3d12:8258:31:if_return: Test failed: Got {0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00}, expected {1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00} at (0, 0).
d3d12:8258:34:if_return: Test failed: Got {1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00}, expected {1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 0.00000000e+00} at (0, 0).
d3d12:8258:37:if_return: Test failed: Got {1.00000000e+00, 1.00000000e+00, 0.00000000e+00, 0.00000000e+00}, expected {1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 0.00000000e+00} at (0, 0).
d3d12:8258:41:if_return: Test failed: Got {1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 0.00000000e+00}, expected {1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00} at (0, 0).
d3d12:8258:48:if_return: Test failed: Got {0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00}, expected {1.00000000e+00, 1.00000000e+00, 1.00000000e+00, 1.00000000e+00} at (0, 0).
Comment 1 Samuel Pitoiset 2019-01-08 17:16:00 UTC
One other solution is to set the exact bit when translating spirv to nir.
Comment 2 Jason Ekstrand 2019-01-08 17:17:28 UTC
+idr.  There has been some discussion of this and some different patches on the mailing list for different approaches to solving the problem.  This one gets a bit sticky because it's an area where GL is intentionally lax but Vulkan is supposedly more strict.  It's also an area where breaking IEEE a little is extremely useful for optimization.


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.