You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
macOS CI fails because the cube writer hard-codes signed NaN output while macOS snprintf("%13.5E") formats negative NaN differently. The formatter test compares against the platform implementation.
Non-finite cube values
Route NaN and infinity through snprintf("%13.5E").
Preserve the writer’s fixed 13-byte field layout.
Fallback handling
Centralize conversion from snprintf output to a 13-byte cube field.
Pad safely if formatting returns fewer characters or fails.
Heads up on a bug in the plan for this PR: "The formatter test compares against the platform implementation" makes the regression test tautological. If the cube writer's non-finite branch calls snprintf("%13.5E", v) directly, and the test computes its "expected" value the same way (by calling snprintf on the test host), then the test is just checking that the code calls snprintf — it can never fail, even if the writer is broken, because both sides of the comparison are generated by the identical platform-dependent call at run time. That's exactly how the original bug (hard-coded/inconsistent signed-NaN formatting differing from snprintf output) slipped through CI in the first place.
To make this test meaningful, the expected value needs to be a fixed, pre-recorded golden string (captured once from a real macOS snprintf run) rather than a value computed via the same snprintf call inside the test itself. Otherwise this PR "fixes" the CI failure only by removing the test's ability to detect the very platform-formatting mismatch it's meant to catch.
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
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.
macOS CI fails because the cube writer hard-codes signed NaN output while macOS
snprintf("%13.5E")formats negative NaN differently. The formatter test compares against the platform implementation.Non-finite cube values
NaNand infinity throughsnprintf("%13.5E").Fallback handling
snprintfoutput to a 13-byte cube field.