[CUB] Migrate two-phase scan-by-key APIs to execution environments #11811
All Vouch review confidence checks passed
Residual risk 0.35 = Change Risk (0.66) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 367 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.353
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #11811"
general
weight: 0.35
Seanium
Description
Closes #11709. Part of #9875.
Migrate the explicit-storage overloads of
DeviceScan::ExclusiveScanByKey,ExclusiveSumByKey,InclusiveScanByKey, andInclusiveSumByKeyto a defaultedconst EnvT¶meter.Each overload uses the existing explicit-storage
detail::dispatch_with_envhelper to extract the stream and tuning before callingscan_by_key_impl. This allows callers to query and supply temporary storage while using the same stream and tuning environment as the single-phase API. Temporary storage remains caller-owned, and an environment memory resource is not queried or used.Compatibility
Existing calls with an omitted stream, raw
cudaStream_t,nullptr, literal0, or a const-convertible stream wrapper continue to work. The mutable-lvalue-only and rvalue-only stream conversion corner case is tracked separately in #11824; the additional compatibility overloads were removed as requested in review.The scan algorithms, dispatch internals, ordinary non-key scans, and single-phase APIs are unchanged. Doxygen parameter and template documentation is updated for all four migrated overloads.
Tests
The environment regression tests exercise every migrated API with:
nullptr, and literal0Stream routing is checked through the existing launch registry and explicit synchronization of the requested stream.
Validation
Revalidated the review revision with CUDA 13.0.88, GCC 13.3.0, C++20, and
sm_75. All eight focused binaries passed on a Tesla T4 with NVIDIA driver 580.82.07: 65 test cases and 14,620 assertions.cub.test.device.scan_by_key_env.lid_{0,1,2}cub.test.device.scan_by_key.lid_{0,1,2}.types_1cub.test.device.scan_by_key_env_api.lid_0thrust.test.cuda.scan_by_key.cdp_0The existing suites cover host, device/CDP, and graph launch modes; the added direct explicit-storage environment cases run in the host-launch target. The changed environment test translation unit also compiles in C++17 with the same CUDA/host compilers and warning-as-error flags. The C++17 check is compile-only.
All applicable pre-commit hooks and
git diff --checkpass.Full upstream CI, other toolchains/architectures, the full functional type matrix, sanitizer runs, and performance benchmarks have not been run.
Checklist