Skip to content

[test] Simplify shuffle_test while pleasing gcc static analysis#1293

Open
serge-sans-paille wants to merge 1 commit intomasterfrom
fix/uninitialized-error
Open

[test] Simplify shuffle_test while pleasing gcc static analysis#1293
serge-sans-paille wants to merge 1 commit intomasterfrom
fix/uninitialized-error

Conversation

@serge-sans-paille
Copy link
Copy Markdown
Contributor

No description provided.

@serge-sans-paille serge-sans-paille force-pushed the fix/uninitialized-error branch from 68a69e6 to 58cb7e1 Compare April 9, 2026 13:48
@serge-sans-paille serge-sans-paille force-pushed the fix/uninitialized-error branch 2 times, most recently from db75962 to c98b053 Compare April 9, 2026 14:46
@DiamonDinoia
Copy link
Copy Markdown
Contributor

Weird, I cannot close the conversations. They are addressed so all good from me :)

@serge-sans-paille
Copy link
Copy Markdown
Contributor Author

@DiamonDinoia can you check the mingw issue? It seems to be related to #1290

@DiamonDinoia
Copy link
Copy Markdown
Contributor

I think that on MINGW32 (32-bit x86, GCC 15.2.0), the i386 ABI only guarantees 4-byte stack alignment, but SSE types (__m128i etc.) require 16-byte alignment. GCC normally inserts stack realignment prologues when it detects SSE usage, but std::fill on an array of SIMD batch types may generate different code paths (e.g., vectorized stores, rep instructions, or aligned movaps) compared to the manual loop which GCC likely compiled with unaligned movdqu stores. If GCC's inlined std::fill emits aligned SSE stores on a misaligned stack frame, that's a segfault.

I am not sure. Try:

  std::array<B, size> b_matrix = {};                                                                                                                              
  for (size_t i = 0; i < size; ++i)
      b_matrix[i] = b_lhs;

  std::array<value_type, size * size> ref_matrix = {};                                                                                                            
  auto ref_matrix_iter = ref_matrix.begin();
  for (size_t i = 0; i < size; ++i, ref_matrix_iter += size)                                                                                                      
      std::fill(ref_matrix_iter, ref_matrix_iter + size, lhs[i]);                                                                                                  

@serge-sans-paille serge-sans-paille force-pushed the fix/uninitialized-error branch from be42263 to c4972d3 Compare April 9, 2026 22:02
…static analysis

The extra initialization is redundant with the call to std::fill, but
GCC 13 seems to ignore it. And it's just tests so not performance
critical.
@serge-sans-paille serge-sans-paille force-pushed the fix/uninitialized-error branch from c4972d3 to d680624 Compare April 10, 2026 05:47
@AntoinePrv
Copy link
Copy Markdown
Contributor

At this rate, maybe the CI will be done by Monday 😓

@serge-sans-paille
Copy link
Copy Markdown
Contributor Author

I fear the avx512 CI is now hanging in test execution :-/

@serge-sans-paille
Copy link
Copy Markdown
Contributor Author

serge-sans-paille commented Apr 10, 2026

I may revert some commits if we end up breaking CI that much... I'll do that in another PR though.

@AntoinePrv
Copy link
Copy Markdown
Contributor

AntoinePrv commented Apr 10, 2026

I don't think it comes from the changes. If I recall, yesterday my PR was massively hanging too, including 2h on a download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants