Cross-Platform Floating-Point Determinism Out of the Box
Talkat CppCon 2024 · on Friday, 2024-09-20· at 13:30· Spruce 3/4, 6700 North Gaylord Rockies Boulevard·
summary
Claim: cross‑platform bit‑for‑bit floating‑point determinism is achievable. Implementation: an open‑source, templated math library plus six strategies (including soft‑float, DLL/static wrappers, inline assembly and compiler‑flag modes) and a fixed‑point fallback for geometry. Tests run across x86_64, arm64 and riscv64 with GCC/Clang/MSVC produce zero platform discrepancies when using the replacements. Performance: soft‑float 4–6× slower while inline assembly is about 10–35% slower; mixed deterministic/non‑deterministic builds remain supported and testing continues.
AI-written summary · about
chapters (14)
- 0:00Introduction to determinism
- 2:17Importance of determinism
- 10:18Previous failed attempts
- 13:16Goals and objectives
- 17:05Sources of non-determinism
- 23:11First attempt and failure
- 27:05New approach with templates
- 31:24Working implementations
- 37:32Correctness and testing
- 39:34Performance benchmarks
- 42:24Future work and fixed-point
- 46:51Summary of results
- 50:33C++ standard proposal
- 54:57Q&A session
related talks
51mFloating-Point Arithmetic on Deterministic Systems
48mFuture-Proofing Numerical Accuracy with Formal Specifications
01h 03mC++ Function Multiversioning in Windows
01h 02mFastware
01h 37mAn Overview of Program Optimization Techniques
01h 01mMultiplatform C++
32mBuilding Once, Running Everywhere: The Future of Portable AI Applications
11mInterview of Mark Rendle
