Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 921297 - media-libs/mesa-23.3.1 fails tests on big-endian: nir_loop_unroll_test.fadd{,_rev}
Summary: media-libs/mesa-23.3.1 fails tests on big-endian: nir_loop_unroll_test.fadd{,...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc64 Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL: https://gitlab.freedesktop.org/mesa/m...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-03 16:22 UTC by matoro
Modified: 2024-01-11 04:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log and emerge --info (build.log.gz,119.83 KB, application/gzip)
2024-01-03 16:30 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matoro archtester 2024-01-03 16:22:43 UTC
Surprisingly small fails.

[----------] 14 tests from nir_loop_unroll_test
[ RUN      ] nir_loop_unroll_test.iadd
[       OK ] nir_loop_unroll_test.iadd (0 ms)
[ RUN      ] nir_loop_unroll_test.iadd_rev
[       OK ] nir_loop_unroll_test.iadd_rev (0 ms)
[ RUN      ] nir_loop_unroll_test.fadd
../mesa-23.3.1/src/compiler/nir/tests/loop_unroll_tests.cpp:148: Failure
Value of: nir_opt_loop_unroll(bld.shader)
  Actual: false
Expected: true
../mesa-23.3.1/src/compiler/nir/tests/loop_unroll_tests.cpp:148: Failure
Expected equality of these values:
  6
  count_instr(nir_op_fadd)
    Which is: 1
../mesa-23.3.1/src/compiler/nir/tests/loop_unroll_tests.cpp:148: Failure
Expected equality of these values:
  0
  count_loops()
    Which is: 1
[  FAILED  ] nir_loop_unroll_test.fadd (0 ms)
[ RUN      ] nir_loop_unroll_test.fadd_rev
../mesa-23.3.1/src/compiler/nir/tests/loop_unroll_tests.cpp:150: Failure
Value of: nir_opt_loop_unroll(bld.shader)
  Actual: false
Expected: true
../mesa-23.3.1/src/compiler/nir/tests/loop_unroll_tests.cpp:150: Failure
Expected equality of these values:
  7
  count_instr(nir_op_fadd)
    Which is: 1
../mesa-23.3.1/src/compiler/nir/tests/loop_unroll_tests.cpp:150: Failure
Expected equality of these values:
  0
  count_loops()
    Which is: 1
[  FAILED  ] nir_loop_unroll_test.fadd_rev (0 ms)
[ RUN      ] nir_loop_unroll_test.imul
[       OK ] nir_loop_unroll_test.imul (0 ms)
[ RUN      ] nir_loop_unroll_test.imul_rev
[       OK ] nir_loop_unroll_test.imul_rev (0 ms)
[ RUN      ] nir_loop_unroll_test.ishl
[       OK ] nir_loop_unroll_test.ishl (0 ms)
[ RUN      ] nir_loop_unroll_test.ishl_rev
[       OK ] nir_loop_unroll_test.ishl_rev (0 ms)
[ RUN      ] nir_loop_unroll_test.ishr
[       OK ] nir_loop_unroll_test.ishr (0 ms)
[ RUN      ] nir_loop_unroll_test.ishr_rev
[       OK ] nir_loop_unroll_test.ishr_rev (0 ms)
[ RUN      ] nir_loop_unroll_test.ushr
[       OK ] nir_loop_unroll_test.ushr (0 ms)
[ RUN      ] nir_loop_unroll_test.ushr_rev
[       OK ] nir_loop_unroll_test.ushr_rev (0 ms)
[ RUN      ] nir_loop_unroll_test.lshl_neg
[       OK ] nir_loop_unroll_test.lshl_neg (0 ms)
[ RUN      ] nir_loop_unroll_test.lshl_neg_rev
[       OK ] nir_loop_unroll_test.lshl_neg_rev (0 ms)
[----------] 14 tests from nir_loop_unroll_test (3 ms total)

Reproducible: Always
Comment 1 Matt Turner gentoo-dev 2024-01-03 16:26:20 UTC
Is this a regression?
Comment 2 matoro archtester 2024-01-03 16:30:11 UTC
Created attachment 881376 [details]
build.log and emerge --info
Comment 3 matoro archtester 2024-01-03 17:36:22 UTC
(In reply to Matt Turner from comment #1)
> Is this a regression?

Not a regression from 23.1.9.  But I also just reproduced the same issue on ppc64, so it appears to be a generic BE issue.
Comment 4 Matt Turner gentoo-dev 2024-01-09 17:25:42 UTC
(In reply to matoro from comment #3)
> (In reply to Matt Turner from comment #1)
> > Is this a regression?
> 
> Not a regression from 23.1.9.  But I also just reproduced the same issue on
> ppc64, so it appears to be a generic BE issue.

Thanks.

Let's not block stabilization in that case. Hopefully I can find time to investigate soon.
Comment 5 Matt Turner gentoo-dev 2024-01-10 04:22:27 UTC
I've spent some time investigating tonight on sparc64.

The two tests that fail were known to fail on s390 (also big endian) at the time they were added. See https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3445

The loop unrolling code correctly identifies the initial value, step value, and limit value. But calculate_iterations() fails and returns -1.

Debugging further, the problem occurs here:

>    uint64_t iter_u64 = nir_const_value_as_uint(iter, bit_size);
>    return iter_u64 > INT_MAX ? -1 : (int)iter_u64;

At the end of get_iteration().

iter is an i64 nir value, but we're asking it to be interpreted as a 32-bit integer, so nir_const_value_as_uint() returns 0 instead of 6.
Comment 6 Matt Turner gentoo-dev 2024-01-10 05:01:11 UTC
Give $URL a try.
Comment 7 matoro archtester 2024-01-10 17:15:57 UTC
(In reply to Matt Turner from comment #6)
> Give $URL a try.

Works perfect here, thanks!
Comment 8 Larry the Git Cow gentoo-dev 2024-01-11 04:41:57 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93b9d9dc97403326a984a056615295a163e259fa

commit 93b9d9dc97403326a984a056615295a163e259fa
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2024-01-10 21:34:47 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2024-01-11 04:41:51 +0000

    media-libs/mesa: Version bump to 23.3.3
    
    Bug: https://bugs.gentoo.org/908079
    Closes: https://bugs.gentoo.org/921297
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 media-libs/mesa/Manifest                           |   1 +
 media-libs/mesa/files/23.3.3-big-endian.patch      |  84 ++++
 ...3-symbols-check-Add-_GLOBAL_OFFSET_TABLE_.patch |  31 ++
 media-libs/mesa/mesa-23.3.3.ebuild                 | 450 +++++++++++++++++++++
 4 files changed, 566 insertions(+)