feat(hydro_lang): add forward consistency analysis for IR sinks#2927
feat(hydro_lang): add forward consistency analysis for IR sinks#2927jhellerstein wants to merge 1 commit into
Conversation
12a6f18 to
49303cb
Compare
5d04b46 to
68deb32
Compare
Deploying hydro with
|
| Latest commit: |
6600441
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://738f83bc.hydroflow.pages.dev |
| Branch Preview URL: | https://feat-consistency-label-analy.hydroflow.pages.dev |
There was a problem hiding this comment.
Pull request overview
Adds an in-memory IR consistency labeling API for Hydro sinks, aiming to match the external coord-analysis labeling while also providing blame spans for unresolved nondeterminism.
Changes:
- Introduces
compile::consistency_labelwith label derivation, sink label extraction, and nondeterminism scanning. - Exposes new
BuiltFlowAPIs for (a) type-metadata-based sink labels and (b) forward (sink-oriented) analysis that downgrades labels on unresolved untrusted nondeterminism. - Adds unit + integration + simulator tests to validate label derivation and (partially) alignment with runtime behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| hydro_lang/src/compile/mod.rs | Exposes the new consistency_label module from compile. |
| hydro_lang/src/compile/consistency_label.rs | Implements label derivation + extraction/analysis + tests. |
| hydro_lang/src/compile/built.rs | Adds public BuiltFlow::{sink_consistency_labels, analyze_consistency} APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
49303cb to
ed4d130
Compare
68deb32 to
2707eb4
Compare
ed4d130 to
f713343
Compare
a1eddc2 to
d552a26
Compare
f26d93a to
feaf0f8
Compare
d552a26 to
81bc818
Compare
feaf0f8 to
1d58e7b
Compare
f1a7765 to
78ce814
Compare
1d58e7b to
cc07401
Compare
3526f92 to
5c49f5b
Compare
15e0816 to
5863b64
Compare
cc07401 to
71bbf8b
Compare
8ff063d to
65b6a1b
Compare
2dd09ab to
fb5d5ae
Compare
65b6a1b to
9abf61a
Compare
9abf61a to
d434d8e
Compare
d434d8e to
0b55571
Compare
0e2a973 to
f707981
Compare
Adds a forward consistency analysis that operates directly on the in-memory IR, producing labels equivalent to the external coord-analysis tool. For each observable sink, derives a label from the output type and walks backward checking for untrusted ObserveNonDet nodes not resolved by a c+i fold. Infers commutativity/idempotency from the fold's input collection_kind (NoOrder → commutative, AtLeastOnce → idempotent) per discussion with @shadaj. Also adds FlowBuilder::cluster_with_consistency() for creating clusters with explicit consistency types.
b9110c2 to
6600441
Compare
jhellerstein
left a comment
There was a problem hiding this comment.
redundancy in API: extract_sink_labels was the first version (metadata-based, for comparing with coord-analysis JSON output). analyze_sink_labels supersedes it — it does the actual analysis AND includes all sinks.
we should just remove extract_sink_labels and sink_consistency_labels, keeping only analyze_sink_labels / analyze_consistency.
a15a670 to
e70eab6
Compare
Adds a forward consistency analysis that operates directly on the in-memory IR, producing labels equivalent to the external
coord-analysistool.For each observable sink, the analysis derives a consistency label from the output type (ordering + retry) and walks backward checking for untrusted
ObserveNonDetnodes not resolved by a commutative+idempotent fold. Commutativity/idempotency are inferred from the fold's inputCollectionKind(NoOrder→ commutative,AtLeastOnce→ idempotent), avoiding extra fields on IR nodes.Labels:
SEQ_CONSISTENT,PER_KEY_SEQ_CONSISTENT,CONVERGENT_MULTISET,CONVERGENT_SET,CONVERGENT_LATTICE,INCONSISTENT.Also adds
FlowBuilder::cluster_with_consistency()for creating clusters with explicit consistency types.Includes 8 tests (unit, integration with
broadcast_closed, and simulator-validated).