Repository navigation
Overhaul fltx APIs, numerical core, validation, and CI - #10
Merged
Merged
Conversation
> reorganise headers, added: - fltx_config.h - constexpr helpers / core macros - fltx_interop.h - f128 <-> f256> conversions/overloads - fltx_fp.h - shared floating-point logic - fltx_decimal.h - exact decimal/biguint helpers for i/o
- add bl::sincos<T> overloads with f32/f64 support - move f256 exp/log tables into f256_consts.h - precompute f256 log atanh coefficients - share optimized f256 exp/log/pow logic between constexpr and runtime wrappers - clean up related formatting
- add browser benchmark page - categorize wasm results under WebAssembly with Node.js/Chrome subheaders - update benchmark CSV/SVG naming and table discovery - combined and per-platform benchmark charts in the README - add wasm vcpkg triplet/port support for GMP/MPFR builds
- precision fixes - cleaner benchmark reports - add wasm32 github checks
Use BL_F256_EXPR_CONSTEVAL_RUNTIME_DISPATCH so runtime expression evaluation goes through an `if consteval` split instead of making MSVC optimize the large constexpr branches for normal runtime calls. Add the tests/expressions/f256 target as a focused compile-time benchmark for future expression-template diagnostics.
- Centralize fltx SIMD and fast-math CMake options - Add shared f64x2 SIMD helpers for f128/f256 paths - Enable and tune wasm SIMD support for f256/f128 math hot paths - Remove redundant f256 expression dispatch and inline macros - Refresh benchmark outputs and document SIMD/fast-math support
* Restructure fltx include layout Move public headers under include/fltx, move implementation headers under include/fltx/detail, update source/test/example includes * - reorganize fltx headers and math runtime layout - Normalize public/detail include structure for f128/f256 and shared math helpers - remove obsolete wrapper includes - Clean up comparison operators, fp helper naming, comments, guards, and include paths * Refactor fltx headers and constexpr math APIs - Split aliases, traits, string, and stream headers - Consolidate f128/f256 public math category headers into math.h - Keep f128/f256 detail and runtime math implementations split by source file - Use constexpr/runtime dispatch for f32/f64 and expansion math paths - Reduce standard library include weight and simplify internal magnitude helpers - Update isolated compile tests and benchmark artifacts * - flatten/simplify library structure to make it more navigable - begin work on cleaner accuracy/benchmark system (bench f128 against boost::multiprecision::cpp_double_double instead of boost::multiprecision::mpfr_float_backend) - f128 accuracy/performance optimisations (more competitive vs boost::multiprecision::cpp_double_double) * walk back library restructure slightly to avoid overcompartmentalization * apply same structure to f32/f64 for consistency * updated gcc/clang linux benchmark results --------- Co-authored-by: Will <whemsworth@hotmail.co.uk>
- Infinity / NaN / signed zeros handling - improved library structure - istream operator>> support - fmod/remainder/remquo behavior and parity improvements - improved root/trig/exp/log/hyperbolic/gamma implementations
adds/compared other metrics: - accuracy score - domain score - Inf/Nan/signed-zero correctness compares against stronger competitor for each case: - f128: qdpp (dd_real) / boost::multiprecision::cpp_double_double - f256: qdpp (qd_real) / boost::multiprecision::mpfr_float_backend<64>
- CTest support - make benchmarks opt-in for metrics_tests
…rting. State which backend used for speed ratio comparison in each cell
# Conflicts: # README.md # include/fltx/charconv.h # res/metrics/windows/MSVC_f128.csv # res/metrics/windows/MSVC_f256.csv # tests/metrics/metrics_case_output.h # tests/metrics/metrics_config.h # tests/metrics/metrics_filter_tests.cpp
# Conflicts: # res/metrics/metrics_table.svg
… example_random.cpp
- make dispatch customization use bl_ prefixed hooks instead of namespace hooks - make pow/pow10, rounding, string, charconv, parse, stream, and format APIs consistent across f32/f64/f128/f256 - add integer and lower-precision exponent support for pow while rejecting implicit wider exponent downcasts - replace to_string_collapsed/to_std_string with to_string, to_static_string, and precision_info-based formatting - improve native f32/f64 constexpr decimal rounding and pow10 paths - refresh README examples, demos, metrics rendering, and tests - don't pollute public bl:: namespace, move internal helpers/types into bl::detail
- Reworked common decimal/IO internals for faster and more accurate f128/f256 parse/to_string - More robust to_string / to_static_string / parse. Better error handling/fallback - Refactored public IO API around std::ios_base::fmtflags (fixed, scientific, defaultfloat, hexfloat, showpoint, showpos, and uppercase) - Rounding format tags via round_options.h: bl::decimals, bl::significant_figures, and generic round_to(value, precision, format) - Split shared internals into smaller headers: ASCII helpers, biguint, format flag helpers, native float decimal conversion, and static string support Math: - Improved math internals, especially f128/f256 fmod support with bounded integer helpers (fmod_u128 / fmod_u320) Testing: - Dedicated IO metrics for to_string / parse, including fixed/scientific/default/hexfloat cases, randomized brute-force ranges - Reorganized build-time tests: renamed unit_compile_tests to unit_build_tests, split math vs IO targets, and added isolated f128/f256 parse/to_string build-speed sources. - Improved f256 expression compile benchmarking, including generated fused-kernel case lists and expression-template vs eager compile-time comparisons. Other: Updated README
… with better constexpr support - Broader IO metrics for to_string/parse, randomized brute-force cases, focused parse slow paths - Improve constexpr/no-FMA math paths with checked Dekker support for high-risk functions (but leave low-level arithmetic as-is) - Faster cbrt seeds, and tighter sqrt/cbrt accuracy - Clean up FMA detection - Add simulated consteval metrics support - reduce duplicated f128/f256 IO/math policy logic
- Score parse and value-returning metrics against representable target references - Use target-lattice references for nextafter/nexttoward - Share std-like rounding reference helpers across f128/f256 metric suites - Fix half-away rounding helpers and f256 limb rounding consistency
…nd NaN handling - add runtime-dispatched IO implementations for heavier runtime paths - improve constexpr, consteval simulation, and fast-math configuration - improve IO metrics coverage, oracle scoring, and reporting - add fast-math and fltx-only metrics modes - clean up generated metrics output and diagnostics
…256. Improved pow/pow10 handling with shared pow_tables.h, removed old f128/f256 pow10 table headers. Added/improved integer pow, ipow, reciprocal. More accurate f128 fma. Improved f128/f256 arithmetic and math kernels accuracy/performance. Expanded trig/transcendental internals, including shared trig reduction constants. Added round_stream.h and adjusted IO/string/conversion behavior. More efficient random support f128/f256. Add new examples: charconv, pow, polynomial, Newton solver, special values, std integration, storage interop. Moved metrics tooling from res/metrics to metrics/, including browser benchmark tooling. Updated standard integration tests and public API trait/alias coverage. Updated CMake presets/options and fast-math configuration.
Consolidate performance configuration into fltxBuildPolicy.cmake with FLTX_FMA_MODE=AUTO|OFF|ASSUME, FLTX_SIMD, and FLTX_INTERNAL_FAST_MATH=AUTO|ON|OFF. Internal flags no longer leak unsafe AVX, FMA, or fast-math requirements into consumers. Rework platform FMA support. Guaranteed-FMA translation units use direct intrinsics, MSVC AUTO uses cached guarded intrinsics, and baseline GCC/Clang/MinGW can dispatch a complete bl::fma operation to an isolated FMA backend. Remove low-level FMA policy templates and per-product dispatch. Named hardware, Dekker, checked, and automatic paths select once around complete f128 operations or batched f256 products while ordinary arithmetic remains inline. Move the cold CPUID/XGETBV probe into the compiled library while retaining an inline cached availability check. AUTO remains hardware-safe, ASSUME removes runtime probing, and OFF emits no FMA instructions. Separate FMA, SIMD, and fast-math detection. WebAssembly SIMD128 is enabled through the SIMD policy, AArch64 uses baseline FMA, and consumer fast-math state remains independent from the library’s internal build policy. Protect error-free transforms under fast-math. Precision pragmas restore the incoming compiler mode correctly, and Dekker remains the portable fallback when hardware FMA is unavailable. Improve extreme-domain arithmetic. Checked/scaled Dekker is selectively used in heavier operations, including extreme-ratio atan2 and sensitive f256 division residuals, without adding scaling checks to every low-level operation. Reduce f256 transcendental optimization complexity using high-level MSVC no-inline boundaries. Simplify the rounding API. Add roundeven; retain standard-shaped round, trunc, ceil, floor, lround, and llround; and replace mode-based round_to with round_to_decimals and round_to_significant_figures. Remove nearbyint, rint, lrint, llrint, rounding tags, and the unused stream-format round_to overload. Optimize rounding implementations with direct nearest-even and nearest-away-from-zero paths for native, f128, and f256 values while preserving exact ties, signed zero, constexpr behavior, and signed-integer boundaries. Improve configuration reporting. Each executable now distinguishes the consumer translation unit from the compiled fltx library and reports fast-math state, FMA policy and strategy, runtime FMA availability, architecture, and SIMD state.
- add f128/f256 approximate comparison APIs - define nominal precision, range, stepping, and text I/O behavior - improve parsing, formatting, arithmetic, math, and random generation - replace legacy tests with a unified modular validation system - add contract, constexpr, MPFR, package, and dependency validation - add runtime, compile-time, and binary-size benchmarking - add fingerprinted strict/fast-math metrics and SVG comparisons - consolidate cross-platform CI workflows
…rix covering Windows, Linux, macOS, ARM64, x64, MinGW, ClangCL, and WebAssembly.
CMake presets: Added explicit compiler/architecture presets, target verification, better Visual Studio environment handling, and ClangCL FMA configuration.
Arithmetic internals: Refactored f128/f256 operations into clearer finite-input, canonical, and special-value paths, including substantial division and residual-work changes.
Fast-math accuracy: Added targeted protections against unsafe reassociation and optimizer transformations, particularly for ClangCL, MinGW, and Emscripten.
Math functions: Updated f128/f256 sqrt, reciprocal, cbrt, hypot, logarithmic, exponential, and related implementations for extreme/subnormal inputs.
Public API: Added sqr overloads and documented the finite-input contract for basic arithmetic under fast-math.
Parsing and classification: Strengthened exact conversion, bitwise classification, signed-zero handling, NaN/infinity construction, and subnormal behavior.
Accuracy validation: Expanded the schema and oracles with signed-zero testing, native encoding helpers, a small sample profile, and advisory fast-math runs.
Benchmarks: Introduced a revised adaptive timing policy, operation-sized corpora, and integer-bit observation to resist fast-math optimizer interference.
Metrics pipeline: Added multi-preset host orchestration, compiler/architecture validation, provenance and source-fingerprint checks, strict-vs-fast-math comparisons, and atomic publication.
Metrics layout: Development results now target _unversioned/<profile>/{data,generated}, while canonical release evidence remains in validation/metrics/data and generated.
Reports and evidence: Regenerated Windows and WebAssembly accuracy/performance datasets and added architecture/compiler-specific overview and comparison SVGs.
Documentation: Added repository guidance, an architecture document, updated validation documentation, and refined ignore/search rules.
- retain native libm and simulated fast-math findings as advisory evidence - add genuine f32/f64 constexpr accuracy and special-value coverage - improve constexpr f64 pow accuracy with a compensated log product
- normalize native from_chars overflow handling - keep fast-math contract findings diagnostic - protect ARM fast-math validation oracles - canonicalize Windows runner paths in tooling tests
- use prefix-stable explicit ternary accuracy inputs - preserve the discovered FMA cancellation regression witness - move CI accuracy checks from full to standard sampling - fix near-cancellation detection in f256 FMA - document the revised CI policy
- construct negative zero from its IEEE bit pattern - disable FP contraction for GNU fixed-consteval validation - prevent AArch64 GCC accuracy from collapsing to binary64 precision
…on MinGW x64 Capture sign_bit(value.hi/x0) into local bools before MPFR addition to avoid unreliable sign detection after floating-point cancellation. On MinGW x64, (-0.0) + (+0.0) may produce +0.0 depending on MPFR implementation semantics, making re-reading sign_bit after addition unreliable for detecting negative zero. This is the final CI fix needed to unblock the merge to main.
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.
Summary
This merges the accumulated
devwork intomain, covering a broad modernization of the public API, numerical implementation, build policy, validation system, metrics pipeline, and CI.f32,f64,f128, andf256.charconv, strings, streams, and format integration for greater accuracy, consistency, and constexpr coverage.sqr,recip,ipow,roundeven,round_to_decimals, andround_to_significant_figures.approx_eqwith type-specific parity tolerances and an optional relative tolerance.Notable compatibility changes
validation/hierarchy.approx_eq(a, b, relative_tolerance).Validation
The new validation system covers: