From 875e4850fddbc7b32d48170452e4bcfc791fb43e Mon Sep 17 00:00:00 2001 From: Joe Rivera Date: Tue, 27 Oct 2026 00:02:05 -0500 Subject: [PATCH] test(physics): build physics_dyn_bike_plant_test without FP contraction StepsAsTheDynamicPlantDoes compares dyn_bike_plant's steps with dyn_plant called inline in the test, bit for bit. The plant is built with -ffp-contract=off (the exact-fp list); the test was not, so on the macOS arm64 lanes clang fused its copy into FMAs and the two differed by one ulp (package-macos / libcvc-release on #833: 0.40661397752110373 vs ...368 at tick 4). Build the test the same way, as nav_potential_test and nav_material_ext_test already are. --- src/cvc/tests/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cvc/tests/CMakeLists.txt b/src/cvc/tests/CMakeLists.txt index 9a5623bc0..a46403c97 100644 --- a/src/cvc/tests/CMakeLists.txt +++ b/src/cvc/tests/CMakeLists.txt @@ -145,6 +145,15 @@ cvc_setup_physics_replay(physics_replay_test) add_executable(physics_pose_tracker_test physics_pose_tracker_test.cpp) add_executable(physics_plant_host_test physics_plant_host_test.cpp) add_executable(physics_dyn_bike_plant_test physics_dyn_bike_plant_test.cpp) +# StepsAsTheDynamicPlantDoes holds dyn_bike_plant (built with -ffp-contract=off) to dyn_plant called +# inline here, bit for bit: build it the same way, or clang contracts this copy into FMAs on aarch64 +# (the macOS arm64 lanes) and the last bits differ. +if(NOT MSVC) + set_source_files_properties(physics_dyn_bike_plant_test.cpp + PROPERTIES COMPILE_OPTIONS "-ffp-contract=off") +else() + set_source_files_properties(physics_dyn_bike_plant_test.cpp PROPERTIES COMPILE_OPTIONS "/fp:precise") +endif() # det_math is internal to libcvc, so its test compiles it in, with the same no-contraction flag. add_executable(physics_det_math_test physics_det_math_test.cpp ${PROJECT_SOURCE_DIR}/src/cvc/physics/det_math.cpp)