Add single-pass multi-path evaluation to get_json_object #5425
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 358 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.352
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #5425"
general
weight: 0.35
gerashegalov
For each row of the data that is one JSON record, a query may ask that record for many fields — such as name, age, city, and so on. Before this change, the GPU read the whole record for every requested field: ask for 100 fields and the record was read 100 times by 100 threads. This PR changes that so the engine may read each record once and collects every requested field during that single read — like fetching everything in one trip to the warehouse instead of one trip per item.
The engine picks the best strategy per query: small requests keep the existing one-pass-per-field behavior (unchanged and just as fast), while large requests — 16 or more fields with a shared structure — use the new single-read path. The single-read path keeps its intermediate data in one of two storage layouts: one that fits entirely in the GPU's fast on-chip memory, and one for the largest requests that would not fit.
In addition, in this PR each part of the engine also compiles only the code it actually runs: the simple path stays small and lean, and none of the new single-read machinery is compiled into it.
Benchmark
GPU: RTX 6000 (sm_75), CUDA 13.3.
get_json_object_multiple_paths38 configurations (paths={1, 8, 32, 33, 135}, input={10 MiB, 100 MiB}, row shapes={2 nested layouts}, seeds={1, 2}; two cells skipped on both sides of the comparison because the GPU ran out of memory).
Geomean: 1.22× faster. The small-request cells (paths 1 and 8) hold within the repeat-run noise band; the single-read path wins from 32 paths up.
Top 5 speedups
| Cell (paths · size · scenario · seed) | Speedup |
|---|---|
| 33 paths · 100 MiB · 0 · 1 | 2.18× |
| 33 paths · 100 MiB · 0 · 2 | 2.17× |
| 32 paths · 100 MiB · 0 · 1 | 2.13× |
| 32 paths · 100 MiB · 0 · 2 | 2.10× |
| 33 paths · 100 MiB · 1 · 1 | 1.69× |
get_json_object_path_types48 configurations covering mixed query kinds (list positions, wildcards, and their mixes with plain names) — the route this PR does not change. 6 mixes × path counts {1, 8, 32, 64} × input {10 MiB, 100 MiB}.
Geomean: 1.00× (unchanged).
Admission is shaped in the stacked consolidated PR #5427 by a member-cost model, and the sibling-rich shapes — short rows with many short members (169 and 340 members at 16 and 8 paths) — run in the benchmark as dense bands, 6 to 14 percent faster than the release baseline on the frozen 50-cell grid.
One behavioral note: a bracketed query against an empty field name — such as
$['']— now matches an empty-named member instead of returning null. This is visible only to direct JNI callers: Spark's JSON path parser rejects empty field names and never reaches the kernel, so the output of every Spark-reachable query is unchanged.<img width="1760" height="990" alt="image" src="https://github.com/user-attachments/assets/09a8c6cf-957e-4cc0-9212-c5ac75e2b249" />