Repository navigation
Windows and -O0 in CI; std.math's sqrt; SIMD widths compared where the AVX2 copy is plain - #185
Merged
Merged
Conversation
test_simd_widths checked contact_solver_wide8.lanes_native() before comparing the widths. Aether does not promise a native copy: GCC on Windows at -O0 (aether#3023) and the AETHER_GCC_COMPAT=0 path compile it as plain code, where native8() is false and the copy still has to give the same bits. The check failed those builds although they are correct. The scenes are now compared at both widths in every build, and the test says when the copy is plain. Measured with Aether at bd667cb1 on Windows: 29 checks pass at -O3; at -O0 the widths agree bit for bit and the note prints.
ae3d and Siltreach run on Windows, and ae3d builds its suites at -O0, but CI here built only Linux and macOS at -O3. Two bugs reached ae3d first: GCC on Win64 crashing on the AVX2 copies at -O0 (aether#3023), and four workers parting at -O0, where every sqrt is MinGW's library call and that rounds twice on the main thread's x87 precision. The new job runs the suite on windows-latest under MSYS2 UCRT64, with the release fetched as its .zip (get.sh looks for a .tar.gz), then test_determinism at -O0 against the golden trace. The pins move to one workflow-level env, read by get.sh, so a bump is one line. The README names the leg, and says five scenes, not four: the rolling mix joined the trace and the count stayed.
At -O0 every sqrt is a library call, and MinGW's library sqrt is the x87 one at the 64-bit precision a MinGW main thread runs with: it rounds twice, one ulp off for 253 of 1,000,000 inputs. From -O1 up GCC inlines sqrtsd and the library is never reached, so only unoptimized builds on Windows parted from the golden trace (wave pile from step 10). -O3 with -fno-builtin-sqrt gives exactly the -O0 bits, which is the proof. math.sqrt_float now calls std.math's sqrt, which runs in Aether's optimized runtime as the instruction, and every module, test and bench calls math.sqrt_float: the per-module `extern sqrt` lines are gone, so a bare sqrt no longer compiles. libm's sqrtf stays: its 64-bit x87 result rounds to a float once, and no float of 304 million differs from sqrtss. The call costs nothing measurable (bench/RESULTS.md: three scenes, alternated runs, within their spread) and the bits are the same: the suite and the golden trace pass at -O3 with Aether 0.835.0. bench/RESULTS.md also drops the slice indexing from what is left in the SAT: the Aether session measured every bounds test folded and the samples on aether_slice.h as skid from the loads (aether#3020).
MSYS2's base install has no diff, and the first run of the leg failed there after every test had passed.
The Windows runner's git checks text out as CRLF, so the golden trace differed from the build's on every line (1,1250c1,1250) although the bits agree: a UCRT64 build here matches it bit for bit. .gitattributes keeps tests/golden/*.txt and the shell scripts LF on every checkout.
ae build passes -fstack-protector-strong, and with it GCC on Win64 does not crash on the AVX2 copies at -O0 (measured on the release's C for test_contact_solver_wide: plain -O0 crashes, adding that flag alone compiles). So the leg runs -O0 on Aether 0.835.0 and cannot see aether#3023, which shows in builds that call gcc themselves without it, as ae3d's do. With std.math's sqrt nothing in a step depends on the x87 precision, so the -O0 scenes keep their bits without aether#3027.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #184.
What changes
sqrtis a library call. MinGW's librarysqrtis the x87 one, at the 64-bit precision a MinGW main thread runs with, and it rounds twice: one ulp off for 253 of 1,000,000 inputs. From -O1 up GCC inlinessqrtsdand hides it. Proof: -O3 with-fno-builtin-sqrtgives exactly the -O0 bits.math.sqrt_floatcalls std.math'ssqrt, which runs in Aether's optimized runtime as the instruction. Every module, test and bench callsmath.sqrt_float.extern sqrtlines are gone, so a baresqrtno longer compiles.sqrtfstays: no float of 304 million differs fromsqrtss.AETHER_GCC_COMPAT=0path compile the copy as plain code. Therenative8()is false, and the copy still has to give the same bits. The widths are compared in every build, and the test says when the copy is plain. That leaves 29 checks..zip, because aeb's get.sh looks for a.tar.gzand would build the compiler from source. diffutils is installed for the golden diff..gitattributeskeeps the golden trace and the scripts LF. The Windows runner checks text out as CRLF, and the golden diff then failed on every line, although the bits agree.env, which get.sh reads, so a bump is one line.No Aether release needed
This was first meant to wait for aether#3023 and aether#3027. It does not:
ae buildpasses-fstack-protector-strong, and with it GCC on Win64 compiles the AVX2 copies at -O0. Measured on the release's C: plain -O0 crashes, and that flag alone makes it compile. The crash shows only in builds that call gcc themselves without the flag, as ae3d's do, so this leg cannot see it.sqrt, nothing in a step depends on the x87 precision, so the -O0 scenes agree over four workers on 0.835.0 as they are.Measured (Windows)
std.math's
sqrtis a call where libm's became onesqrtsd. Three bench scenes, alternated runs: within their own spread, with the same bits (bench/RESULTS.md).