predictor: inline NaN checks on MSVC #12622
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.36) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 181 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.311
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12622"
general
weight: 0.35
RAMitchell
This change avoids out-of-line NaN classification calls on MSVC in CPU prediction hot paths.
MSVC lowers std::isnan / the current NaN checks to CRT calls such as \_fdclass/\_fdtest. These checks are executed repeatedly during tree traversal and input adaptation, especially for workloads with missing values.
The change:
\- uses an inline IEEE-754 bit test for float NaN values on MSVC
\- keeps the existing NaN checks on other compilers
\- applies the same inline check to FVec::IsMissing and predictor input access paths
Correctness:
\- predictor tests: 26/26 passed
\- full C++ suite: 779 tests, 776 passed, 3 skipped, 0 failed, 1 disabled
\- all standalone A/B benchmark workloads produced bit-identical predictions
MSVC code generation:
\- \_fdclass: not present in the candidate DLL
\- \_fdtest: not present in the candidate DLL
\- isnan call sites: not present in the candidate DLL
Standalone paired A/B against upstream/master a97a7e70e:
| Workload | Change |
| --- | ---: |
| missing depth 8, inplace, 10k rows, 1T | -33.57% |
| sparse inplace, 10k rows, 1T | -34.18% |
| categorical, inplace, 10k rows, 1T | -14.02% |
| dense depth 6 x 500, 10k rows, 1T | -0.88% |
| dense depth 6 x 500, 100k rows, 5T | -1.54% |
| dense depth 6 x 500, 1 row, 1T | -0.21% |
The missing-value, sparse and categorical workloads were faster in every paired group.