Skip to content

TypedPython: narrow GCC fastmath to reassociation and FMA contract (#368) - #369

Merged
b-re-w merged 3 commits into
developfrom
feat/tp-gcc-fastmath
Nov 5, 2026
Merged

b-re-w merged 3 commits into
developfrom
feat/tp-gcc-fastmath

Conversation

@b-re-w

@b-re-w b-re-w commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Closes #368

  • defect fixed: GCC TP_FASTMATH_BEGIN used optimize("fast-math") (includes finite-math-only). Now optimize("associative-math,no-signed-zeros,no-trapping-math,fp-contract=fast"), the same scope as clang and MSVC.
  • test added (test_pipeline.py): macro scope test (red before: 'fast-math' in GCC line), NaN check in fastmath on host compiler, NaN check under a real GCC with -Werror=pragmas/attributes syntax check (skipped where no real GCC; runs on ubuntu CI).
  • documentation corrected: SPEC N-8 states the three compilers allow the same scope.

Added after the first push

  • MSVC: float_control(precise, off) is /fp:fast and folded x != x (Windows CI failed test_fastmath_keeps_nan_checks). MSVC's fastmath now enables FMA contraction only; SPEC N-8 says so and test_msvc_fastmath_scope_is_contract_only pins the macro (red before, green after).
  • test_buffer_memoryview: develop c50b53d failed on macOS because a worker's probe ran just after the compiled call returned (113 BufferErrors, then one success). A success now counts only if the call is still running 0.05 s later.

…turned

The macOS run of develop c50b53d failed in
test_other_thread_release_and_append_get_bufferror_during_a_memoryview_call with
113 BufferErrors followed by one success: the compiled call returned between the
worker's done check and its next probe. A success now counts only when the call
keeps running for 0.05 s after it.
Windows CI failed test_fastmath_keeps_nan_checks: float_control(precise, off) is /fp:fast,
which folds x != x. cl.exe has no reassociation-only switch, so on MSVC a fastmath function
now contracts but does not reassociate. SPEC N-8 says so; a macro test pins it.
@b-re-w
b-re-w merged commit 23262de into develop Nov 5, 2026
5 checks passed
@b-re-w
b-re-w deleted the feat/tp-gcc-fastmath branch November 5, 2026 13:51
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.

1 participant