float3: drop redundant direct streflop_cond.h include - #3028
Merged
Conversation
Collaborator
|
why the |
float3.h included lib/streflop/streflop_cond.h directly, ahead of FastMath.h. FastMath.h defines MATH_SQRT_OVERRIDE before it includes streflop_cond.h (so streflop does not define its own math::sqrt(float) -- FastMath provides a faster one). The direct include meant streflop_cond.h could be processed before that override was set. Drop the direct include; FastMath.h pulls in streflop_cond.h transitively with the override in place. creg_cond.h keeps its original position -- it does not pull in streflop, so it does not need to move. Surfaced by the macOS port (beyond-all-reason#2991, commit cc3cad9). Co-authored-by: Mark Kropf <markkropf@gmail.com>
tomjn
force-pushed
the
fix/float3-include-order
branch
from
June 18, 2026 20:35
991c9cc to
b1c4ebd
Compare
Contributor
Author
|
@sprunk branch updated, the creg change is gone now |
Collaborator
|
Thanks |
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.
What
float3.hincludedlib/streflop/streflop_cond.hdirectly. This drops that one include:#include "System/BranchPrediction.h" -#include "lib/streflop/streflop_cond.h" #include "System/creg/creg_cond.h" #include "System/FastMath.h" #include "System/type2.h"Why
FastMath.hdoes#define MATH_SQRT_OVERRIDE 1before it includesstreflop_cond.h, so that streflop does not define its ownmath::sqrt(float)(FastMath provides a faster one). The direct include infloat3.hsat ahead ofFastMath.h, sostreflop_cond.hcould be processed before that override was set.Dropping the direct include lets
FastMath.hbe the includer ofstreflop_cond.h(it pulls it in transitively, with the override in place).float3.hstill gets streflop viaFastMath.h, so nothing else changes.creg_cond.hkeeps its original position — its include tree (creg_cond.h → creg.h → SyncedPrimitive.h) does not reachstreflop_cond.h, so it does not need to move.Why this is cross-platform
No behavior change on any platform;
masterbuilds fine today. This just removes a direct include whose ordering bypassed FastMath'sMATH_SQRT_OVERRIDE, which is what the macOS port tripped over.Provenance
Surfaced by the macOS port (#2991, commit
cc3cad907f, author Mark Kropf — credited viaCo-authored-by). That commit also reorderedcreg_cond.h; this PR keeps the minimal change (the reorder was unnecessary).