KLists kpoint sorting inconsistent across compiler in mixed precision
The sorting of kpoints into shells is different for clang 19 and gcc 14 and seemingly other clang and gcc's at least debug. This makes testing the Structure Factor Estimator with a realistic kgrid for a realistic unit cell a mess. It also is indicative that the KContainer unit testing is completely insufficient.
I also don't see any reason that or kpoint sorting shouldn't be 100% the same for all platforms and precision.
Related to #2445, #2137, #2105. It can't do diamond, the shell sorting algorithm should never have made it out of unit testing.
Currently its invisible but I have two different unit tests my branch which clearly show it. Sorting is different between full and mixed precision and between gcc and clang mixed sorting.
Is the sorting consistent in full precision or does the same problem occur?
After discussing with Peter, I'll note that (1) this could potentially the root cause of the historical Ewald problems, (2) clearly a correct and deterministic algorithm is needed. Avoiding the current integer mappings and working in terms of k^2 is one possibility.
Sorting is consistent in full precision at least in the cases I've looked at.