GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [dbsp] Count the runs of a nested circuit that get no input by anandbraman · Pull Request #7743 · feldera/feldera Conversation
|
| Metric | Meaning (per worker) |
|---|---|
subcircuit_runs_count |
Runs of the nested circuit, one per parent step |
subcircuit_runs_with_input_count |
Runs in which at least one import was not empty |
subcircuit_runs_input_unknown_count |
Runs in which an import could not tell if its value was empty |
How:
ImportOperator::imported_empty() reports if the last imported value was empty. The default is None.Delta0 records val.is_zero(), and ImportAccumulator (the import of non_incremental circuits) records val.is_empty(), on each import. Delta0NonIterative keeps the default: it has no callers, and its D: Clone bound has no emptiness test.ChildNode::eval classifies each run after it runs the import nodes, and ChildNode::metadata reports the counts.AggregationMode.Max), like steps_count, instead of adding them up over the workers.The counters do not change what the circuit computes or when it runs.
A non_incremental circuit is also run once per parent step, but it only collects its input until the step in which the input is complete. The description of subcircuit_runs_count says so.
New tests in operator::dynamic::recursive::test::run_stats. Each builds a nested circuit over edges and, next to it, a chain of 8 joins over facts, so that a commit takes several root steps. Each measures root steps, inner steps (from scheduler events) and the new counters for each commit, with 1 and 4 workers. Run them with --nocapture to see the tables.
| Test | Nested circuit | Checks |
|---|---|---|
recursion_runs_at_every_root_step |
Transitive closure, imported with delta0 |
runs = root steps; runs with input only when edges changed; no unknown runs |
opaque_import_counts_runs_as_unknown |
The same closure, imported with an operator that keeps the default imported_empty |
every run counts as unknown, none as with input |
non_incremental_runs_at_every_root_step |
non_incremental circuit |
runs = root steps; runs with input only when edges changed; no unknown runs |
Results for recursion_runs_at_every_root_step with 4 workers (debug build), before and after merging main with 2fbe60d (#7745, a receiver finishes its flush in the step of the last flush):
| Transaction | Root steps, before → after | Runs | Runs with input (max over workers) | Inner steps per run, before → after |
|---|---|---|---|---|
| facts only | 7 to 9 → 1 | = root steps | 0 | about 3 → 2 |
| empty | 8 to 9 → 1 | = root steps | 0 | about 3 → 2 |
| edges only | 9 → 1 | = root steps | 1 | about 9.4 → 23 to 25 (one run does all the work) |
With 1 worker, every commit took 1 root step and 1 run before and after. After the merge, a commit that does not touch the recursion's input still runs it once, with no input on any worker (#7744).
The test asserts today's behavior: the nested circuit runs once per root step. A change that skips runs without input must update the test.
Checks:
Delta0 always reports "empty"; the run count counts only runs with input; ImportAccumulator keeps the default). The tests failed each time.cargo test -p dbsp --lib -- recursive nonlinear_recursion profile delta0 non_incremental: 67 passed.profile.test.ts passes (179 tests) under the Bun runtime. With the old profile.ts, the new mode(...) assertions fail. Under Node 20 the file does not load (entries().map needs iterator helpers); regionSize.test.ts and viewport.test.ts fail the same way with and without this change.cargo clippy -p dbsp --lib --tests -- -D warnings and cargo fmt: clean. The pre-commit hooks passed.Mark if you think the answer is yes for any of these components:
None. The profile metric catalog gets three new entries.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
A nested circuit runs to a fixed point once in every step of its parent, also when none of its imports has data. In transaction mode one commit takes several root steps, so a recursive view can run many times per commit with nothing to do. The circuit profile shows the steps and the runtime of the nested circuit, but not how many of its runs had input. Add three counters to each nested circuit node, reported in the circuit profile: - subcircuit_runs_count: runs, one per parent step. - subcircuit_runs_with_input_count: runs in which at least one import was not empty on this worker. - subcircuit_runs_input_unknown_count: runs in which an import could not tell if its value was empty. An import operator now reports if its last imported value was empty (`ImportOperator::imported_empty`). `Delta0` implements it; other import operators report that they cannot tell. Add a test that measures runs, runs with input, and root and inner steps per commit for a transitive closure next to a chain of joins, with 1 and 4 workers. Signed-off-by: Anand Raman <[email protected]>
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
What I ran:
The table I got matches the PR description: runs = root steps, and 0 runs with input for "facts only" and "empty".
Otherwise LGTM once the profiler aggregation is fixed (see the inline comment). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Review fixes for the nested circuit run counters: - `ImportAccumulator`, the import of `non_incremental` circuits, now reports if its imported batch was empty. Before, every run of such a circuit counted as a run with unknown input. - profiler-lib takes the largest reading of the three run counts, like `steps_count`, instead of adding them up over the workers. - The description of `subcircuit_runs_count` says that a non-incremental circuit only collects its input until it is complete. - New tests: an import that cannot tell if its input was empty, and a non-incremental circuit. Signed-off-by: Anand Raman <[email protected]>
…le-run-counter # Conflicts: # crates/dbsp/src/circuit/metadata.rs
…le-run-counter # Conflicts: # js-packages/profiler-lib/src/profile.ts
At least 1 approving review is required to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.