feat[next]: Infer as_fieldop type without domain #1853
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1853"
general
weight: 0.35
SF-N
as_fieldopcalls that don't have a domain argument.as_fieldop(deref)(vertex_field)will only get aVertexdomain also in cases when it is read from anas_fieldopon aVertex, Kdomain.as_fieldopwithscanwas extended to keep the vertical dimensions.PruneBroadcastwas renamed toRemoveBroadcast, and the filename was changed as well.Motivation:
Previously, type inference was required to run after domain inference. An
as_fieldopcall as emitted by the frontend had no domain, and inferring the type of the domain was not possible, since there existed no global ordering relation of dimensions, e.g. for anas_fieldopoperating on aVertexand aKfield it was unclear if the dimensions of the output are(Vertex, K)or(K, Vertex). This problem has many negative consequences in other places:Kmight be promoted toVertex, K.The global ordering was already introduced in PR #1847.
<!--
TODOs:
test_fieldop_from_scan:__field_operator_simple_scan_operator(out, __out_0_range) {out @ c⟨ KDimᵥ: [__out_0_range[0], __out_0_range[1][ ⟩
← as_fieldop(scan(λ(carry) → carry + 1.0, True, 1.0), cartesian_domain())();
has an empty domain. A special case is implemented for that, which ensures, that the vertical dimensions are kept.
isinstance(subexpr.type, ts.TypeSpec)becausesubexpr.type = Nonewhen running it or debugging without breakpoints. There is however no error when setting a breakpoint in type_synthesizer.py:applied_as_fieldop.tuple_getIt passes when removing Vertex from the position_dims and the defined_dims, i.e.,
../../../../../src/gt4py/next/iterator/transforms/global_tmps.py:62: AssertionError: assert cpm.is_call_to(tuple_expr, "make_tuple") because of changes in PR#1985 @tehrengruber: Fixed after commit 78dfe94.
-->