From 30b8d3e5a38a6307c72350f09008f6f4d2107aa6 Mon Sep 17 00:00:00 2001 From: Frank McSherry Date: Fri, 20 Nov 2026 20:19:17 -0500 Subject: [PATCH 1/5] DDIR: inputs are labelled by a number or a name; remove import and bare input An input's label, `input 0` or `input "edges"`, is its identity. A numbered input sits at its number, and named inputs after the largest number in the order of names, so the order inputs are written in never matters. Writing a label again reads the same input. Bare `input` is gone, and so is `import`, which now fails with a message saying what to write instead. A program no longer names the traces it reads: a load binds its inputs to them, as `load p from f.ddp edges=prod::edges`. `Program::bind` does this in the library, refuses an input with no declared shape, and is used by the server's load and plan commands, `ddir-plan --bind`, and the diagnostics program (`diag::bind_sources`). Explain labels its query input `query`. Every program is migrated: each `import "P::a.b" : S` is now `input "a_b" : S`, and the LDBC client, the txn bench, the one-off splitter and the graph-index generator bind them. The reviewed plans change only in their source lines. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01H6wB4Gjwwivtq59LaFYbF5 --- interactive/README.md | 7 +- interactive/bench/ldbc/README.md | 4 +- interactive/bench/ldbc/SNB.md | 4 +- interactive/bench/ldbc/authored/README.md | 10 +- .../bench/ldbc/authored/plans/bi01.ddp | 2 +- .../bench/ldbc/authored/plans/bi02.ddp | 8 +- .../bench/ldbc/authored/plans/bi03.ddp | 20 ++-- .../bench/ldbc/authored/plans/bi04.ddp | 18 ++-- .../bench/ldbc/authored/plans/bi05.ddp | 10 +- .../bench/ldbc/authored/plans/bi06.ddp | 8 +- .../bench/ldbc/authored/plans/bi07.ddp | 10 +- .../bench/ldbc/authored/plans/bi08.ddp | 10 +- .../bench/ldbc/authored/plans/bi09.ddp | 8 +- .../bench/ldbc/authored/plans/bi10.ddp | 18 ++-- .../bench/ldbc/authored/plans/bi11.ddp | 8 +- .../bench/ldbc/authored/plans/bi12.ddp | 6 +- .../bench/ldbc/authored/plans/bi13.ddp | 14 +-- .../bench/ldbc/authored/plans/bi14.ddp | 14 +-- .../bench/ldbc/authored/plans/bi15.ddp | 8 +- .../bench/ldbc/authored/plans/bi16.ddp | 8 +- .../bench/ldbc/authored/plans/bi17.ddp | 10 +- .../bench/ldbc/authored/plans/bi18.ddp | 6 +- .../bench/ldbc/authored/plans/bi19.ddp | 8 +- .../bench/ldbc/authored/plans/bi20.ddp | 8 +- .../bench/ldbc/authored/plans/ic01.ddp | 16 ++-- .../bench/ldbc/authored/plans/ic02.ddp | 6 +- .../bench/ldbc/authored/plans/ic03.ddp | 10 +- .../bench/ldbc/authored/plans/ic04.ddp | 8 +- .../bench/ldbc/authored/plans/ic05.ddp | 10 +- .../bench/ldbc/authored/plans/ic06.ddp | 14 +-- .../bench/ldbc/authored/plans/ic07.ddp | 10 +- .../bench/ldbc/authored/plans/ic08.ddp | 8 +- .../bench/ldbc/authored/plans/ic09.ddp | 6 +- .../bench/ldbc/authored/plans/ic10.ddp | 14 +-- .../bench/ldbc/authored/plans/ic11.ddp | 10 +- .../bench/ldbc/authored/plans/ic12.ddp | 16 ++-- .../bench/ldbc/authored/plans/ic13.ddp | 2 +- .../bench/ldbc/authored/plans/ic14.ddp | 4 +- .../bench/ldbc/authored/plans/is01.ddp | 2 +- .../bench/ldbc/authored/plans/is02.ddp | 8 +- .../bench/ldbc/authored/plans/is03.ddp | 4 +- .../bench/ldbc/authored/plans/is04.ddp | 2 +- .../bench/ldbc/authored/plans/is05.ddp | 4 +- .../bench/ldbc/authored/plans/is06.ddp | 8 +- .../bench/ldbc/authored/plans/is07.ddp | 8 +- interactive/bench/ldbc/bi11.ddp | 4 +- interactive/bench/ldbc/bi5.ddp | 6 +- interactive/bench/ldbc/client.py | 17 +++- interactive/bench/ldbc/ic6.ddp | 6 +- .../bench/ldbc/interactive_v2/README.md | 2 +- .../interactive_v2/oneoff/ic01.oneoff.ddp | 16 ++-- .../interactive_v2/oneoff/ic02.oneoff.ddp | 12 +-- .../interactive_v2/oneoff/ic02.standing.ddp | 6 +- .../interactive_v2/oneoff/ic03.oneoff.ddp | 12 +-- .../interactive_v2/oneoff/ic03.standing.ddp | 10 +- .../interactive_v2/oneoff/ic04.oneoff.ddp | 12 +-- .../interactive_v2/oneoff/ic04.standing.ddp | 8 +- .../interactive_v2/oneoff/ic05.oneoff.ddp | 16 ++-- .../interactive_v2/oneoff/ic05.standing.ddp | 10 +- .../interactive_v2/oneoff/ic06.oneoff.ddp | 14 +-- .../interactive_v2/oneoff/ic07.oneoff.ddp | 10 +- .../interactive_v2/oneoff/ic08.oneoff.ddp | 8 +- .../interactive_v2/oneoff/ic09.oneoff.ddp | 12 +-- .../interactive_v2/oneoff/ic09.standing.ddp | 6 +- .../interactive_v2/oneoff/ic10.oneoff.ddp | 18 ++-- .../interactive_v2/oneoff/ic10.standing.ddp | 12 +-- .../interactive_v2/oneoff/ic11.oneoff.ddp | 10 +- .../interactive_v2/oneoff/ic12.oneoff.ddp | 20 ++-- .../interactive_v2/oneoff/ic12.standing.ddp | 16 ++-- .../interactive_v2/oneoff/ic13.oneoff.ddp | 2 +- .../interactive_v2/oneoff/ic14.oneoff.ddp | 6 +- .../interactive_v2/oneoff/ic14.standing.ddp | 4 +- .../bench/ldbc/interactive_v2/oneoff/split.py | 8 +- .../bench/ldbc/interactive_v2/systems.py | 4 +- interactive/bench/ldbc/is3.ddp | 4 +- interactive/bench/ldbc/snb/indexes.py | 9 +- interactive/bench/ldbc/snb/rel.py | 4 +- interactive/bench/txn/README.md | 2 +- interactive/bench/txn/bench_txn.py | 7 +- interactive/bench/txn/resolve.ddp | 2 +- interactive/bench/txn/resolve_by_key.ddp | 2 +- interactive/examples/server/README.md | 10 +- interactive/server/README.md | 21 ++-- interactive/server/diag.ddp | 8 +- interactive/server/src/cmd.rs | 77 +++++++-------- interactive/server/src/loop_.rs | 8 +- interactive/server/tests/multiworker.rs | 10 +- interactive/src/bin/ddir-plan.rs | 29 ++++-- interactive/src/diag.rs | 10 +- interactive/src/explain/mod.rs | 3 +- interactive/src/lower.rs | 96 ++++++++++--------- interactive/src/parse/mod.rs | 21 ++-- interactive/src/parse/pipe.rs | 69 ++++++------- interactive/src/passes/arrangements.rs | 6 +- interactive/src/passes/arrangements_tests.rs | 4 +- interactive/src/passes/as_of.rs | 32 +++---- interactive/src/passes/mod.rs | 6 +- interactive/src/passes/tests.rs | 12 +-- interactive/src/plan.rs | 27 ++++-- interactive/src/plan/ddp.rs | 46 ++++----- interactive/src/plan/ddp/parsed.rs | 6 +- interactive/src/scope_ir.rs | 14 +++ interactive/src/server/install.rs | 17 ++-- interactive/src/server/mod.rs | 22 ++--- interactive/src/shapes.rs | 2 +- interactive/tests/bitemporal.rs | 14 ++- interactive/tests/diag.rs | 5 +- interactive/tests/difftest.rs | 12 ++- interactive/tests/liveness.rs | 5 +- interactive/tests/plan_pairs.rs | 47 ++++++--- .../tests/plan_pairs/cases/as_of_shared.ddp | 2 +- .../tests/plan_pairs/cases/as_of_strict.ddp | 2 +- .../plan_pairs/expected/as_of_shared.ddp | 4 +- .../as_of_shared.parsed--lowered.diff | 4 +- .../expected/as_of_shared.parsed.ddp | 2 +- .../as_of_shared.projected--as-of.diff | 4 +- .../plan_pairs/expected/as_of_strict.ddp | 4 +- .../as_of_strict.parsed--lowered.diff | 4 +- .../expected/as_of_strict.parsed.ddp | 2 +- .../as_of_strict.projected--as-of.diff | 4 +- .../tests/plan_pairs/expected/explain.ddp | 2 +- .../expected/explain.lowered--optimized.diff | 2 +- .../plan_pairs/expected/explain.lowered.ddp | 2 +- .../plan_pairs/expected/ldbc_ic01_oneoff.ddp | 18 ++-- .../ldbc_ic01_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic01_oneoff.parsed.ddp | 16 ++-- .../plan_pairs/expected/ldbc_ic02_oneoff.ddp | 14 +-- .../ldbc_ic02_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic02_oneoff.parsed.ddp | 12 +-- .../expected/ldbc_ic02_standing.ddp | 4 +- ...ldbc_ic02_standing.lowered--optimized.diff | 8 +- ...bc_ic02_standing.optimized--projected.diff | 2 +- .../ldbc_ic02_standing.parsed--lowered.diff | 8 +- .../expected/ldbc_ic02_standing.parsed.ddp | 6 +- .../plan_pairs/expected/ldbc_ic03_oneoff.ddp | 12 +-- .../ldbc_ic03_oneoff.lowered--optimized.diff | 12 +-- .../ldbc_ic03_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic03_oneoff.parsed.ddp | 12 +-- .../expected/ldbc_ic03_standing.ddp | 4 +- ...ldbc_ic03_standing.lowered--optimized.diff | 12 +-- .../ldbc_ic03_standing.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic03_standing.parsed.ddp | 10 +- .../plan_pairs/expected/ldbc_ic04_oneoff.ddp | 8 +- .../ldbc_ic04_oneoff.lowered--optimized.diff | 14 +-- .../ldbc_ic04_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic04_oneoff.parsed.ddp | 12 +-- .../expected/ldbc_ic04_standing.ddp | 8 +- ...ldbc_ic04_standing.lowered--optimized.diff | 10 +- .../ldbc_ic04_standing.parsed--lowered.diff | 10 +- .../expected/ldbc_ic04_standing.parsed.ddp | 8 +- .../plan_pairs/expected/ldbc_ic05_oneoff.ddp | 16 ++-- .../ldbc_ic05_oneoff.lowered--optimized.diff | 12 +-- .../ldbc_ic05_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic05_oneoff.parsed.ddp | 16 ++-- .../expected/ldbc_ic05_standing.ddp | 6 +- ...ldbc_ic05_standing.lowered--optimized.diff | 12 +-- .../ldbc_ic05_standing.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic05_standing.parsed.ddp | 10 +- .../plan_pairs/expected/ldbc_ic06_oneoff.ddp | 16 ++-- .../ldbc_ic06_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic06_oneoff.parsed.ddp | 14 +-- .../plan_pairs/expected/ldbc_ic07_oneoff.ddp | 12 +-- .../ldbc_ic07_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic07_oneoff.parsed.ddp | 10 +- .../plan_pairs/expected/ldbc_ic08_oneoff.ddp | 10 +- .../ldbc_ic08_oneoff.parsed--lowered.diff | 10 +- .../expected/ldbc_ic08_oneoff.parsed.ddp | 8 +- .../plan_pairs/expected/ldbc_ic09_oneoff.ddp | 14 +-- .../ldbc_ic09_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic09_oneoff.parsed.ddp | 12 +-- .../expected/ldbc_ic09_standing.ddp | 4 +- ...ldbc_ic09_standing.lowered--optimized.diff | 8 +- ...bc_ic09_standing.optimized--projected.diff | 2 +- .../ldbc_ic09_standing.parsed--lowered.diff | 8 +- .../expected/ldbc_ic09_standing.parsed.ddp | 6 +- .../plan_pairs/expected/ldbc_ic10_oneoff.ddp | 12 +-- .../ldbc_ic10_oneoff.lowered--optimized.diff | 20 ++-- .../ldbc_ic10_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic10_oneoff.parsed.ddp | 18 ++-- .../expected/ldbc_ic10_standing.ddp | 10 +- ...ldbc_ic10_standing.lowered--optimized.diff | 14 +-- .../ldbc_ic10_standing.parsed--lowered.diff | 14 +-- .../expected/ldbc_ic10_standing.parsed.ddp | 12 +-- .../plan_pairs/expected/ldbc_ic11_oneoff.ddp | 12 +-- .../ldbc_ic11_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic11_oneoff.parsed.ddp | 10 +- .../plan_pairs/expected/ldbc_ic12_oneoff.ddp | 20 ++-- .../ldbc_ic12_oneoff.lowered--optimized.diff | 14 +-- .../ldbc_ic12_oneoff.parsed--lowered.diff | 12 +-- .../expected/ldbc_ic12_oneoff.parsed.ddp | 20 ++-- .../expected/ldbc_ic12_standing.ddp | 6 +- ...ldbc_ic12_standing.lowered--optimized.diff | 18 ++-- .../ldbc_ic12_standing.parsed--lowered.diff | 10 +- .../expected/ldbc_ic12_standing.parsed.ddp | 16 ++-- .../plan_pairs/expected/ldbc_ic13_oneoff.ddp | 4 +- .../ldbc_ic13_oneoff.parsed--lowered.diff | 4 +- .../expected/ldbc_ic13_oneoff.parsed.ddp | 2 +- .../plan_pairs/expected/ldbc_ic14_oneoff.ddp | 4 +- .../ldbc_ic14_oneoff.lowered--optimized.diff | 8 +- .../ldbc_ic14_oneoff.parsed--lowered.diff | 8 +- .../expected/ldbc_ic14_oneoff.parsed.ddp | 6 +- .../expected/ldbc_ic14_standing.ddp | 6 +- ...ldbc_ic14_standing.lowered--optimized.diff | 6 +- .../ldbc_ic14_standing.parsed--lowered.diff | 6 +- .../expected/ldbc_ic14_standing.parsed.ddp | 4 +- .../tests/plan_pairs/expected/ldbc_is01.ddp | 4 +- .../expected/ldbc_is01.parsed--lowered.diff | 4 +- .../plan_pairs/expected/ldbc_is01.parsed.ddp | 2 +- .../tests/plan_pairs/expected/ldbc_is02.ddp | 10 +- .../expected/ldbc_is02.parsed--lowered.diff | 10 +- .../plan_pairs/expected/ldbc_is02.parsed.ddp | 8 +- .../tests/plan_pairs/expected/ldbc_is03.ddp | 6 +- .../expected/ldbc_is03.parsed--lowered.diff | 6 +- .../plan_pairs/expected/ldbc_is03.parsed.ddp | 4 +- .../tests/plan_pairs/expected/ldbc_is04.ddp | 4 +- .../expected/ldbc_is04.parsed--lowered.diff | 4 +- .../plan_pairs/expected/ldbc_is04.parsed.ddp | 2 +- .../tests/plan_pairs/expected/ldbc_is05.ddp | 6 +- .../expected/ldbc_is05.parsed--lowered.diff | 6 +- .../plan_pairs/expected/ldbc_is05.parsed.ddp | 4 +- .../tests/plan_pairs/expected/ldbc_is06.ddp | 10 +- .../expected/ldbc_is06.parsed--lowered.diff | 10 +- .../plan_pairs/expected/ldbc_is06.parsed.ddp | 8 +- .../tests/plan_pairs/expected/ldbc_is07.ddp | 10 +- .../expected/ldbc_is07.parsed--lowered.diff | 10 +- .../plan_pairs/expected/ldbc_is07.parsed.ddp | 8 +- .../tests/plan_pairs/expected/txn_resolve.ddp | 4 +- .../txn_resolve.lowered--optimized.diff | 4 +- .../expected/txn_resolve.parsed--lowered.diff | 4 +- .../expected/txn_resolve.parsed.ddp | 2 +- .../expected/txn_resolve_by_key.ddp | 4 +- ...txn_resolve_by_key.lowered--optimized.diff | 4 +- .../txn_resolve_by_key.parsed--lowered.diff | 4 +- .../expected/txn_resolve_by_key.parsed.ddp | 2 +- interactive/tests/server_arranged_imports.rs | 4 +- interactive/tests/server_columnar_sources.rs | 7 +- interactive/tests/server_install.rs | 8 +- interactive/tests/server_late_import.rs | 43 +++++---- interactive/tests/server_shapes.rs | 39 +++++--- interactive/tests/tritemporal.rs | 5 +- 240 files changed, 1312 insertions(+), 1215 deletions(-) diff --git a/interactive/README.md b/interactive/README.md index d543ccf41..7057a2766 100644 --- a/interactive/README.md +++ b/interactive/README.md @@ -371,11 +371,12 @@ I would not recommend relying on any of this yet. ## Plan without running -`cargo run -p interactive --bin ddir-plan -- [name=]file.ddp [[name=]more.ddp ...]` prints +`cargo run -p interactive --bin ddir-plan -- [--bind label=trace ...] [name=]file.ddp [[--bind label=trace ...] [name=]more.ddp ...]` prints lowering, optimization, projection, and as-of-drop stages. `--passes LIST` switches passes off as the server's `DDIR_PASSES` does; a switched-off stage is shown unchanged. Earlier files supply -their inferred output shapes to later files, as `::`, where `name` is given or is the file's stem. No dataflow or generated source is -installed. A missing provider is unresolved even if its import declares a shape; +their inferred output shapes to later files, as `::`, where `name` is given or is the file's stem. +`--bind label=trace` binds an input of the next file to such a trace, as a load does. No dataflow or generated source is +installed. A missing provider is unresolved even though the bound input declares a shape; the tool prints the partial report and exits unsuccessfully. `ddir-plan --timings file.ddp` adds wall times, call counts, rewrite counts, and diff --git a/interactive/bench/ldbc/README.md b/interactive/bench/ldbc/README.md index 35b4c32de..36a7743d2 100644 --- a/interactive/bench/ldbc/README.md +++ b/interactive/bench/ldbc/README.md @@ -93,11 +93,11 @@ inclusive interval. Reference implementations: [BI5](https://github.com/ldbc/ldbc_snb_bi/blob/47dd38b40844ecdb0e42e5a610c369535304786d/umbra/queries/bi-5.sql), [BI11](https://github.com/ldbc/ldbc_snb_bi/blob/47dd38b40844ecdb0e42e5a610c369535304786d/umbra/queries/bi-11.sql). -All selected plans are installed once and import a shared graph program +All selected plans are installed once and read a shared graph program (`snb/indexes.py`). It publishes each relation by primary key, secondary indexes from foreign keys, friendships in both directions and each message's thread root; its load and maintenance costs are included. Even isolated -controls retain this fixed substrate. This uses existing named-import semantics; +controls retain this fixed substrate. Each plan's named inputs are bound to the graph's outputs at load; it does not introduce native Corgi trace sharing or a new prepared-query feature. Each round runs requests on the initial graph, retracts those bindings, removes diff --git a/interactive/bench/ldbc/SNB.md b/interactive/bench/ldbc/SNB.md index 4efd3892f..66bb07a54 100644 --- a/interactive/bench/ldbc/SNB.md +++ b/interactive/bench/ldbc/SNB.md @@ -118,9 +118,9 @@ bank entries are for transient request batches, not simultaneous BI bindings. | `maintained` | Standing | Standing | All bound answers maintained and checked | All query programs are installed once, with the shared graph program, before -any data arrives. Every query imports the arrangements the graph program +any data arrives. Every query reads the arrangements the graph program publishes (`snb/indexes.py`: each relation by primary key, secondary indexes, -friendships and thread roots) and has a separate request input. Imports read +friendships and thread roots) and has a separate request input. Bound inputs read the published arrangement in place. Parameter-independent parts of an installed query remain as dataflows even when its request input is empty; their maintenance is included. Other derived relations are not factored across diff --git a/interactive/bench/ldbc/authored/README.md b/interactive/bench/ldbc/authored/README.md index d7be8d644..c9031c348 100644 --- a/interactive/bench/ldbc/authored/README.md +++ b/interactive/bench/ldbc/authored/README.md @@ -17,8 +17,10 @@ An authored plan is a drop-in replacement for the generated one: query's `@query(...)` declaration in `snb/queries.py`, prefixed by `rid`. For example IC3 is `(rid, person, country X, country Y, start, days)`. Byte strings are `List(int)`. -- **Graph.** Plans import the arrangements the suite's shared graph program publishes - (`snb/indexes.py`), and join against them directly: +- **Graph.** Plans read the arrangements the suite's shared graph program publishes + (`snb/indexes.py`), and join against them directly. + Each is a named input, its label the output's name with `.` written `_` (`message_by_creator` + for `graph::message.by_creator`), and the driver binds it at load (`bench/ldbc/client.py`): - **primary keys**, `graph::person`, `graph::message`, `graph::forum`, `graph::tag`, `graph::tagclass`, `graph::place`, `graph::org`: `(id, (the other fields))`, in `snb/data.py`'s field order; @@ -31,7 +33,7 @@ An authored plan is a drop-in replacement for the generated one: `graph::message.root` (message, root post) and `graph::message.by_root`. Every query's server shares these, so a plan pays only for what it builds itself. - A `map` or `filter` on an import makes a private copy; the plans do that only for + A `map` or `filter` on a graph input makes a private copy; the plans do that only for parts kept for all requests, and each header says which. - **Answer.** `output "answer"`, read as `::answer`, is arranged as `((rid, rank), (fields…))`, where rank is the 0-based position in the query's order and the fields are the @@ -186,4 +188,4 @@ Two conventions apply throughout: Recurring fragments (where people live, the interaction weights) are repeated in each file, so that every plan is complete on its own; friendships and threads are -imported. +read from the graph. diff --git a/interactive/bench/ldbc/authored/plans/bi01.ddp b/interactive/bench/ldbc/authored/plans/bi01.ddp index ab254ba3c..f891ab7d8 100644 --- a/interactive/bench/ldbc/authored/plans/bi01.ddp +++ b/interactive/bench/ldbc/authored/plans/bi01.ddp @@ -5,7 +5,7 @@ -- every message, so this plan scans the message arrangement rather than looking up in it. let request = input 0 : ((int, int), ()); -- (rid, end time in ms) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -- Length categories: under 40, under 80, under 160, longer. diff --git a/interactive/bench/ldbc/authored/plans/bi02.ddp b/interactive/bench/ldbc/authored/plans/bi02.ddp index e245f5230..22cb9e957 100644 --- a/interactive/bench/ldbc/authored/plans/bi02.ddp +++ b/interactive/bench/ldbc/authored/plans/bi02.ddp @@ -5,11 +5,11 @@ -- each message's date in the message arrangement. let request = input 0 : ((int, int, List(int)), ()); -- (rid, date, class name) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -let tag = import "graph::tag" : (int, (List(int), int)); -- (id, (name, class)) -let tagged = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let class_id = import "graph::tagclass.by_name" : (List(int), int); -- (name, id) +let tag = input "tag" : (int, (List(int), int)); -- (id, (name, class)) +let tagged = input "mtag_by_tag" : (int, int); -- (tag, message) +let class_id = input "tagclass_by_name" : (List(int), int); -- (name, id) -- ((class, day), (tag name, created)) for every tagged message, and each class's days. let byday = tag | join(tagged, (_, ((name, cls), m)) -> (m, (cls, name))) diff --git a/interactive/bench/ldbc/authored/plans/bi03.ddp b/interactive/bench/ldbc/authored/plans/bi03.ddp index 86371e277..c8ec2e7ed 100644 --- a/interactive/bench/ldbc/authored/plans/bi03.ddp +++ b/interactive/bench/ldbc/authored/plans/bi03.ddp @@ -4,17 +4,17 @@ -- messages, and each message's thread root, whose forum is the thread's. let request = input 0 : ((int, List(int), List(int)), ()); -- (rid, class name, country name) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -let forum = import "graph::forum" : (int, (List(int), int, int)); -- (id, (title, created, moderator)) -let moderates = import "graph::forum.by_moderator" : (int, int); -- (person, forum) -let residents = import "graph::person.by_city" : (int, int); -- (city, person) -let place_id = import "graph::place.by_name" : (List(int), int); -- (name, id) -let within = import "graph::place.by_parent" : (int, int); -- (parent, place) -let class_id = import "graph::tagclass.by_name" : (List(int), int); -- (name, id) -let in_class = import "graph::tag.by_class" : (int, int); -- (class, tag) -let tagged = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let root_of = import "graph::message.root" : (int, int); -- (message, thread root) +let forum = input "forum" : (int, (List(int), int, int)); -- (id, (title, created, moderator)) +let moderates = input "forum_by_moderator" : (int, int); -- (person, forum) +let residents = input "person_by_city" : (int, int); -- (city, person) +let place_id = input "place_by_name" : (List(int), int); -- (name, id) +let within = input "place_by_parent" : (int, int); -- (parent, place) +let class_id = input "tagclass_by_name" : (List(int), int); -- (name, id) +let in_class = input "tag_by_class" : (int, int); -- (class, tag) +let tagged = input "mtag_by_tag" : (int, int); -- (tag, message) +let root_of = input "message_root" : (int, int); -- (message, thread root) -- Forums moderated by someone living in a city of the country. let local = request | map(((rid, _, country), ()) -> (country, rid)) diff --git a/interactive/bench/ldbc/authored/plans/bi04.ddp b/interactive/bench/ldbc/authored/plans/bi04.ddp index d7578b20b..254d44062 100644 --- a/interactive/bench/ldbc/authored/plans/bi04.ddp +++ b/interactive/bench/ldbc/authored/plans/bi04.ddp @@ -5,17 +5,17 @@ -- creation date and ranks, then looks up the winners' members, posts and threads. let request = input 0 : ((int, int), ()); -- (rid, date) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -- (id, (first, last, gender, birthday, created, ip, browser, city, birth month, birth day, creation month)) -let forum = import "graph::forum" : (int, (List(int), int, int)); -- (id, (title, created, moderator)) -let place = import "graph::place" : (int, (List(int), List(int), int)); -- (id, (name, type, parent)) -let residents = import "graph::person.by_city" : (int, int); -- (city, person) -let members = import "graph::member.by_forum" : (int, (int, int)); -- (forum, (person, joined)) -let joins = import "graph::member.by_person" : (int, (int, int)); -- (person, (forum, joined)) -let posts_in = import "graph::message.by_forum" : (int, int); -- (forum, post) -let thread = import "graph::message.by_root" : (int, int); -- (root, message) +let forum = input "forum" : (int, (List(int), int, int)); -- (id, (title, created, moderator)) +let place = input "place" : (int, (List(int), List(int), int)); -- (id, (name, type, parent)) +let residents = input "person_by_city" : (int, int); -- (city, person) +let members = input "member_by_forum" : (int, (int, int)); -- (forum, (person, joined)) +let joins = input "member_by_person" : (int, (int, int)); -- (person, (forum, joined)) +let posts_in = input "message_by_forum" : (int, int); -- (forum, post) +let thread = input "message_by_root" : (int, int); -- (root, message) -- Each person's country, and each forum's popularity (negated, so min is max). let country_of = place | join(residents, (_, ((_, _, country), who)) -> (who, country)); diff --git a/interactive/bench/ldbc/authored/plans/bi05.ddp b/interactive/bench/ldbc/authored/plans/bi05.ddp index 8a5863705..4f6ad502a 100644 --- a/interactive/bench/ldbc/authored/plans/bi05.ddp +++ b/interactive/bench/ldbc/authored/plans/bi05.ddp @@ -3,12 +3,12 @@ -- looked up from the request: the tag's messages, their authors, replies and likes. let request = input 0 : ((int, List(int)), ()); -- (rid, tag name) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -let tag_id = import "graph::tag.by_name" : (List(int), int); -- (name, id) -let tagged = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let replies = import "graph::message.by_parent" : (int, int); -- (message, reply) -let liked_by = import "graph::likes.by_message" : (int, (int, int)); -- (message, (person, created)) +let tag_id = input "tag_by_name" : (List(int), int); -- (name, id) +let tagged = input "mtag_by_tag" : (int, int); -- (tag, message) +let replies = input "message_by_parent" : (int, int); -- (message, reply) +let liked_by = input "likes_by_message" : (int, (int, int)); -- (message, (person, created)) -- The request's tagged messages and their authors: (message, (rid, author)). -- Tag names are unique and (message, tag) pairs are a set, so each message appears once. diff --git a/interactive/bench/ldbc/authored/plans/bi06.ddp b/interactive/bench/ldbc/authored/plans/bi06.ddp index b1176ff6f..ed88eff49 100644 --- a/interactive/bench/ldbc/authored/plans/bi06.ddp +++ b/interactive/bench/ldbc/authored/plans/bi06.ddp @@ -4,11 +4,11 @@ -- message's author); the rest is looked up from the request. let request = input 0 : ((int, List(int)), ()); -- (rid, tag name) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -let tag_id = import "graph::tag.by_name" : (List(int), int); -- (name, id) -let tagged = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let liked_by = import "graph::likes.by_message" : (int, (int, int)); -- (message, (person, created)) +let tag_id = input "tag_by_name" : (List(int), int); -- (name, id) +let tagged = input "mtag_by_tag" : (int, int); -- (tag, message) +let liked_by = input "likes_by_message" : (int, (int, int)); -- (message, (person, created)) -- The request's tagged messages and their authors (one tag; (message, tag) is a set). let written = request | map(((rid, name), ()) -> (name, rid)) diff --git a/interactive/bench/ldbc/authored/plans/bi07.ddp b/interactive/bench/ldbc/authored/plans/bi07.ddp index 00fb64e94..e1f707416 100644 --- a/interactive/bench/ldbc/authored/plans/bi07.ddp +++ b/interactive/bench/ldbc/authored/plans/bi07.ddp @@ -3,11 +3,11 @@ -- the tag's messages, their replies, and the replies' tags. let request = input 0 : ((int, List(int)), ()); -- (rid, tag name) -let tag = import "graph::tag" : (int, (List(int), int)); -- (id, (name, class)) -let tag_id = import "graph::tag.by_name" : (List(int), int); -- (name, id) -let tagged = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let tags_of = import "graph::mtag.by_message" : (int, int); -- (message, tag) -let replies = import "graph::message.by_parent" : (int, int); -- (message, reply) +let tag = input "tag" : (int, (List(int), int)); -- (id, (name, class)) +let tag_id = input "tag_by_name" : (List(int), int); -- (name, id) +let tagged = input "mtag_by_tag" : (int, int); -- (tag, message) +let tags_of = input "mtag_by_message" : (int, int); -- (message, tag) +let replies = input "message_by_parent" : (int, int); -- (message, reply) -- Messages carrying the request's tag (one tag; (message, tag) is a set). let marked = request | map(((rid, name), ()) -> (name, rid)) diff --git a/interactive/bench/ldbc/authored/plans/bi08.ddp b/interactive/bench/ldbc/authored/plans/bi08.ddp index db9d3c95c..a41f7fddf 100644 --- a/interactive/bench/ldbc/authored/plans/bi08.ddp +++ b/interactive/bench/ldbc/authored/plans/bi08.ddp @@ -4,12 +4,12 @@ -- the scored people's friends. let request = input 0 : ((int, List(int), int, int), ()); -- (rid, tag name, start, end) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let tag_id = import "graph::tag.by_name" : (List(int), int); -- (name, id) -let tagged = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let fans_of = import "graph::interest.by_tag" : (int, int); -- (tag, person) +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let tag_id = input "tag_by_name" : (List(int), int); -- (name, id) +let tagged = input "mtag_by_tag" : (int, int); -- (tag, message) +let fans_of = input "interest_by_tag" : (int, int); -- (tag, person) let tag_rid = request | map(((rid, name, _, _), ()) -> (name, rid)) | join(tag_id, (_, (rid, t)) -> (t, rid)); let fans = tag_rid | join(fans_of, (_, (rid, who)) -> ((rid, who), 100)); diff --git a/interactive/bench/ldbc/authored/plans/bi09.ddp b/interactive/bench/ldbc/authored/plans/bi09.ddp index 5bed250cb..8e3b6a9c8 100644 --- a/interactive/bench/ldbc/authored/plans/bi09.ddp +++ b/interactive/bench/ldbc/authored/plans/bi09.ddp @@ -7,12 +7,12 @@ -- (no published index is keyed by day). let request = input 0 : ((int, int, int), ()); -- (rid, start, end) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -- (id, (first, last, gender, birthday, created, ip, browser, city, birth month, birth day, creation month)) -let root_of = import "graph::message.root" : (int, int); -- (message, thread root) -let thread = import "graph::message.by_root" : (int, int); -- (root, message) +let root_of = input "message_root" : (int, int); -- (message, thread root) +let thread = input "message_by_root" : (int, int); -- (root, message) -- Messages by day, and the request's window days. let byday = message | map((id, (kind, created, who, _, _, _, _, _, _, _, _, _, day)) -> (day, (id, kind, created, who))); diff --git a/interactive/bench/ldbc/authored/plans/bi10.ddp b/interactive/bench/ldbc/authored/plans/bi10.ddp index c83f3d109..07d5956c0 100644 --- a/interactive/bench/ldbc/authored/plans/bi10.ddp +++ b/interactive/bench/ldbc/authored/plans/bi10.ddp @@ -5,17 +5,17 @@ -- first, then kept if their author qualifies. let request = input 0 : ((int, int, List(int), List(int), int, int), ()); -- (rid, person, country, class, minimum, maximum) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -- (id, (kind, created, creator, country, content, image, length, language, forum, parent, year, month, day)) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -- (id, (first, last, gender, birthday, created, ip, browser, city, birth month, birth day, creation month)) -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let place = import "graph::place" : (int, (List(int), List(int), int)); -- (id, (name, type, parent)) -let tag = import "graph::tag" : (int, (List(int), int)); -- (id, (name, class)) -let class_id = import "graph::tagclass.by_name" : (List(int), int); -- (name, id) -let in_class = import "graph::tag.by_class" : (int, int); -- (class, tag) -let tagged = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let tags_of = import "graph::mtag.by_message" : (int, int); -- (message, tag) +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let place = input "place" : (int, (List(int), List(int), int)); -- (id, (name, type, parent)) +let tag = input "tag" : (int, (List(int), int)); -- (id, (name, class)) +let class_id = input "tagclass_by_name" : (List(int), int); -- (name, id) +let in_class = input "tag_by_class" : (int, int); -- (class, tag) +let tagged = input "mtag_by_tag" : (int, int); -- (tag, message) +let tags_of = input "mtag_by_message" : (int, int); -- (message, tag) -- Breadth-first search from the person, growing only below `maximum` hops. let starts = request | map(((rid, who, _, _, _, most), ()) -> ((rid, most, who, 0), ())); diff --git a/interactive/bench/ldbc/authored/plans/bi11.ddp b/interactive/bench/ldbc/authored/plans/bi11.ddp index c413291bd..5d4dcd238 100644 --- a/interactive/bench/ldbc/authored/plans/bi11.ddp +++ b/interactive/bench/ldbc/authored/plans/bi11.ddp @@ -2,10 +2,10 @@ -- residents of a country, with all three friendships made inside [start, end]? let request = input 0 : ((int, List(int), int, int), ()); -- (rid, country, start, end) -let place_by_name = import "graph::place.by_name" : (List(int), int); -- (name, place) -let place_by_parent = import "graph::place.by_parent" : (int, int); -- (country, city) -let person_by_city = import "graph::person.by_city" : (int, int); -- (city, person) -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let place_by_name = input "place_by_name" : (List(int), int); -- (name, place) +let place_by_parent = input "place_by_parent" : (int, int); -- (country, city) +let person_by_city = input "person_by_city" : (int, int); -- (city, person) +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) -- Each request's residents, keyed by person, carrying the request and its window: -- country name -> country -> its cities -> the people living there. diff --git a/interactive/bench/ldbc/authored/plans/bi12.ddp b/interactive/bench/ldbc/authored/plans/bi12.ddp index c6360c67d..202e99549 100644 --- a/interactive/bench/ldbc/authored/plans/bi12.ddp +++ b/interactive/bench/ldbc/authored/plans/bi12.ddp @@ -4,9 +4,9 @@ -- all requests, so a request reads only its languages. let request = input 0 : ((int, int, int, List(int), int), ()); -- (rid, start, length, language, enabled); one row per language -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let root = import "graph::message.root" : (int, int); -- (message, root post of its thread) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let root = input "message_root" : (int, int); -- (message, root post of its thread) -- Messages with text, keyed by their thread's language (the root post's language). let texts = message | filter((_, (_, _, _, _, text, _, _, _, _, _, _, _, _)) -> (text len, 0) gt) diff --git a/interactive/bench/ldbc/authored/plans/bi13.ddp b/interactive/bench/ldbc/authored/plans/bi13.ddp index 8903a301d..4e6006dc1 100644 --- a/interactive/bench/ldbc/authored/plans/bi13.ddp +++ b/interactive/bench/ldbc/authored/plans/bi13.ddp @@ -3,13 +3,13 @@ -- from other zombies (likers created before the end date); top 100. let request = input 0 : ((int, List(int), int, int), ()); -- (rid, country, end, end month as year*12+month) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let wrote = import "graph::message.by_creator" : (int, int); -- (person, message) -let liked = import "graph::likes.by_message" : (int, (int, int)); -- (message, (liker, created)) -let place_by_name = import "graph::place.by_name" : (List(int), int); -let place_by_parent = import "graph::place.by_parent" : (int, int); -let person_by_city = import "graph::person.by_city" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let wrote = input "message_by_creator" : (int, int); -- (person, message) +let liked = input "likes_by_message" : (int, (int, int)); -- (message, (liker, created)) +let place_by_name = input "place_by_name" : (List(int), int); +let place_by_parent = input "place_by_parent" : (int, int); +let person_by_city = input "person_by_city" : (int, int); -- Candidates: residents (country name -> country -> cities -> people) created before -- the end, with their creation date and month. diff --git a/interactive/bench/ldbc/authored/plans/bi14.ddp b/interactive/bench/ldbc/authored/plans/bi14.ddp index edb1b14dd..30ac6d41f 100644 --- a/interactive/bench/ldbc/authored/plans/bi14.ddp +++ b/interactive/bench/ldbc/authored/plans/bi14.ddp @@ -3,13 +3,13 @@ -- message of person2's, 1 for the reverse. The best pair per person1's city; top 100. let request = input 0 : ((int, List(int), List(int)), ()); -- (rid, country 1, country 2) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let likes = import "graph::likes.by_message" : (int, (int, int)); -- (message, (liker, created)) -let place = import "graph::place" : (int, (List(int), List(int), int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let place_by_name = import "graph::place.by_name" : (List(int), int); -let place_by_parent = import "graph::place.by_parent" : (int, int); -let person_by_city = import "graph::person.by_city" : (int, int); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let likes = input "likes_by_message" : (int, (int, int)); -- (message, (liker, created)) +let place = input "place" : (int, (List(int), List(int), int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let place_by_name = input "place_by_name" : (List(int), int); +let place_by_parent = input "place_by_parent" : (int, int); +let person_by_city = input "person_by_city" : (int, int); -- Residents of country 1 with their city and its name; residents of country 2 -- (country name -> country -> cities -> people). diff --git a/interactive/bench/ldbc/authored/plans/bi15.ddp b/interactive/bench/ldbc/authored/plans/bi15.ddp index acb61bb78..67dcaf8cd 100644 --- a/interactive/bench/ldbc/authored/plans/bi15.ddp +++ b/interactive/bench/ldbc/authored/plans/bi15.ddp @@ -4,10 +4,10 @@ -- computed when the search reaches it. let request = input 0 : ((int, int, int, int, int), ()); -- (rid, from, to, start, end) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let root = import "graph::message.root" : (int, int); -- (message, root post of its thread) -let forum = import "graph::forum" : (int, (List(int), int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let root = input "message_root" : (int, int); -- (message, root post of its thread) +let forum = input "forum" : (int, (List(int), int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) -- Every reply between two people, scored (2 to a post, 1 to a comment) and dated by its -- thread's forum (the root post's): ((a, b), (forum created, score)), in both directions. diff --git a/interactive/bench/ldbc/authored/plans/bi16.ddp b/interactive/bench/ldbc/authored/plans/bi16.ddp index 4e698411d..be38fde53 100644 --- a/interactive/bench/ldbc/authored/plans/bi16.ddp +++ b/interactive/bench/ldbc/authored/plans/bi16.ddp @@ -2,10 +2,10 @@ -- `maxknows` of the others posting about each; top 20 by messages on both days. let request = input 0 : ((int, List(int), int, List(int), int, int), ()); -- (rid, tag A, day A, tag B, day B, max knows) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let tag_by_name = import "graph::tag.by_name" : (List(int), int); -- (name, tag) -let mtag_by_tag = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let tag_by_name = input "tag_by_name" : (List(int), int); -- (name, tag) +let mtag_by_tag = input "mtag_by_tag" : (int, int); -- (tag, message) +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) -- The two (tag, day) groups of a request, as side 0 and side 1. let sides = (request | map(((rid, ta, da, _, _, k), ()) -> (ta, (rid, 0, da, k)))) diff --git a/interactive/bench/ldbc/authored/plans/bi17.ddp b/interactive/bench/ldbc/authored/plans/bi17.ddp index db5fd9dce..3a1ec5366 100644 --- a/interactive/bench/ldbc/authored/plans/bi17.ddp +++ b/interactive/bench/ldbc/authored/plans/bi17.ddp @@ -6,11 +6,11 @@ -- person's tagged posts in a forum are reduced to their earliest. let request = input 0 : ((int, List(int), int), ()); -- (rid, tag name, delta hours) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let root = import "graph::message.root" : (int, int); -- (message, root post of its thread) -let tag_by_name = import "graph::tag.by_name" : (List(int), int); -- (name, tag) -let mtag_by_tag = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let member = import "graph::member.by_forum" : (int, (int, int)); -- (forum, (person, joined)) +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let root = input "message_root" : (int, int); -- (message, root post of its thread) +let tag_by_name = input "tag_by_name" : (List(int), int); -- (name, tag) +let mtag_by_tag = input "mtag_by_tag" : (int, int); -- (tag, message) +let member = input "member_by_forum" : (int, (int, int)); -- (forum, (person, joined)) -- The request's tagged messages: (rid, message, author, created, parent, forum), where a -- message's forum is its thread's (the root post's). Tag names are unique and diff --git a/interactive/bench/ldbc/authored/plans/bi18.ddp b/interactive/bench/ldbc/authored/plans/bi18.ddp index 464b7fa55..0aec9bb19 100644 --- a/interactive/bench/ldbc/authored/plans/bi18.ddp +++ b/interactive/bench/ldbc/authored/plans/bi18.ddp @@ -4,9 +4,9 @@ -- paths are built (meeting in the middle). let request = input 0 : ((int, List(int)), ()); -- (rid, tag name) -let tag_by_name = import "graph::tag.by_name" : (List(int), int); -- (name, tag) -let interest_by_tag = import "graph::interest.by_tag" : (int, int); -- (tag, person) -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let tag_by_name = input "tag_by_name" : (List(int), int); -- (name, tag) +let interest_by_tag = input "interest_by_tag" : (int, int); -- (tag, person) +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) -- People interested in the tag: (rid, person). let fans = request | map(((rid, name), ()) -> (name, rid)) diff --git a/interactive/bench/ldbc/authored/plans/bi19.ddp b/interactive/bench/ldbc/authored/plans/bi19.ddp index 4ce44fb6b..e20d2d482 100644 --- a/interactive/bench/ldbc/authored/plans/bi19.ddp +++ b/interactive/bench/ldbc/authored/plans/bi19.ddp @@ -2,10 +2,10 @@ -- city 2: every (person1, person2) pair at the least cost, ordered by the pair. let request = input 0 : ((int, int, int), ()); -- (rid, city 1, city 2) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let pals = import "graph::friend.pair" : ((int, int), ()); -- ((person, friend), ()) -let person_by_city = import "graph::person.by_city" : (int, int); -- (city, person) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let pals = input "friend_pair" : ((int, int), ()); -- ((person, friend), ()) +let person_by_city = input "person_by_city" : (int, int); -- (city, person) -- Interaction weights between friends: replies in either direction are counted per -- pair (n), and a friendship costs max(round(40 - sqrt(n)), 1), computed exactly as diff --git a/interactive/bench/ldbc/authored/plans/bi20.ddp b/interactive/bench/ldbc/authored/plans/bi20.ddp index 581725a2c..1e8c78e2d 100644 --- a/interactive/bench/ldbc/authored/plans/bi20.ddp +++ b/interactive/bench/ldbc/authored/plans/bi20.ddp @@ -4,10 +4,10 @@ -- found from the friendships (each person's few schools), not from all pairs of classmates. let request = input 0 : ((int, List(int), int), ()); -- (rid, company name, person) -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let study_by_person = import "graph::study.by_person" : (int, (int, int)); -- (person, (school, year)) -let org_by_name = import "graph::org.by_name" : (List(int), int); -- (name, org) -let work_by_org = import "graph::work.by_org" : (int, (int, int)); -- (org, (person, year)) +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let study_by_person = input "study_by_person" : (int, (int, int)); -- (person, (school, year)) +let org_by_name = input "org_by_name" : (List(int), int); -- (name, org) +let work_by_org = input "work_by_org" : (int, (int, int)); -- (org, (person, year)) -- Classmate friendships, weighted by the closest pair of graduation years: start from -- each friendship and look up both people's schools. diff --git a/interactive/bench/ldbc/authored/plans/ic01.ddp b/interactive/bench/ldbc/authored/plans/ic01.ddp index 8bf33b12f..305c94fd4 100644 --- a/interactive/bench/ldbc/authored/plans/ic01.ddp +++ b/interactive/bench/ldbc/authored/plans/ic01.ddp @@ -4,14 +4,14 @@ -- city by primary key, emails, languages, study and work by their person indexes. let request = input 0 : ((int, int, List(int)), ()); -- (rid, person, first name) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let place = import "graph::place" : (int, (List(int), List(int), int)); -let org = import "graph::org" : (int, (List(int), List(int), int)); -let study = import "graph::study.by_person" : (int, (int, int)); -- (person, (org, year)) -let work = import "graph::work.by_person" : (int, (int, int)); -let email = import "graph::email.by_person" : (int, List(int)); -let language = import "graph::language.by_person" : (int, List(int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let place = input "place" : (int, (List(int), List(int), int)); +let org = input "org" : (int, (List(int), List(int), int)); +let study = input "study_by_person" : (int, (int, int)); -- (person, (org, year)) +let work = input "work_by_person" : (int, (int, int)); +let email = input "email_by_person" : (int, List(int)); +let language = input "language_by_person" : (int, List(int)); -- The circle with distances: least hops (1 to 3) to each person, not the person. let hop1 = request | map(((rid, who, name), ()) -> (who, (rid, who, name))) diff --git a/interactive/bench/ldbc/authored/plans/ic02.ddp b/interactive/bench/ldbc/authored/plans/ic02.ddp index 55a58a661..0605aeb9c 100644 --- a/interactive/bench/ldbc/authored/plans/ic02.ddp +++ b/interactive/bench/ldbc/authored/plans/ic02.ddp @@ -6,9 +6,9 @@ -- relation (a private arrangement), not looked up. let request = input 0 : ((int, int, int), ()); -- (rid, person, max date) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) -- Every message, by author, in recency order (newest first, then smaller id). let by_author = message | map((id, (_, created, author, _, _, _, _, _, _, _, _, _, _)) -> (author, (created neg, id))); diff --git a/interactive/bench/ldbc/authored/plans/ic03.ddp b/interactive/bench/ldbc/authored/plans/ic03.ddp index 3abb0b0d1..03859a1d9 100644 --- a/interactive/bench/ldbc/authored/plans/ic03.ddp +++ b/interactive/bench/ldbc/authored/plans/ic03.ddp @@ -6,11 +6,11 @@ -- else is a lookup. let request = input 0 : ((int, int, List(int), List(int), int, int), ()); -- (rid, person, X, Y, start, days) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let place = import "graph::place" : (int, (List(int), List(int), int)); -let by_name = import "graph::place.by_name" : (List(int), int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let place = input "place" : (int, (List(int), List(int), int)); +let by_name = input "place_by_name" : (List(int), int); -- The request with X and Y as country ids ("Country" is the place type): (rid, (person, x, y, start, end)). let asked = request | map(((rid, who, x, y, start, days), ()) -> (x, (rid, who, y, start, (start, (days, 86400000) mul) add))) diff --git a/interactive/bench/ldbc/authored/plans/ic04.ddp b/interactive/bench/ldbc/authored/plans/ic04.ddp index 8c4934bb9..3b27f23cc 100644 --- a/interactive/bench/ldbc/authored/plans/ic04.ddp +++ b/interactive/bench/ldbc/authored/plans/ic04.ddp @@ -4,10 +4,10 @@ -- their names, keyed by message (both private: `message` and the tag index re-keyed). let request = input 0 : ((int, int, int, int), ()); -- (rid, person, start, days) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let tag = import "graph::tag" : (int, (List(int), int)); -let mtag = import "graph::mtag.by_tag" : (int, int); -- (tag, message) +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let tag = input "tag" : (int, (List(int), int)); +let mtag = input "mtag_by_tag" : (int, int); -- (tag, message) -- Friends' posts with their tags: ((rid, tag), (tag name, created, window start, window end)). let posts = message | filter((_, (kind, _, _, _, _, _, _, _, _, _, _, _, _)) -> (kind, 0) eq) diff --git a/interactive/bench/ldbc/authored/plans/ic05.ddp b/interactive/bench/ldbc/authored/plans/ic05.ddp index b72194c0d..80d320480 100644 --- a/interactive/bench/ldbc/authored/plans/ic05.ddp +++ b/interactive/bench/ldbc/authored/plans/ic05.ddp @@ -6,11 +6,11 @@ -- the date contribute just those 40. let request = input 0 : ((int, int, int), ()); -- (rid, person, date) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let forum = import "graph::forum" : (int, (List(int), int, int)); -let member = import "graph::member.by_person" : (int, (int, int)); -- (person, (forum, joined)) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let forum = input "forum" : (int, (List(int), int, int)); +let member = input "member_by_person" : (int, (int, int)); -- (person, (forum, joined)) -- The circle (one or two hops, not the person), with the request's date. let hop1 = request | map(((rid, who, date), ()) -> (who, (rid, who, date))) diff --git a/interactive/bench/ldbc/authored/plans/ic06.ddp b/interactive/bench/ldbc/authored/plans/ic06.ddp index 87c01c9af..8ee7e15b7 100644 --- a/interactive/bench/ldbc/authored/plans/ic06.ddp +++ b/interactive/bench/ldbc/authored/plans/ic06.ddp @@ -4,13 +4,13 @@ -- those by people in the circle. let request = input 0 : ((int, int, List(int)), ()); -- (rid, person, tag name) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let tag = import "graph::tag" : (int, (List(int), int)); -let by_name = import "graph::tag.by_name" : (List(int), int); -let tagged = import "graph::mtag.by_tag" : (int, int); -- (tag, message) -let tags_of = import "graph::mtag.by_message" : (int, int); -- (message, tag) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let tag = input "tag" : (int, (List(int), int)); +let by_name = input "tag_by_name" : (List(int), int); +let tagged = input "mtag_by_tag" : (int, int); -- (tag, message) +let tags_of = input "mtag_by_message" : (int, int); -- (message, tag) -- The circle: everyone one or two hops from the person, except the person. let hop1 = request | map(((rid, who, _), ()) -> (who, (rid, who))) | join(person, (who, (req, _)) -> (who, req)) diff --git a/interactive/bench/ldbc/authored/plans/ic07.ddp b/interactive/bench/ldbc/authored/plans/ic07.ddp index cae69c2c8..fda7cc8e5 100644 --- a/interactive/bench/ldbc/authored/plans/ic07.ddp +++ b/interactive/bench/ldbc/authored/plans/ic07.ddp @@ -2,11 +2,11 @@ -- how many minutes after it was posted, and whether they are not yet a friend. let request = input 0 : ((int, int), ()); -- (rid, person) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let wrote = import "graph::message.by_creator" : (int, int); -- (author, message) -let likes = import "graph::likes.by_message" : (int, (int, int)); -- (message, (liker, when)) -let pals = import "graph::friend.pair" : ((int, int), ()); -- ((person, friend), ()) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let wrote = input "message_by_creator" : (int, int); -- (author, message) +let likes = input "likes_by_message" : (int, (int, int)); -- (message, (liker, when)) +let pals = input "friend_pair" : ((int, int), ()); -- ((person, friend), ()) -- Each liker's latest like on one of the person's messages (ties: smaller message id). let latest = request | map(((rid, who), ()) -> (who, rid)) diff --git a/interactive/bench/ldbc/authored/plans/ic08.ddp b/interactive/bench/ldbc/authored/plans/ic08.ddp index 063480c89..a7a002138 100644 --- a/interactive/bench/ldbc/authored/plans/ic08.ddp +++ b/interactive/bench/ldbc/authored/plans/ic08.ddp @@ -3,10 +3,10 @@ -- Reaches the replies through the author and parent indexes. let request = input 0 : ((int, int), ()); -- (rid, person) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let wrote = import "graph::message.by_creator" : (int, int); -- (author, message) -let replies = import "graph::message.by_parent" : (int, int); -- (parent, message) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let wrote = input "message_by_creator" : (int, int); -- (author, message) +let replies = input "message_by_parent" : (int, int); -- (parent, message) -- Top k: `reduce` sees a key's values in sort order and keeps the first k (copies capped -- at k), emitting (rank, value). Changes below the top k produce no output. diff --git a/interactive/bench/ldbc/authored/plans/ic09.ddp b/interactive/bench/ldbc/authored/plans/ic09.ddp index 22b5e8c2f..9fced0371 100644 --- a/interactive/bench/ldbc/authored/plans/ic09.ddp +++ b/interactive/bench/ldbc/authored/plans/ic09.ddp @@ -5,9 +5,9 @@ -- their full list. Bodies and names are fetched only for the final 20. let request = input 0 : ((int, int, int), ()); -- (rid, person, max date) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) -- Every message, by author, in recency order (newest first, then smaller id). This -- re-keys the whole message relation, because it is the input to the per-author ranking. diff --git a/interactive/bench/ldbc/authored/plans/ic10.ddp b/interactive/bench/ldbc/authored/plans/ic10.ddp index 55b0b51ce..35109b870 100644 --- a/interactive/bench/ldbc/authored/plans/ic10.ddp +++ b/interactive/bench/ldbc/authored/plans/ic10.ddp @@ -1,16 +1,16 @@ -- IC10. Friend recommendation: friends-of-friends (exactly two hops) born between the -- 21st of the given month and the 22nd of the next, scored by their posts: +1 for each -- post with a tag the person is interested in, -1 for each other post; top 10. --- Kept for all requests (private copies of imports): every person with the name of +-- Kept for all requests (private copies of the graph traces it reads): every person with the name of -- their city, every post keyed by its author, and interests keyed by (person, tag). let request = input 0 : ((int, int, int), ()); -- (rid, person, month) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let place = import "graph::place" : (int, (List(int), List(int), int)); -let tags_of = import "graph::mtag.by_message" : (int, int); -- (message, tag) -let interest = import "graph::interest.by_person" : (int, int); -- (person, tag) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let place = input "place" : (int, (List(int), List(int), int)); +let tags_of = input "mtag_by_message" : (int, int); -- (message, tag) +let interest = input "interest_by_person" : (int, int); -- (person, tag) -- Least hops to each person within two, keeping those at exactly two. let hop1 = request | map(((rid, who, month), ()) -> (who, (rid, who, month))) diff --git a/interactive/bench/ldbc/authored/plans/ic11.ddp b/interactive/bench/ldbc/authored/plans/ic11.ddp index df49d7b81..3661734d6 100644 --- a/interactive/bench/ldbc/authored/plans/ic11.ddp +++ b/interactive/bench/ldbc/authored/plans/ic11.ddp @@ -3,11 +3,11 @@ -- descending; top 10. let request = input 0 : ((int, int, List(int), int), ()); -- (rid, person, country name, before year) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let work = import "graph::work.by_person" : (int, (int, int)); -- (person, (org, since)) -let org = import "graph::org" : (int, (List(int), List(int), int)); -let place = import "graph::place" : (int, (List(int), List(int), int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let work = input "work_by_person" : (int, (int, int)); -- (person, (org, since)) +let org = input "org" : (int, (List(int), List(int), int)); +let place = input "place" : (int, (List(int), List(int), int)); -- The circle: one or two hops from the person, not the person. let hop1 = request | map(((rid, who, country, year), ()) -> (who, (rid, who, country, year))) diff --git a/interactive/bench/ldbc/authored/plans/ic12.ddp b/interactive/bench/ldbc/authored/plans/ic12.ddp index e5f9f95fb..fd26beb40 100644 --- a/interactive/bench/ldbc/authored/plans/ic12.ddp +++ b/interactive/bench/ldbc/authored/plans/ic12.ddp @@ -4,14 +4,14 @@ -- reply keyed by its author (a private copy of `message`). let request = input 0 : ((int, int, List(int)), ()); -- (rid, person, class name) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) -let tag = import "graph::tag" : (int, (List(int), int)); -let by_class = import "graph::tag.by_class" : (int, int); -- (class, tag) -let tagclass = import "graph::tagclass" : (int, (List(int), int)); -let classes = import "graph::tagclass.by_name" : (List(int), int); -- (name, class) -let mtag = import "graph::mtag.by_tag" : (int, int); -- (tag, message) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) +let tag = input "tag" : (int, (List(int), int)); +let by_class = input "tag_by_class" : (int, int); -- (class, tag) +let tagclass = input "tagclass" : (int, (List(int), int)); +let classes = input "tagclass_by_name" : (List(int), int); -- (name, class) +let mtag = input "mtag_by_tag" : (int, int); -- (tag, message) -- Class ancestry: every class is below itself, and below its parent's ancestors. let selves = tagclass | map((id, _) -> ((id, id), ())); diff --git a/interactive/bench/ldbc/authored/plans/ic13.ddp b/interactive/bench/ldbc/authored/plans/ic13.ddp index 584279a78..99a2abb92 100644 --- a/interactive/bench/ldbc/authored/plans/ic13.ddp +++ b/interactive/bench/ldbc/authored/plans/ic13.ddp @@ -3,7 +3,7 @@ -- distance reaches the best meeting found so far. let request = input 0 : ((int, int, int), ()); -- (rid, from, to) -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) -- Searches are rows (rid, side, node, hops): side 0 grows from `from`, side 1 from `to`. let starts = (request | map(((rid, from, _), ()) -> ((rid, 0, from, 0), ()))) diff --git a/interactive/bench/ldbc/authored/plans/ic14.ddp b/interactive/bench/ldbc/authored/plans/ic14.ddp index c779db57a..c016323e4 100644 --- a/interactive/bench/ldbc/authored/plans/ic14.ddp +++ b/interactive/bench/ldbc/authored/plans/ic14.ddp @@ -2,8 +2,8 @@ -- cheap paths, the lexicographically smallest list of people. let request = input 0 : ((int, int, int), ()); -- (rid, from, to) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let pals = import "graph::friend.pair" : ((int, int), ()); -- ((person, friend), ()) +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let pals = input "friend_pair" : ((int, int), ()); -- ((person, friend), ()) -- Interaction weights between friends: replies in either direction are counted per -- pair (n), and a friendship costs max(round(40 - sqrt(n)), 1), computed exactly as diff --git a/interactive/bench/ldbc/authored/plans/is01.ddp b/interactive/bench/ldbc/authored/plans/is01.ddp index 7177805bb..a1580e288 100644 --- a/interactive/bench/ldbc/authored/plans/is01.ddp +++ b/interactive/bench/ldbc/authored/plans/is01.ddp @@ -1,7 +1,7 @@ -- IS1. A person's profile: one lookup in the person primary key. let request = input 0 : ((int, int), ()); -- (rid, person) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); let answer = request | map(((rid, who), ()) -> (who, rid)) | join(person, (_, (rid, (first, last, gender, birthday, created, ip, browser, city, _, _, _))) -> diff --git a/interactive/bench/ldbc/authored/plans/is02.ddp b/interactive/bench/ldbc/authored/plans/is02.ddp index 743943fd5..9c2bc9602 100644 --- a/interactive/bench/ldbc/authored/plans/is02.ddp +++ b/interactive/bench/ldbc/authored/plans/is02.ddp @@ -6,10 +6,10 @@ -- winners' text and their root posts' authors' names. let request = input 0 : ((int, int), ()); -- (rid, person) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let by_creator = import "graph::message.by_creator" : (int, int); -let root_of = import "graph::message.root" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let by_creator = input "message_by_creator" : (int, int); +let root_of = input "message_root" : (int, int); -- The person's messages, newest first (ties by larger id), keeping only ids and times to rank. let mine = request | map(((rid, who), ()) -> (who, rid)) diff --git a/interactive/bench/ldbc/authored/plans/is03.ddp b/interactive/bench/ldbc/authored/plans/is03.ddp index 8da395636..303eef2b6 100644 --- a/interactive/bench/ldbc/authored/plans/is03.ddp +++ b/interactive/bench/ldbc/authored/plans/is03.ddp @@ -1,8 +1,8 @@ -- IS3. A person's friends, with when each friendship was made, newest first. let request = input 0 : ((int, int), ()); -- (rid, person) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) let ranked = request | map(((rid, who), ()) -> (who, rid)) | join(friend, (_, (rid, (f, since))) -> (f, (rid, since))) diff --git a/interactive/bench/ldbc/authored/plans/is04.ddp b/interactive/bench/ldbc/authored/plans/is04.ddp index 62123ee3b..94aea1a78 100644 --- a/interactive/bench/ldbc/authored/plans/is04.ddp +++ b/interactive/bench/ldbc/authored/plans/is04.ddp @@ -1,7 +1,7 @@ -- IS4. A message's creation date and content (or image file, when it has no text). let request = input 0 : ((int, int), ()); -- (rid, message) -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); let answer = request | map(((rid, m), ()) -> (m, rid)) | join(message, (_, (rid, (_, created, _, _, text, image, _, _, _, _, _, _, _))) -> diff --git a/interactive/bench/ldbc/authored/plans/is05.ddp b/interactive/bench/ldbc/authored/plans/is05.ddp index 8eaade3ed..8fb294486 100644 --- a/interactive/bench/ldbc/authored/plans/is05.ddp +++ b/interactive/bench/ldbc/authored/plans/is05.ddp @@ -1,8 +1,8 @@ -- IS5. The author of a message. let request = input 0 : ((int, int), ()); -- (rid, message) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); let answer = request | map(((rid, m), ()) -> (m, rid)) | join(message, (_, (rid, (_, _, who, _, _, _, _, _, _, _, _, _, _))) -> (who, rid)) diff --git a/interactive/bench/ldbc/authored/plans/is06.ddp b/interactive/bench/ldbc/authored/plans/is06.ddp index f0faf5a44..43a428b44 100644 --- a/interactive/bench/ldbc/authored/plans/is06.ddp +++ b/interactive/bench/ldbc/authored/plans/is06.ddp @@ -2,10 +2,10 @@ -- A thread's forum is its root post's: message -> root post -> forum -> moderator. let request = input 0 : ((int, int), ()); -- (rid, message) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let forum = import "graph::forum" : (int, (List(int), int, int)); -let root_of = import "graph::message.root" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let forum = input "forum" : (int, (List(int), int, int)); +let root_of = input "message_root" : (int, int); let answer = request | map(((rid, m), ()) -> (m, rid)) | join(root_of, (_, (rid, root)) -> (root, rid)) diff --git a/interactive/bench/ldbc/authored/plans/is07.ddp b/interactive/bench/ldbc/authored/plans/is07.ddp index ef2260627..e3d7ed0af 100644 --- a/interactive/bench/ldbc/authored/plans/is07.ddp +++ b/interactive/bench/ldbc/authored/plans/is07.ddp @@ -2,10 +2,10 @@ -- message's author. let request = input 0 : ((int, int), ()); -- (rid, message) -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let by_parent = import "graph::message.by_parent" : (int, int); -let friend = import "graph::friend" : (int, (int, int)); -- (person, (friend, since)) +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let by_parent = input "message_by_parent" : (int, int); +let friend = input "friend" : (int, (int, int)); -- (person, (friend, since)) -- The request's replies: ((replier, author of the message), (rid, comment, content, created)). let reply = request | map(((rid, m), ()) -> (m, rid)) diff --git a/interactive/bench/ldbc/bi11.ddp b/interactive/bench/ldbc/bi11.ddp index aa3966f53..2323e97fa 100644 --- a/interactive/bench/ldbc/bi11.ddp +++ b/interactive/bench/ldbc/bi11.ddp @@ -1,8 +1,8 @@ -- BI11: standing request(request_id, country_name, start, end), inclusive dates. -- Count each unordered friendship triangle once; a missing triangle count is 0. let request = input 0 : ((int, List(int), int, int), ()); -let resident = import "graph::resident" : (List(int), int); -let edge = import "graph::edge" : (int, (int, int)); +let resident = input "resident" : (List(int), int); +let edge = input "edge" : (int, (int, int)); let people = request | map(((rid, country, start, end), ()) -> (country, (rid, start, end))) | join(resident, (_, (request, person)) -> (person, request)); let candidates = people | join(edge, (p, ((rid, start, end), (q, created))) -> ((rid, p, q, created, start, end), ())) diff --git a/interactive/bench/ldbc/bi5.ddp b/interactive/bench/ldbc/bi5.ddp index 5603bd17c..6fdeacc99 100644 --- a/interactive/bench/ldbc/bi5.ddp +++ b/interactive/bench/ldbc/bi5.ddp @@ -1,9 +1,9 @@ -- BI5: standing request(request_id, tag_name). Tagged messages and their -- immediate replies/likes contribute 1/2/10 points to the message's author. let request = input 0 : ((int, List(int)), ()); -let tagged = import "graph::tagged" : (int, List(int)); -let message = import "graph::message" : (int, (int, int, int)); -let likes = import "graph::likes" : (int, int); +let tagged = input "tagged" : (int, List(int)); +let message = input "message" : (int, (int, int, int)); +let likes = input "likes" : (int, int); let selected = request | map(((rid, name), ()) -> (name, rid)) | join(tagged | map((m, name) -> (name, m)), (_, (rid, m)) -> (m, rid)) | join(message, (m, (rid, (_, creator, _))) -> ((rid, m, creator), ())) | distinct; diff --git a/interactive/bench/ldbc/client.py b/interactive/bench/ldbc/client.py index 3157f16e9..4a2e8ed1c 100644 --- a/interactive/bench/ldbc/client.py +++ b/interactive/bench/ldbc/client.py @@ -328,14 +328,21 @@ def _exchange(self, commands): return dict(encode_ms=1000*(encoded-start), wire_ms=1000*(end-encoded), bytes_sent=len(wire), bytes_received=received), [replies[rid] for rid in ids] - def load(self, name, program): - """Collect the installed plan’s feed positions and named outputs for seals and trims.""" + def load(self, name, program, providers=('graph',)): + """Collect the installed plan’s fed inputs and named outputs for seals and trims, and bind + each named input to the output of that name, `.` written `_`, of one of `providers`.""" source = re.sub(r'--[^\n]*', '', program) - positions = re.findall(r'\binput(?:\s+(\d+)|\s+"[^"]+")?\s*:', source) - inputs = sorted({int(number) if number else position for position, number in enumerate(positions)}) + inputs = sorted({int(number) for number in re.findall(r'\binput\s+(\d+)', source)}) + bindings = [] + for label in sorted(set(re.findall(r'\binput\s+"([^"]+)"', source))): + found = [f'{p}::{o}' for p in providers if p in self.interfaces + for o in self.interfaces[p][1] if o.replace('.', '_') == label] + if len(found) != 1: + raise ValueError(f'{name}: input "{label}" matches {found or "no output"} of {providers}') + bindings.append(f' {label}={found[0]}') outputs = re.findall(r'\boutput\s+"([^"]+)"', source) self.interfaces[name] = inputs, outputs - return f'load {name} begin\n{program}\n{{rid}} end-load' + return f'load {name}{"".join(bindings)} begin\n{program}\n{{rid}} end-load' def drop(self, name): del self.interfaces[name] diff --git a/interactive/bench/ldbc/ic6.ddp b/interactive/bench/ldbc/ic6.ddp index 691e8c38d..492837c6f 100644 --- a/interactive/bench/ldbc/ic6.ddp +++ b/interactive/bench/ldbc/ic6.ddp @@ -1,9 +1,9 @@ -- IC6: request(request_id, person_id, tag_name). Two-hop tag co-occurrence. -- This explicit plan expands friends and posts before testing the bound tag. let request = input 0 : ((int, int, List(int)), ()); -let edge = import "graph::edge" : (int, (int, int)); -let message = import "graph::message" : (int, (int, int, int)); -let tagged = import "graph::tagged" : (int, List(int)); +let edge = input "edge" : (int, (int, int)); +let message = input "message" : (int, (int, int, int)); +let tagged = input "tagged" : (int, List(int)); -- Reachable rows: (request_id, origin, author, tag_name), deduplicated across paths. let one = request | map(((rid, pid, tag), ()) -> (pid, (rid, tag))) | join(edge, (pid, ((rid, tag), (q, _))) -> ((rid, pid, q, tag), ())); diff --git a/interactive/bench/ldbc/interactive_v2/README.md b/interactive/bench/ldbc/interactive_v2/README.md index 220910b78..954648b79 100644 --- a/interactive/bench/ldbc/interactive_v2/README.md +++ b/interactive/bench/ldbc/interactive_v2/README.md @@ -123,7 +123,7 @@ At 0.005 DDIR's server is saturated with standing plans: about 3.2 of the 4 workers' cores are busy. One-off complex reads (`oneoff/`, below) halve their work; the 0.0025 run was 81% one-off complex reads, 12% short reads and 3% updates. A one-off is installed while updates flow. Since #1024 and #1025 it -reads every import, including the arrangements its half joins read, as of the +reads every bound input, including the arrangements its half joins read, as of the tick it starts, so its answer is that tick's. The 0.0025 row was measured before those changes; on master-next with them (7eb7da8d) it passes again, at 1,049 ops/s, and 0.002 still fails. diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic01.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic01.oneoff.ddp index 386ae2c92..8d9d22912 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic01.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic01.oneoff.ddp @@ -1,12 +1,12 @@ let request = input 0 : ((int, int, List(int)), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let place = import "graph::place" : (int, (List(int), List(int), int)); -let org = import "graph::org" : (int, (List(int), List(int), int)); -let study = import "graph::study.by_person" : (int, (int, int)); -let work = import "graph::work.by_person" : (int, (int, int)); -let email = import "graph::email.by_person" : (int, List(int)); -let language = import "graph::language.by_person" : (int, List(int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let place = input "place" : (int, (List(int), List(int), int)); +let org = input "org" : (int, (List(int), List(int), int)); +let study = input "study_by_person" : (int, (int, int)); +let work = input "work_by_person" : (int, (int, int)); +let email = input "email_by_person" : (int, List(int)); +let language = input "language_by_person" : (int, List(int)); let hop1 = request | map(((rid, who, name), ()) -> (who, (rid, who, name))) | join(friend, (_, (req, (f, _))) -> (f, (req, 1))); let hop2 = hop1 | join(friend, (_, ((req, _), (g, _))) -> (g, (req, 2))); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic02.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic02.oneoff.ddp index 791378c9b..9e276b620 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic02.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic02.oneoff.ddp @@ -1,10 +1,10 @@ let request = input 0 : ((int, int, int), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let by_author = import "ic2s::by_author" : (int, (int, int)); -let latest = import "ic2s::latest" : (int, (int, int)); -let newest = import "ic2s::newest" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let by_author = input "by_author" : (int, (int, int)); +let latest = input "latest" : (int, (int, int)); +let newest = input "newest" : (int, int); let friends = request | map(((rid, who, max), ()) -> (who, (rid, max))) | join(friend, (_, (req, (f, _))) -> (f, req)); let ahead = friends | join(newest, (f, ((rid, max), neg)) -> (f, (rid, max, neg neg))); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic02.standing.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic02.standing.ddp index d2762c287..fcc217b66 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic02.standing.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic02.standing.ddp @@ -1,6 +1,6 @@ -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); let by_author = message | map((id, (_, created, author, _, _, _, _, _, _, _, _, _, _)) -> (author, (created neg, id))); let latest = by_author | reduce((_, vals) -> let positive = (vals map ((_, d) -> (d, 0) gt), (0, vals len) range) zip filter in let indices = ((0, (positive len, 20) min) range, positive) gather in let prefix = (indices, vals) gather in let ends = prefix map ((_, d) -> (d, 20) min) scan_add in let chosen = (prefix, ends) zip map (((item, d), end) -> let count = (d, 20) min in let before = (end, count) sub in let keep = (((20, before) sub, 0) max, count) min in ((keep, 0) gt, (item, keep))) filter in let ends = chosen map ((_, d) -> d) scan_add in (chosen, ends) zip map (((item, d), end) -> (item, ((end, d) sub, end) range) cap_list map ((item, rank) -> ((rank, item), 1))) flatten) | map((author, (_, (neg, id))) -> (author, (neg, id))); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic03.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic03.oneoff.ddp index 17b4070f7..2cc2b5bf0 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic03.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic03.oneoff.ddp @@ -1,10 +1,10 @@ let request = input 0 : ((int, int, List(int), List(int), int, int), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let place = import "graph::place" : (int, (List(int), List(int), int)); -let by_name = import "graph::place.by_name" : (List(int), int); -let sent_from = import "ic3s::sent_from" : (int, (int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let place = input "place" : (int, (List(int), List(int), int)); +let by_name = input "place_by_name" : (List(int), int); +let sent_from = input "sent_from" : (int, (int, int)); let asked = request | map(((rid, who, x, y, start, days), ()) -> (x, (rid, who, y, start, (start, (days, 86400000) mul) add))) | join(by_name, (_, (req, x)) -> (x, req)) | join(place, (x, ((rid, who, y, start, end), (_, kind, _))) -> ((kind, [67,111,117,110,116,114,121]) eq, (y, (rid, who, x, start, end)))) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic03.standing.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic03.standing.ddp index fb5f8b218..b5f65c50d 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic03.standing.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic03.standing.ddp @@ -1,7 +1,7 @@ -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let place = import "graph::place" : (int, (List(int), List(int), int)); -let by_name = import "graph::place.by_name" : (List(int), int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let place = input "place" : (int, (List(int), List(int), int)); +let by_name = input "place_by_name" : (List(int), int); let sent_from = message | map((_, (_, created, author, country, _, _, _, _, _, _, _, _, _)) -> (country, (author, created))); output "sent_from" = sent_from | arrange; diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic04.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic04.oneoff.ddp index a2fadc520..969347cbd 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic04.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic04.oneoff.ddp @@ -1,10 +1,10 @@ let request = input 0 : ((int, int, int, int), ()); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let tag = import "graph::tag" : (int, (List(int), int)); -let mtag = import "graph::mtag.by_tag" : (int, int); -let posts = import "ic4s::posts" : (int, (int, int)); -let tags = import "ic4s::tags" : (int, (int, List(int))); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let tag = input "tag" : (int, (List(int), int)); +let mtag = input "mtag_by_tag" : (int, int); +let posts = input "posts" : (int, (int, int)); +let tags = input "tags" : (int, (int, List(int))); let seen = request | map(((rid, who, start, days), ()) -> (who, (rid, start, (start, (days, 86400000) mul) add))) | join(friend, (_, (req, (f, _))) -> (f, req)) | join(posts, (_, ((rid, start, end), (m, created))) -> (m, (rid, created, start, end))) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic04.standing.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic04.standing.ddp index 10f5db118..0c705b74e 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic04.standing.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic04.standing.ddp @@ -1,7 +1,7 @@ -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let tag = import "graph::tag" : (int, (List(int), int)); -let mtag = import "graph::mtag.by_tag" : (int, int); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let tag = input "tag" : (int, (List(int), int)); +let mtag = input "mtag_by_tag" : (int, int); let posts = message | filter((_, (kind, _, _, _, _, _, _, _, _, _, _, _, _)) -> (kind, 0) eq) | map((id, (_, created, who, _, _, _, _, _, _, _, _, _, _)) -> (who, (id, created))); let tags = mtag | join(tag, (t, (m, (name, _))) -> (m, (t, name))); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic05.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic05.oneoff.ddp index 698413f4e..b740675b6 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic05.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic05.oneoff.ddp @@ -1,12 +1,12 @@ let request = input 0 : ((int, int, int), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let forum = import "graph::forum" : (int, (List(int), int, int)); -let member = import "graph::member.by_person" : (int, (int, int)); -let posted = import "ic5s::posted" : ((int, int), int); -let first = import "ic5s::first" : (int, int); -let lowest = import "ic5s::lowest" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let forum = input "forum" : (int, (List(int), int, int)); +let member = input "member_by_person" : (int, (int, int)); +let posted = input "posted" : ((int, int), int); +let first = input "first" : (int, int); +let lowest = input "lowest" : (int, int); let hop1 = request | map(((rid, who, date), ()) -> (who, (rid, who, date))) | join(person, (who, (req, _)) -> (who, req)) | join(friend, (_, (req, (f, _))) -> (f, req)); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic05.standing.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic05.standing.ddp index 9c91de2ee..5e28cc907 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic05.standing.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic05.standing.ddp @@ -1,8 +1,8 @@ -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let forum = import "graph::forum" : (int, (List(int), int, int)); -let member = import "graph::member.by_person" : (int, (int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let forum = input "forum" : (int, (List(int), int, int)); +let member = input "member_by_person" : (int, (int, int)); let posted = message | filter((_, (kind, _, _, _, _, _, _, _, _, _, _, _, _)) -> (kind, 0) eq) | map((_, (_, _, who, _, _, _, _, _, f, _, _, _, _)) -> ((who, f), ())) | count; let first = member | map((who, (_, since)) -> (who, since)) | min; diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic06.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic06.oneoff.ddp index 7f963db76..3e519cfe2 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic06.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic06.oneoff.ddp @@ -1,11 +1,11 @@ let request = input 0 : ((int, int, List(int)), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let tag = import "graph::tag" : (int, (List(int), int)); -let by_name = import "graph::tag.by_name" : (List(int), int); -let tagged = import "graph::mtag.by_tag" : (int, int); -let tags_of = import "graph::mtag.by_message" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let tag = input "tag" : (int, (List(int), int)); +let by_name = input "tag_by_name" : (List(int), int); +let tagged = input "mtag_by_tag" : (int, int); +let tags_of = input "mtag_by_message" : (int, int); let hop1 = request | map(((rid, who, _), ()) -> (who, (rid, who))) | join(person, (who, (req, _)) -> (who, req)) | join(friend, (_, ((rid, who), (f, _))) -> (f, (rid, who))); let hop2 = hop1 | join(friend, (_, ((rid, who), (g, _))) -> (g, (rid, who))); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic07.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic07.oneoff.ddp index 596764bba..62f19609a 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic07.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic07.oneoff.ddp @@ -1,9 +1,9 @@ let request = input 0 : ((int, int), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let wrote = import "graph::message.by_creator" : (int, int); -let likes = import "graph::likes.by_message" : (int, (int, int)); -let pals = import "graph::friend.pair" : ((int, int), ()); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let wrote = input "message_by_creator" : (int, int); +let likes = input "likes_by_message" : (int, (int, int)); +let pals = input "friend_pair" : ((int, int), ()); let latest = request | map(((rid, who), ()) -> (who, rid)) | join(wrote, (who, (rid, m)) -> (m, (rid, who))) | join(likes, (m, ((rid, who), (liker, when))) -> ((rid, who, liker), (when neg, m))) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic08.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic08.oneoff.ddp index f3b4b973d..97dcce925 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic08.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic08.oneoff.ddp @@ -1,8 +1,8 @@ let request = input 0 : ((int, int), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let wrote = import "graph::message.by_creator" : (int, int); -let replies = import "graph::message.by_parent" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let wrote = input "message_by_creator" : (int, int); +let replies = input "message_by_parent" : (int, int); let top = request | map(((rid, who), ()) -> (who, rid)) | join(wrote, (_, (rid, op)) -> (op, rid)) | join(replies, (_, (rid, id)) -> (id, rid)) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic09.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic09.oneoff.ddp index 06142aea9..8911ba0d1 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic09.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic09.oneoff.ddp @@ -1,10 +1,10 @@ let request = input 0 : ((int, int, int), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let by_author = import "ic9s::by_author" : (int, (int, int)); -let latest = import "ic9s::latest" : (int, (int, int)); -let newest = import "ic9s::newest" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let by_author = input "by_author" : (int, (int, int)); +let latest = input "latest" : (int, (int, int)); +let newest = input "newest" : (int, int); let hop1 = request | map(((rid, who, max), ()) -> (who, (rid, who, max))) | join(person, (who, (req, _)) -> (who, req)) | join(friend, (_, (req, (f, _))) -> (f, req)); let hop2 = hop1 | join(friend, (_, (req, (g, _))) -> (g, req)); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic09.standing.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic09.standing.ddp index ef7a0b64c..ce563ad04 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic09.standing.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic09.standing.ddp @@ -1,6 +1,6 @@ -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); let by_author = message | map((id, (_, created, author, _, _, _, _, _, _, _, _, _, _)) -> (author, (created neg, id))); let latest = by_author | reduce((_, vals) -> let positive = (vals map ((_, d) -> (d, 0) gt), (0, vals len) range) zip filter in let indices = ((0, (positive len, 20) min) range, positive) gather in let prefix = (indices, vals) gather in let ends = prefix map ((_, d) -> (d, 20) min) scan_add in let chosen = (prefix, ends) zip map (((item, d), end) -> let count = (d, 20) min in let before = (end, count) sub in let keep = (((20, before) sub, 0) max, count) min in ((keep, 0) gt, (item, keep))) filter in let ends = chosen map ((_, d) -> d) scan_add in (chosen, ends) zip map (((item, d), end) -> (item, ((end, d) sub, end) range) cap_list map ((item, rank) -> ((rank, item), 1))) flatten) | map((author, (_, (neg, id))) -> (author, (neg, id))); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic10.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic10.oneoff.ddp index eec7a189b..2ab598e94 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic10.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic10.oneoff.ddp @@ -1,13 +1,13 @@ let request = input 0 : ((int, int, int), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let place = import "graph::place" : (int, (List(int), List(int), int)); -let tags_of = import "graph::mtag.by_message" : (int, int); -let interest = import "graph::interest.by_person" : (int, int); -let people = import "ic10s::people" : (int, (List(int), List(int), List(int), List(int), int, int)); -let posts = import "ic10s::posts" : (int, int); -let likes = import "ic10s::likes" : ((int, int), ()); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let place = input "place" : (int, (List(int), List(int), int)); +let tags_of = input "mtag_by_message" : (int, int); +let interest = input "interest_by_person" : (int, int); +let people = input "people" : (int, (List(int), List(int), List(int), List(int), int, int)); +let posts = input "posts" : (int, int); +let likes = input "likes" : ((int, int), ()); let hop1 = request | map(((rid, who, month), ()) -> (who, (rid, who, month))) | join(friend, (_, (req, (f, _))) -> (f, (req, 1))); let hop2 = hop1 | join(friend, (_, ((req, _), (g, _))) -> (g, (req, 2))); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic10.standing.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic10.standing.ddp index b845d360a..a5b35ce30 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic10.standing.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic10.standing.ddp @@ -1,9 +1,9 @@ -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let place = import "graph::place" : (int, (List(int), List(int), int)); -let tags_of = import "graph::mtag.by_message" : (int, int); -let interest = import "graph::interest.by_person" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let place = input "place" : (int, (List(int), List(int), int)); +let tags_of = input "mtag_by_message" : (int, int); +let interest = input "interest_by_person" : (int, int); let people = person | map((id, (first, last, gender, _, _, _, _, home, bmonth, bday, _)) -> (home, (id, first, last, gender, bmonth, bday))) | join(place, (_, ((id, first, last, gender, bmonth, bday), (town, _, _))) -> (id, (first, last, gender, town, bmonth, bday))); let posts = message | filter((_, (kind, _, _, _, _, _, _, _, _, _, _, _, _)) -> (kind, 0) eq) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic11.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic11.oneoff.ddp index a1f40c49e..8797f1895 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic11.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic11.oneoff.ddp @@ -1,9 +1,9 @@ let request = input 0 : ((int, int, List(int), int), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let work = import "graph::work.by_person" : (int, (int, int)); -let org = import "graph::org" : (int, (List(int), List(int), int)); -let place = import "graph::place" : (int, (List(int), List(int), int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let work = input "work_by_person" : (int, (int, int)); +let org = input "org" : (int, (List(int), List(int), int)); +let place = input "place" : (int, (List(int), List(int), int)); let hop1 = request | map(((rid, who, country, year), ()) -> (who, (rid, who, country, year))) | join(person, (who, (req, _)) -> (who, req)) | join(friend, (_, (req, (f, _))) -> (f, req)); diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic12.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic12.oneoff.ddp index 00671b5ea..e0c5a3376 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic12.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic12.oneoff.ddp @@ -1,14 +1,14 @@ let request = input 0 : ((int, int, List(int)), ()); -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let tag = import "graph::tag" : (int, (List(int), int)); -let by_class = import "graph::tag.by_class" : (int, int); -let tagclass = import "graph::tagclass" : (int, (List(int), int)); -let classes = import "graph::tagclass.by_name" : (List(int), int); -let mtag = import "graph::mtag.by_tag" : (int, int); -let below_hl = import "ic12s::below_hl" : (int, int); -let reply = import "ic12s::reply" : (int, (int, int)); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let tag = input "tag" : (int, (List(int), int)); +let by_class = input "tag_by_class" : (int, int); +let tagclass = input "tagclass" : (int, (List(int), int)); +let classes = input "tagclass_by_name" : (List(int), int); +let mtag = input "mtag_by_tag" : (int, int); +let below_hl = input "below_hl" : (int, int); +let reply = input "reply" : (int, (int, int)); let intag = request | map(((rid, _, name), ()) -> (name, rid)) | join(classes, (_, (rid, high)) -> (high, rid)) | join(below_hl, (_, (rid, low)) -> (low, rid)) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic12.standing.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic12.standing.ddp index 16ff8b603..079cc2aa2 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic12.standing.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic12.standing.ddp @@ -1,11 +1,11 @@ -let person = import "graph::person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let friend = import "graph::friend" : (int, (int, int)); -let tag = import "graph::tag" : (int, (List(int), int)); -let by_class = import "graph::tag.by_class" : (int, int); -let tagclass = import "graph::tagclass" : (int, (List(int), int)); -let classes = import "graph::tagclass.by_name" : (List(int), int); -let mtag = import "graph::mtag.by_tag" : (int, int); +let person = input "person" : (int, (List(int), List(int), List(int), int, int, List(int), List(int), int, int, int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let friend = input "friend" : (int, (int, int)); +let tag = input "tag" : (int, (List(int), int)); +let by_class = input "tag_by_class" : (int, int); +let tagclass = input "tagclass" : (int, (List(int), int)); +let classes = input "tagclass_by_name" : (List(int), int); +let mtag = input "mtag_by_tag" : (int, int); let selves = tagclass | map((id, _) -> ((id, id), ())); below: { let step = below | map(((low, high), ()) -> (high, low)) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic13.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic13.oneoff.ddp index 2f149a9ac..9fa28fc6b 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic13.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic13.oneoff.ddp @@ -1,5 +1,5 @@ let request = input 0 : ((int, int, int), ()); -let friend = import "graph::friend" : (int, (int, int)); +let friend = input "friend" : (int, (int, int)); let starts = (request | map(((rid, from, _), ()) -> ((rid, 0, from, 0), ()))) + (request | map(((rid, _, to), ()) -> ((rid, 1, to, 0), ()))); search: { diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic14.oneoff.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic14.oneoff.ddp index a2ee15c66..c8d9f6975 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic14.oneoff.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic14.oneoff.ddp @@ -1,7 +1,7 @@ let request = input 0 : ((int, int, int), ()); -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let pals = import "graph::friend.pair" : ((int, int), ()); -let weighted = import "ic14s::weighted" : (int, (int, int)); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let pals = input "friend_pair" : ((int, int), ()); +let weighted = input "weighted" : (int, (int, int)); let starts = request | map(((rid, from, _), ()) -> ((rid, from), 0)); dist: { let grow = dist | map(((rid, node, cost), ()) -> (node, (rid, cost))) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/ic14.standing.ddp b/interactive/bench/ldbc/interactive_v2/oneoff/ic14.standing.ddp index 093ee18ed..d0f9fb861 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/ic14.standing.ddp +++ b/interactive/bench/ldbc/interactive_v2/oneoff/ic14.standing.ddp @@ -1,5 +1,5 @@ -let message = import "graph::message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); -let pals = import "graph::friend.pair" : ((int, int), ()); +let message = input "message" : (int, (int, int, int, int, List(int), List(int), int, List(int), int, int, int, int, int)); +let pals = input "friend_pair" : ((int, int), ()); let answered = message | filter((_, (kind, _, _, _, _, _, _, _, _, _, _, _, _)) -> (kind, 1) eq) | map((_, (_, _, who, _, _, _, _, _, _, parent, _, _, _)) -> (parent, who)) | join(message, (_, (who, (_, _, to, _, _, _, _, _, _, _, _, _, _))) -> (who, to)) diff --git a/interactive/bench/ldbc/interactive_v2/oneoff/split.py b/interactive/bench/ldbc/interactive_v2/oneoff/split.py index 477538c45..fdadea884 100644 --- a/interactive/bench/ldbc/interactive_v2/oneoff/split.py +++ b/interactive/bench/ldbc/interactive_v2/oneoff/split.py @@ -1,7 +1,9 @@ """Writes .standing.ddp and .oneoff.ddp here. Split an authored plan into a standing program (binding-independent statements, published) -and a one-off program (the request and everything that depends on it, importing those).""" +and a one-off program (the request and everything that depends on it, reading those). +A one-off's named inputs are bound at load: the graph's to `graph::`, and the standing +program's to `s::`.""" import re, sys from pathlib import Path HERE = Path(__file__).resolve().parent @@ -47,7 +49,7 @@ def split(plan): for a, b in edits: text = text.replace(a, b) if plan != 'ic12' else text.replace('join(' + a, 'join(' + b) stmts = statements(text) - imports = [s for s in stmts if re.match(r'let\s+\w+\s*=\s*import', s)] + imports = [s for s in stmts if re.match(r'let\s+\w+\s*=\s*input\s+"', s)] request = [s for s in stmts if re.match(r'let\s+request\s*=\s*input', s)] exports = [s for s in stmts if s.startswith('export')] body = [s for s in stmts if s not in imports + request + exports] @@ -56,7 +58,7 @@ def split(plan): oneoff = [s for s in body if s not in standing] p = plan[:2] + str(int(plan[2:])) st = imports + standing + [f'output "{n}" = {n} | arrange;' for n in standing_names] - oo = request + imports + [f'let {n} = import "{p}s::{n}" : {t};' for n, t in standing_names.items()] + oneoff + exports + oo = request + imports + [f'let {n} = input "{n}" : {t};' for n, t in standing_names.items()] + oneoff + exports return '\n'.join(st) + '\n', '\n'.join(oo) + '\n' for plan in SPEC: diff --git a/interactive/bench/ldbc/interactive_v2/systems.py b/interactive/bench/ldbc/interactive_v2/systems.py index a1b601e3f..e0a6e36f8 100644 --- a/interactive/bench/ldbc/interactive_v2/systems.py +++ b/interactive/bench/ldbc/interactive_v2/systems.py @@ -100,7 +100,7 @@ def __init__(self, args, graph): *(f'trim {trace} {self.server.epoch}' for trace in (*self.server.output_traces, *self.server.diagnostics))]) self.server.epoch += 1 # Plans answered one-off: each read installs its own copy of the plan's one-off half, - # which imports what the standing half publishes, and drops it at the next tick. + # which reads what the standing half publishes, and drops it at the next tick. self.oneoff = {} oneoff_dir = getattr(args, 'oneoff_dir', None) for name in getattr(args, 'oneoff', None) or []: @@ -237,7 +237,7 @@ def tick(self, updates, reads): if read.plan in self.oneoff: target = f'{read.plan}x{self.rid}' text = self.oneoff[read.plan] - loads.append(self.server.load(target, text)) + loads.append(self.server.load(target, text, providers=('graph', f'{read.plan}s'))) commands.append(self.server.feed(target, 0, rows, 1, self.shapes[read.plan], epoch=self.server.epoch)) live.append((target, rows)) rids.append(self.rid) diff --git a/interactive/bench/ldbc/is3.ddp b/interactive/bench/ldbc/is3.ddp index a7218940f..3638f3142 100644 --- a/interactive/bench/ldbc/is3.ddp +++ b/interactive/bench/ldbc/is3.ddp @@ -1,7 +1,7 @@ -- IS3: request(request_id, person_id). Full friend list, newest friendship first. let request = input 0 : ((int, int), ()); -let edge = import "graph::edge" : (int, (int, int)); -let person = import "graph::person" : (int, (List(int), List(int), int)); +let edge = input "edge" : (int, (int, int)); +let person = input "person" : (int, (List(int), List(int), int)); let friends = request | map(((rid, pid), ()) -> (pid, rid)) | join(edge, (_, (rid, (q, created))) -> (q, (rid, created))) | join(person, (q, ((rid, created), (first, last, _))) -> (rid, (created neg, q, first, last))); diff --git a/interactive/bench/ldbc/snb/indexes.py b/interactive/bench/ldbc/snb/indexes.py index ee4489e8c..90d0bd8cf 100644 --- a/interactive/bench/ldbc/snb/indexes.py +++ b/interactive/bench/ldbc/snb/indexes.py @@ -59,20 +59,21 @@ def binders(schema): return ['typ' if n == 'type' else n for n in schema] -def import_rows(name): - """DDP for a source relation's rows, `((fields...), ())`, from its published arrangement.""" +def input_rows(name): + """DDP for a source relation's rows, `((fields...), ())`, from its published arrangement. + The input's label is the graph output's name with `.` written `_`, and a load binds it.""" schema = SCHEMA[name] fields = list(schema) b = binders(schema) if name in PRIMARY: rest = fields[1:] - return (f'(import "graph::{name}" : (int, {shape(rest, schema)}) ' + return (f'(input "{name}" : (int, {shape(rest, schema)}) ' f'| map(({b[0]}, ({", ".join(b[1:])})) -> (({", ".join(b)}), ())))') first = INDEXES[name][0] assert first == fields[0], name rest = fields[1:] value = f'({", ".join(b[1:])})' if len(rest) > 1 else b[1] - return (f'(import "graph::{name}.by_{first}" : ({SHAPE[schema[first]]}, {shape(rest, schema) if len(rest) > 1 else SHAPE[schema[rest[0]]]}) ' + return (f'(input "{name}_by_{first}" : ({SHAPE[schema[first]]}, {shape(rest, schema) if len(rest) > 1 else SHAPE[schema[rest[0]]]}) ' f'| map(({b[0]}, {value}) -> (({", ".join(b)}), ())))') diff --git a/interactive/bench/ldbc/snb/rel.py b/interactive/bench/ldbc/snb/rel.py index ba1e409a6..7c83090d1 100644 --- a/interactive/bench/ldbc/snb/rel.py +++ b/interactive/bench/ldbc/snb/rel.py @@ -304,8 +304,8 @@ def keyed(source, fields, keys, keep=True): if op == 'source': self.inputs.append((args[0],args[1])) if self.imports and args[0] != 'request': - from .indexes import import_rows - code = import_rows(args[0]) + from .indexes import input_rows + code = input_rows(args[0]) else: code = f'input {0 if self.imports else len(self.inputs)-1} : ({source_shape(args[1])}, ())' elif op == 'select': diff --git a/interactive/bench/txn/README.md b/interactive/bench/txn/README.md index 9f7a9dd9e..bd69f16c2 100644 --- a/interactive/bench/txn/README.md +++ b/interactive/bench/txn/README.md @@ -25,7 +25,7 @@ resolver's joins, `min`, and recursion, and then comes back out. **One-off** ([`store.ddp`](store.ddp), [`resolve.ddp`](resolve.ddp)). The store is its own program: `(key, (txn id, value))`. Each epoch installs a resolver -that imports it, takes only that epoch's intents, and exports `rollback` and +whose input `store` is bound to it (`store=store::store`), takes only that epoch's intents, and exports `rollback` and `delta` (each written key's latest committed write in, its prior store row out). The client reads `rollback`, runs `feed store 0 time=now from res::delta`, and drops the resolver. Nothing the resolver holds is ever retracted. Imports arrive as diff --git a/interactive/bench/txn/bench_txn.py b/interactive/bench/txn/bench_txn.py index e85911da4..d2e8b2ea2 100644 --- a/interactive/bench/txn/bench_txn.py +++ b/interactive/bench/txn/bench_txn.py @@ -130,8 +130,9 @@ def request(self, command: str) -> tuple[list[str], float]: data, _ = self._exchange(reqid, f"{reqid} {command}\n") return data, (time.perf_counter() - start) * 1000.0 - def load(self, name: str, program: Path) -> float: - return self.request(f"load {name} from {program}")[1] + def load(self, name: str, program: Path, bindings: str = "") -> float: + """Install `program`; `bindings` is `label=trace ...`, binding its named inputs.""" + return self.request(f"load {name} from {program} {bindings}".rstrip())[1] def drop(self, name: str) -> float: return self.request(f"drop {name}")[1] @@ -365,7 +366,7 @@ def run_cycle( for trace in (*exports, *client.diagnostics): maintain_ms += client.request(f"trim {trace} {epoch + 1}")[1] else: - install_ms = client.load("res", resolver) + install_ms = client.load("res", resolver, "store=store::store") submit_ms = client.feed("res", transactions, epoch) resolve_ms = client.request(f"seal store 0 {epoch + 1}")[1] resolve_ms += client.request(f"seal res 0 {epoch + 1}")[1] diff --git a/interactive/bench/txn/resolve.ddp b/interactive/bench/txn/resolve.ddp index 837d29012..bf3f16727 100644 --- a/interactive/bench/txn/resolve.ddp +++ b/interactive/bench/txn/resolve.ddp @@ -10,7 +10,7 @@ -- the store's prior row for that key out. `feed store 0 time=now from res::delta` applies it. -- Nothing this program holds is ever retracted; dropping it frees it. -let store = import "store::store" : (int, (int, int)); +let store = input "store" : (int, (int, int)); let intents = input 0 : ((int, int, int), int); -- ((rid, k), expected) and ((wid, k), v) diff --git a/interactive/bench/txn/resolve_by_key.ddp b/interactive/bench/txn/resolve_by_key.ddp index 7be348b37..c86468c35 100644 --- a/interactive/bench/txn/resolve_by_key.ddp +++ b/interactive/bench/txn/resolve_by_key.ddp @@ -4,7 +4,7 @@ -- with the group's writes (`cap_list`), keeps the latest write before the read, -- and emits the reads it contradicts. Same input, exports, and answers. -let store = import "store::store" : (int, (int, int)); +let store = input "store" : (int, (int, int)); let intents = input 0 : ((int, int, int), int); let reads = intents | filter(((_, r, _), _) -> (r, 1) eq) | map(((rid, _, k), e) -> ((rid, k), e)); diff --git a/interactive/examples/server/README.md b/interactive/examples/server/README.md index a91809abd..3b1683e12 100644 --- a/interactive/examples/server/README.md +++ b/interactive/examples/server/README.md @@ -5,7 +5,7 @@ A live instance that hosts interpreted DDIR dataflows in one running timely computation and lets them **share results by name**. You install dataflows one -at a time; each may `import` traces other dataflows `output`, so a +at a time; a load may bind a dataflow's inputs to traces other dataflows `output`, so a consumer maintains a computation incrementally over a producer's output. It is the interpreter-driven successor to the old `dd_server` crate (which hot-loaded compiled `.so`s); here "install" means render a DDIR program, not `dlopen`. @@ -18,9 +18,9 @@ and the configuration). The session scripts here are piped into its stdin. ## Two kinds of file (don't mix them up) - **`programs/*.ddp`** — DDIR *programs*: dataflow definitions you `load`. - The ones here are server-oriented (they use `import`/`output`); the programs - in `../programs/` read positional `input`s instead, which you fill with - `feed` (see "Running a program in batch" below). + The ones here are server-oriented (their named inputs are bound to other programs' + outputs at load); the programs in `../programs/` read numbered `input`s, which you + fill with `feed` (see "Running a program in batch" below). - **`sessions/*.txt`** — *command scripts*: a stream of server commands (`load`/`feed`/`seal`/…) you hand to the server. You do **not** `load` a session; you run the server *on* it. @@ -46,7 +46,7 @@ Every response line starts with the request's id (`_7 ok …`, `_7 data …`, | command | effect | |---|---| -| `load from [= ...] [explain=[,debug]]` | parse + lower + install a program file under ``, its named inputs (or imports) bound to published traces; optionally after the explanation rewrite (`load begin … end-load` takes the program inline) | +| `load from [