Skip to content

Commit

Permalink
refactor(hydroflow_lang): remove old unused structured `FlowPropertie…
Browse files Browse the repository at this point in the history
…s` (#947)

Fix #888
  • Loading branch information
MingweiSamuel authored Oct 17, 2023
1 parent f21930c commit ff4bddd
Show file tree
Hide file tree
Showing 63 changed files with 62 additions and 405 deletions.
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/_lattice_fold_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::{quote_spanned, ToTokens};
use syn::parse_quote;

use super::{
DelayType, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
DelayType, OperatorCategory, OperatorConstraints,
OperatorWriteOutput, PortListSpec, WriteContextArgs, RANGE_0, RANGE_1,
};
use crate::graph::{OpInstGenerics, OperatorInstance};
Expand Down Expand Up @@ -44,11 +44,6 @@ pub const _LATTICE_FOLD_BATCH: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| PortListSpec::Fixed(parse_quote! { input, signal })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::No,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| Some(DelayType::Stratum),
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/_lattice_join_fused_join.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use syn::parse_quote;

use super::{
DelayType, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
DelayType, OperatorCategory, OperatorConstraints,
WriteContextArgs, RANGE_1,
};
use crate::graph::{OpInstGenerics, OperatorInstance};
Expand Down Expand Up @@ -76,11 +76,6 @@ pub const _LATTICE_JOIN_FUSED_JOIN: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| super::PortListSpec::Fixed(parse_quote! { 0, 1 })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| Some(DelayType::Stratum),
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/anti_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::{quote_spanned, ToTokens};
use syn::parse_quote;

use super::{
DelayType, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
DelayType, OperatorCategory, OperatorConstraints,
OperatorWriteOutput, Persistence, WriteContextArgs, RANGE_0, RANGE_1,
};
use crate::diagnostic::{Diagnostic, Level};
Expand Down Expand Up @@ -34,11 +34,6 @@ pub const ANTI_JOIN: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| super::PortListSpec::Fixed(parse_quote! { pos, neg })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::No,
inconsistency_tainted: false,
},
input_delaytype_fn: |idx| match idx {
PortIndexValue::Path(path) if "neg" == path.to_token_stream().to_string() => {
Some(DelayType::Stratum)
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/anti_join_multiset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::{quote_spanned, ToTokens};
use syn::parse_quote;

use super::{
DelayType, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
DelayType, OperatorCategory, OperatorConstraints,
OperatorWriteOutput, Persistence, WriteContextArgs, RANGE_0, RANGE_1,
};
use crate::diagnostic::{Diagnostic, Level};
Expand Down Expand Up @@ -37,11 +37,6 @@ pub const ANTI_JOIN_MULTISET: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| super::PortListSpec::Fixed(parse_quote! { pos, neg })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::No,
inconsistency_tainted: false,
},
input_delaytype_fn: |idx| match idx {
PortIndexValue::Path(path) if "neg" == path.to_token_stream().to_string() => {
Some(DelayType::Stratum)
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/assert.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use syn::parse_quote_spanned;

use super::{
FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints, WriteContextArgs,
OperatorCategory, OperatorConstraints, WriteContextArgs,
RANGE_0, RANGE_1,
};
use crate::graph::OperatorInstance;
Expand Down Expand Up @@ -29,11 +29,6 @@ pub const ASSERT: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::DependsOnArgs,
monotonic: FlowPropertyVal::DependsOnArgs,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/assert_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::quote_spanned;
use syn::parse_quote_spanned;

use super::{
FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints, WriteContextArgs,
OperatorCategory, OperatorConstraints, WriteContextArgs,
RANGE_0, RANGE_1,
};
use crate::graph::OperatorInstance;
Expand Down Expand Up @@ -40,11 +40,6 @@ pub const ASSERT_EQ: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::DependsOnArgs,
monotonic: FlowPropertyVal::DependsOnArgs,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/cross_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::quote_spanned;
use syn::parse_quote;

use super::{
FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints, WriteContextArgs,
OperatorCategory, OperatorConstraints, WriteContextArgs,
JOIN_CROSS_JOIN_FLOW_PROP_FN, RANGE_1,
};

Expand Down Expand Up @@ -49,11 +49,6 @@ pub const CROSS_JOIN: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| super::PortListSpec::Fixed(parse_quote! { 0, 1 })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: Some(JOIN_CROSS_JOIN_FLOW_PROP_FN),
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/cross_join_multiset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::quote_spanned;
use syn::parse_quote;

use super::{
FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints, WriteContextArgs,
OperatorCategory, OperatorConstraints, WriteContextArgs,
RANGE_1,
};

Expand Down Expand Up @@ -38,11 +38,6 @@ pub const CROSS_JOIN_MULTISET: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| super::PortListSpec::Fixed(parse_quote! { 0, 1 })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/defer_signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::quote_spanned;
use syn::parse_quote;

use super::{
DelayType, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
DelayType, OperatorCategory, OperatorConstraints,
OperatorWriteOutput, WriteContextArgs, RANGE_0, RANGE_1,
};

Expand Down Expand Up @@ -35,11 +35,6 @@ pub const DEFER_SIGNAL: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| super::PortListSpec::Fixed(parse_quote! { input, signal })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::No,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| Some(DelayType::Stratum),
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/defer_tick.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{
DelayType, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
DelayType, OperatorCategory, OperatorConstraints,
IDENTITY_WRITE_FN, RANGE_0, RANGE_1,
};

Expand Down Expand Up @@ -70,11 +70,6 @@ pub const DEFER_TICK: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| Some(DelayType::Tick),
flow_prop_fn: None,
write_fn: IDENTITY_WRITE_FN,
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/demux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use syn::spanned::Spanned;
use syn::{Expr, Pat};

use super::{
FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints, OperatorWriteOutput,
OperatorCategory, OperatorConstraints, OperatorWriteOutput,
PortListSpec, WriteContextArgs, RANGE_0, RANGE_1,
};
use crate::diagnostic::{Diagnostic, Level};
Expand Down Expand Up @@ -55,11 +55,6 @@ pub const DEMUX: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: Some(|| PortListSpec::Variadic),
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: None,
write_fn: |&WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/demux_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use quote::{quote, quote_spanned};
use syn::spanned::Spanned;

use super::{
FlowPropArgs, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
FlowPropArgs, OperatorCategory, OperatorConstraints,
OperatorWriteOutput, PortListSpec, WriteContextArgs, RANGE_0, RANGE_1,
};
use crate::diagnostic::{Diagnostic, Level};
Expand Down Expand Up @@ -49,11 +49,6 @@ pub const DEMUX_ENUM: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: Some(|| PortListSpec::Variadic),
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: Some(|FlowPropArgs { flow_props_in, .. }, _diagnostics| {
// Preserve input flow properties.
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/dest_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::quote_spanned;
use syn::parse_quote_spanned;

use super::{
make_missing_runtime_msg, FlowProperties, FlowPropertyVal, OperatorCategory,
make_missing_runtime_msg, OperatorCategory,
OperatorConstraints, OperatorInstance, OperatorWriteOutput, WriteContextArgs, RANGE_0, RANGE_1,
};

Expand Down Expand Up @@ -33,11 +33,6 @@ pub const DEST_FILE: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::DependsOnArgs,
monotonic: FlowPropertyVal::DependsOnArgs,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/dest_sink.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use quote::quote_spanned;

use super::{
FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints, OperatorInstance,
OperatorCategory, OperatorConstraints, OperatorInstance,
OperatorWriteOutput, WriteContextArgs, RANGE_0, RANGE_1,
};

Expand Down Expand Up @@ -94,11 +94,6 @@ pub const DEST_SINK: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/dest_sink_serde.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use quote::quote_spanned;

use super::{
make_missing_runtime_msg, FlowProperties, FlowPropertyVal, OperatorCategory,
make_missing_runtime_msg, OperatorCategory,
OperatorConstraints, OperatorWriteOutput, WriteContextArgs, RANGE_0, RANGE_1,
};

Expand Down Expand Up @@ -36,11 +36,6 @@ pub const DEST_SINK_SERDE: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/difference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::{quote_spanned, ToTokens};
use syn::parse_quote;

use super::{
DelayType, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
DelayType, OperatorCategory, OperatorConstraints,
OperatorWriteOutput, WriteContextArgs, RANGE_0, RANGE_1,
};
use crate::graph::{OperatorInstance, PortIndexValue};
Expand Down Expand Up @@ -37,11 +37,6 @@ pub const DIFFERENCE: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| super::PortListSpec::Fixed(parse_quote! { pos, neg })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::No,
inconsistency_tainted: false,
},
input_delaytype_fn: |idx| match idx {
PortIndexValue::Path(path) if "neg" == path.to_token_stream().to_string() => {
Some(DelayType::Stratum)
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/difference_multiset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use quote::{quote_spanned, ToTokens};
use syn::parse_quote;

use super::{
DelayType, FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints,
DelayType, OperatorCategory, OperatorConstraints,
OperatorWriteOutput, WriteContextArgs, RANGE_0, RANGE_1,
};
use crate::graph::{OperatorInstance, PortIndexValue};
Expand Down Expand Up @@ -37,11 +37,6 @@ pub const DIFFERENCE_MULTISET: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: Some(|| super::PortListSpec::Fixed(parse_quote! { pos, neg })),
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::No,
inconsistency_tainted: false,
},
input_delaytype_fn: |idx| match idx {
PortIndexValue::Path(path) if "neg" == path.to_token_stream().to_string() => {
Some(DelayType::Stratum)
Expand Down
8 changes: 1 addition & 7 deletions hydroflow_lang/src/graph/ops/enumerate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use quote::quote_spanned;

use super::{
FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints, OperatorInstance,
OperatorCategory, OperatorConstraints, OperatorInstance,
OperatorWriteOutput, Persistence, WriteContextArgs, RANGE_0, RANGE_1,
};
use crate::diagnostic::{Diagnostic, Level};
Expand Down Expand Up @@ -34,12 +34,6 @@ pub const ENUMERATE: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: None,
properties: FlowProperties {
// TODO(mingwei)
deterministic: FlowPropertyVal::No,
monotonic: FlowPropertyVal::No,
inconsistency_tainted: true,
},
input_delaytype_fn: |_| None,
flow_prop_fn: None,
write_fn: |wc @ &WriteContextArgs {
Expand Down
7 changes: 1 addition & 6 deletions hydroflow_lang/src/graph/ops/filter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use quote::quote_spanned;

use super::{
FlowProperties, FlowPropertyVal, OperatorCategory, OperatorConstraints, OperatorInstance,
OperatorCategory, OperatorConstraints, OperatorInstance,
OperatorWriteOutput, WriteContextArgs, RANGE_0, RANGE_1, FlowPropArgs,
};

Expand Down Expand Up @@ -31,11 +31,6 @@ pub const FILTER: OperatorConstraints = OperatorConstraints {
is_external_input: false,
ports_inn: None,
ports_out: None,
properties: FlowProperties {
deterministic: FlowPropertyVal::Preserve,
monotonic: FlowPropertyVal::Preserve,
inconsistency_tainted: false,
},
input_delaytype_fn: |_| None,
flow_prop_fn: Some(|FlowPropArgs { flow_props_in, .. }, _diagnostics| {
// Preserve input flow properties.
Expand Down
Loading

0 comments on commit ff4bddd

Please sign in to comment.