← Back to Pull requests

predictor: inline NaN checks on MSVC #12622

Closed
unknown closed this pull request without merging on Sep 29, 2026 09:45 UTC
View on GitHub
unknown unknown commented on Sep 25, 2026 23:06 UTC
Author

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.

Diff: 181 lines (+135 / -46) across 2 files Reviewer: RAMitchell Review duration: 4959m
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
0.36
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
56%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 56.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 35.6% (MEDIUM) · Higher = larger blast radius
35.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 56.8% · Lower = rushed or shallow review
56.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%
Repository