Repository navigation
Restore caller rounding state in Float::Rounding and FloatVal - #262
Merged
Merged
Conversation
zayenz
force-pushed
the
feature/6.5.0-float-median-rounding
branch
from
October 22, 2026 12:02
a5d5c94 to
e21ebe8
Compare
zayenz
force-pushed
the
feature/6.5.0-float-median-rounding
branch
from
October 22, 2026 13:54
e21ebe8 to
57fdaa4
Compare
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.
Float::Roundinginitialized its arithmetic policy before Boost could save the incoming rounding mode, and its own destructor did not restore it. This leaked the mode from direct rounding scopes andFloatValoperations.Separate the arithmetic operations from the state-saving policy.
Float::Roundingnow uses Boost's state saver around the complete operations base, so it saves before initialization and restores on destruction.FloatValuses that policy directly. Boost's unprotected policy retains Gecode's arithmetic and MPFR operations. The MSVC/SSE path keeps its explicit-direction arithmetic and uses the same single outer state saver.Move the existing overflow-safe median calculation into the rounding operations;
FloatVal::med()delegates to it. Regressions cover direct and nested scopes, outward rounding, direct and Boost-wrapped interval operations, unprotected MPFR calls, and median boundaries under all four rounding modes. Infinite-input cases run only when compiler flags support them. Related to #155.Validation: all 1,557 float tests and all 484 integrity tests pass on the final build. The focused regressions also pass with five iterations and five threads. The regression bodies also pass with Autoconf finite-math flags and with the standard-rounding arithmetic used on Windows. Source tidiness and generated-source freshness checks pass. Native Windows/MSVC validation runs in the existing CI matrix.
This changes the rounding policy layout and moves the MPFR entry points to its operations base; ABI versioning remains part of the release flow.