Bug 88595

Summary: gen_shader_precision_tests.py build error with older version of NumPY
Product: piglit Reporter: Vinson Lee <vlee>
Component: testsAssignee: Piglit Mailing List <piglit>
Status: RESOLVED FIXED QA Contact: Piglit Mailing List <piglit>
Severity: normal    
Priority: medium CC: baker.dylan.c, chrisf
Version: unspecifiedKeywords: bisected, regression
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2015-01-19 17:58:11 UTC
piglit: c0c386a584ceec3ca8f3629e5b478a0ec3aea71d (master)

commit 7bc55808ee944457227b7230182d51d82b9909fc introduced a build error with older versions of NumPy.

commit 7bc55808ee944457227b7230182d51d82b9909fc
Author: Micah Fedke <micah.fedke@collabora.co.uk>
Date:   Wed Nov 19 17:22:00 2014 -0600

    arb_shader_precision: add tests for floating point precision
    
    Note: A bunch of these currently don't pass on i965.
    
    Reviewed-by: Dylan Baker <dylanx.c.baker@intel.com>
    Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>


Traceback (most recent call last):
  File "generated_tests/gen_shader_precision_tests.py", line 159, in <module>
    main()
  File "generated_tests/gen_shader_precision_tests.py", line 156, in main
    column_major_values=column_major_values ))
  File "site-packages/mako/template.py", line 452, in render_unicode
    as_unicode=True)
  File "site-packages/mako/runtime.py", line 803, in _render
    **_kwargs_for_callable(callable_, data))
  File "site-packages/mako/runtime.py", line 835, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "site-packages/mako/runtime.py", line 860, in _exec_template
    callable_(context, *args, **kwargs)
  File "generators/templates/gen_shader_precision_testsgenerated_tests/templates/gen_shader_precision_tests/vs.mako.py", line 113, in render_body
    __M_writer(unicode(shader_runner_format( column_major_values(test_vector.arguments[i]))))
  File "generated_tests/gen_shader_precision_tests.py", line 114, in shader_runner_format
    retval+=' {0}'.format('{0:1.8e}'.format(x))
ValueError: Unknown format code 'e' for object of type 'str'

>>> import numpy
>>> numpy.__version__
'1.4.1'
>>> x = numpy.float32(-1.5)
>>> ' {0}'.format('{0:1.8e}'.format(x))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'e' for object of type 'str'


This is probably NumPy bug #1675, which was fixed in NumPy 1.6.2. Upgrading NumPY fixed the build error.

>>> import numpy
>>> numpy.__version__
'1.9.1'
>>> x = numpy.float32(-1.5)
>>> ' {0}'.format('{0:1.8e}'.format(x))
' -1.50000000e+00'
Comment 1 Dylan Baker 2015-01-19 18:27:04 UTC
I have a patch proposed here to fix this issue:

http://patchwork.freedesktop.org/patch/40657/
Comment 2 Dylan Baker 2015-01-19 18:45:44 UTC
a55fbeb..bbd9ad2  master -> master

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.