predictor: skip array layout setup for small batches #12614
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 196 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.316
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12614"
general
weight: 0.35
RAMitchell
This change skips array-tree layout setup for small CPU prediction batches where the setup cost is larger than the traversal work it saves.
Previously, any prediction batch with more than one row prepared tree-depth metadata and enabled the array-layout path.
For small batches, this setup cost can dominate prediction latency.
The change:
Correctness:
Benchmark:
500 trees, max_depth=6, 100 features, Windows x64 Release build.
Paired 10-round results against upstream/master:
| Threads | Rows | Paired median change | Wins |
| ---: | ---: | ---: | ---: |
| 1 | 2 | -53.38% | 10/10 |
| 1 | 8 | -38.97% | 10/10 |
| 1 | 32 | -29.97% | 10/10 |
| 2 | 2 | -44.80% | 10/10 |
| 2 | 16 | -19.23% | 10/10 |
| 2 | 32 | -19.28% | 10/10 |
| 2 | 64 | -25.76% | 10/10 |
| 4 | 2 | -22.29% | 10/10 |
| 4 | 8 | -18.08% | 10/10 |
| 4 | 16 | -13.05% | 10/10 |
| 4 | 32 | -15.45% | 10/10 |
| 8 | 2 | -10.11% | 10/10 |
| 8 | 16 | -9.20% | 10/10 |
The threshold is clamped to the prediction block size and scales with the configured thread count, so larger batches continue to use the existing array-layout path.