cub, libcu++: advertised properties + their checking in DeviceReduce. #11577
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 341 lines diff across 4 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.349
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #11577"
general
weight: 0.35
gonidelis
Description
Resolves #7797.
An incorrectly implemented environment query can silently select a default in CUB. This PR lets environments advertise the customizations they provide and makes
cub::DeviceReducediagnose broken advertised queries.cuda::execution::property_keys_t<T>obtains a type's advertised query list. User-defined types supply that list throughT::property_keys, usingcuda::execution::property_key_list<...>. An entryproperty_query<Key, Args...>describes a CPO invocation with a const environment and the specified additional argument types; a bareKeyis shorthand for a nullary invocation.The advertisement is a nested typedef, so discovering it does not depend on dispatching another query. Standard-library types keep their metadata under a reserved implementation name, accessed through
property_keys_t, to allow a future standard property interface without a source-compatibility conflict.Metadata is supplied by
cuda::std::execution::{prop, env},cuda::stream_ref,cuda::mr::memory_resource_base, and asynchronous resource references.envcombines and deduplicates its components' advertisements while retaining first-matching-member lookup. Validation checks individual advertised contributions so another provider cannot hide a broken advertisement, including in nested and inherited environments.Validation checks the CPO invocation and instantiates its body without executing the query. Each advertised expression is checked separately so the failing query appears in the instantiation trace. Automatic CUB validation is limited to
DeviceReduce: environments with metadata have their advertised customizations checked, while objects without metadata must support a stream or memory-resource query. Working unadvertised customizations remain usable, and unavailable queries retain their defaults.cuda::checked_env<Queries...>(env)explicitly validates selected CPO invocations and returns a member-query-forwarding adaptor. It can also add metadata to a third-party environment or replace an existing advertised list.A requested invocation may use the CPO's default when the input does not advertise that customization. If the input advertises a requested customization, its member must be present. The adaptor advertises only the requested expressions backed by supplied members; default-only invocations are checked without being advertised or manufacturing a member. This lets a checked default compose with other environments without shadowing a later provider. Supported member queries outside the checked list remain forwarded.
Checklist