Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion interactive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ workspace = true
[dependencies]
columnar = { workspace = true }
# The columnar kernels for the interpreted backend, pinned by git rev.
corgi = { git = "https://github.com/frankmcsherry/wip", rev = "c4626fce02288594c9806e9b747a19598d680e0a" }
corgi = { git = "https://github.com/frankmcsherry/wip", rev = "cb26fbd29c223a97781891298a0cc7b5f94a5b2f" }
differential-dataflow = { workspace = true }
mimalloc = "0.1.48"
serde = { version = "1.0", features = ["derive"] }
Expand Down
5 changes: 5 additions & 0 deletions interactive/tests/corgi_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ fn inputs_for(prog: &str) -> Vec<Vec<(Value, Value)>> {
// scalar_ops: (key, a, b) triples; a values straddle the `> 2` and `= -5` tests.
"scalar_ops" => vec![rows(&[&[1, 1, 9], &[1, 4, 8], &[2, 3, 7], &[3, -5, 6], &[3, 2, 5]])],
"sum_ops" => vec![rows(&[&[1, 10], &[2, 20], &[2, 21]])],
// sum_skew: any keyed pairs — the skew is in the program, not the data.
"sum_skew" => vec![rows(&[&[1, 10], &[2, 20], &[2, 21], &[3, 30]])],
"sum_skew_compiled" => vec![rows(&[&[1, 10], &[2, 20], &[2, 21], &[3, 30]])],
"case_ops" => vec![rows(&[&[1, 10], &[2, 20], &[3, 14], &[3, 30]])],
// pair_keys: composite keys with overlap, fanout, and one-sided keys on both sides.
"pair_keys" => vec![
Expand Down Expand Up @@ -76,6 +79,8 @@ fn assert_backends_agree(prog: &str) {
#[test] fn join_fallback() { assert_backends_agree("join_fallback"); }
#[test] fn scalar_ops() { assert_backends_agree("scalar_ops"); }
#[test] fn sum_ops() { assert_backends_agree("sum_ops"); }
#[test] fn sum_skew() { assert_backends_agree("sum_skew"); }
#[test] fn sum_skew_compiled() { assert_backends_agree("sum_skew_compiled"); }
#[test] fn case_ops() { assert_backends_agree("case_ops"); }
#[test] fn tour() { assert_backends_agree("tour"); }
#[test] fn pair_keys() { assert_backends_agree("pair_keys"); }
18 changes: 18 additions & 0 deletions interactive/tests/programs/sum_skew.ddp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Two collections that commit DIFFERENT variant arms, concatenated into one arrangement.
-- Neither side's shape names the whole variant universe: one infers `Sum([Some(_)])`
-- (tag 0 only), the other `Sum([None, Some(_)])` (tag 1 only) — two arities for one DDIR
-- type. corgi reads a differing Sum arity as a type error, so the two must be reconciled
-- with uncommitted (⊥) lanes before anything compares or gathers them.
--
-- This is the ROW-WISE FALLBACK case: `hash` is a term corgi does not lower, so the shapes
-- here come from `infer_shape_cols` scanning the data. See `sum_skew_compiled.ddp` for the
-- same defect on the compiled path — both under-approximate, just from different sources.
con Rare(1) = 0;
con Common(1) = 1;

let pairs = input 0 | key($0[0] ; $0[1]);

let onlyRare = pairs | map( $0[0] ; Rare(hash(1000000, $1[0])) );
let onlyCommon = pairs | map( $0[0] ; Common(hash(1000000, $1[0])) );

export "result" = (onlyRare + onlyCommon) | arrange | inspect(total);
16 changes: 16 additions & 0 deletions interactive/tests/programs/sum_skew_compiled.ddp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- `sum_skew.ddp` on the COMPILED path: no `hash`, so both maps lower to corgi logic.
--
-- The compiled path derives shape from the TERM rather than the data, but that is no less
-- of an under-approximation: `infer_term_shape` gives `Inject(tag, _)` an arity of `tag + 1`,
-- so `Rare(_)` compiles to one lane and `Common(_)` to two. A single term reconciles its own
-- arms (`If` joins them), but two separate operators have nothing to reconcile them, and the
-- declared universe (`con`) that would is discarded at parse.
con Rare(1) = 0;
con Common(1) = 1;

let pairs = input 0 | key($0[0] ; $0[1]);

let onlyRare = pairs | map( $0[0] ; Rare($1[0]) );
let onlyCommon = pairs | map( $0[0] ; Common($1[0]) );

export "result" = (onlyRare + onlyCommon) | arrange | inspect(total);
Loading