From 6c28fc696938530df478f1c82caeb415040e7b87 Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 22 Oct 2026 18:23:14 +0000 Subject: [PATCH 1/2] test(dag-viewer): update three viewer assertions the planner's newer plans made stale #855 made example 1 select the shared Scan/TimeRange plan from L3, and q3-q5 in the seed-862 plan share one SummaryMerge. #884 searches the seed-862 workload as one component. The viewer renders these documents correctly; the assertions still expected the older plans. --- tools/dag-viewer/test_viewer.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/dag-viewer/test_viewer.py b/tools/dag-viewer/test_viewer.py index 5599876d7..045cae968 100644 --- a/tools/dag-viewer/test_viewer.py +++ b/tools/dag-viewer/test_viewer.py @@ -561,7 +561,9 @@ def test_queries_show_recurrence_and_predictability(self): def test_search_header_groups_discards_by_cause(self): text = self.js.call("searchText", self.doc) self.assertIn("default search · ", text) - self.assertIn("2 independent components searched separately", text) + # All nine queries can share nodes, so the search is one component and + # the header has no component count. + self.assertNotIn("independent components", text) self.assertIn("discarded before composition: no accuracy guarantee ×7 (q3, q4, q5, q6, q7) · ", text) self.assertIn("Stage 2 assignments skipped: they scan raw data at query time", text) @@ -652,13 +654,13 @@ def test_an_expanded_chain_shows_each_pane_with_its_time_range_shift_and_window( def test_each_node_lists_the_queries_reaching_it_and_shared_nodes_say_so(self): elements = self.elements() - # The quantile queries q3-q5 share one scan, one pane chain of - # DDSketches; q3 and q4 also share its merge. + # The quantile queries q3-q5 read the same 100 s window of one + # per-series DDSketch pane chain, so they share its scan and merge. scans = [e for e in lane_nodes(elements) if e["data"]["kind"] == "Scan"] shared = next(e for e in scans if e["data"]["reachedBy"] == ["q3", "q4", "q5"]) self.assertIn("shared ×3", shared["data"]["label"]) - merge = next(e for e in lane_nodes(elements) if e["data"]["kind"] == "SummaryMerge" and e["data"]["reachedBy"] == ["q3", "q4"]) - self.assertIn("shared ×2", merge["data"]["label"]) + merge = next(e for e in lane_nodes(elements) if e["data"]["kind"] == "SummaryMerge" and e["data"]["reachedBy"] == ["q3", "q4", "q5"]) + self.assertIn("shared ×3", merge["data"]["label"]) root = self.node(elements, f"n{self.dag['roots'][8]}") self.assertEqual(root["data"]["reachedBy"], ["q9"]) self.assertNotIn("shared", root["data"]["label"]) @@ -846,7 +848,10 @@ def test_doc_parameter_opens_one_document_with_the_selected_plan(self): self.assertIn("Candidates per stage", self.text(js, "counts")) self.assertIn("✓ selected", self.text(js, "lane2-meta")) self.assertEqual(js.eval("__els.pick2.value"), selected) - self.assertEqual(js.eval("__els.pick1.value"), "L1") + # Lane 1 shows the Stage 1 candidate the selected plan came from. + from_logical = next(c["from_logical"] for c in example1()["stage2_physical_asap_optimization"]["candidates"] if c["id"] == selected) + self.assertEqual(from_logical, "L3") + self.assertEqual(js.eval("__els.pick1.value"), from_logical) combinations = example1()["stage1_logical_asap_optimization"]["combinations"] rank_meta = js.eval("__els['rank-meta'].textContent") self.assertIn(f"{combinations} candidates", rank_meta) From 134f600a419c3faaed6e163ca8e44ff42aba255d Mon Sep 17 00:00:00 2001 From: zzylol <50204836+zzylol@users.noreply.github.com> Date: Thu, 22 Oct 2026 18:25:40 +0000 Subject: [PATCH 2/2] test(dag-viewer): state why seed-862 is searched as one component --- tools/dag-viewer/test_viewer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/dag-viewer/test_viewer.py b/tools/dag-viewer/test_viewer.py index 045cae968..973d5f397 100644 --- a/tools/dag-viewer/test_viewer.py +++ b/tools/dag-viewer/test_viewer.py @@ -561,8 +561,9 @@ def test_queries_show_recurrence_and_predictability(self): def test_search_header_groups_discards_by_cause(self): text = self.js.call("searchText", self.doc) self.assertIn("default search · ", text) - # All nine queries can share nodes, so the search is one component and - # the header has no component count. + # The components' combined plan is not in the joint search space, so + # the workload is searched as one and the header has no component count. + self.assertEqual(self.doc["stage3_plan_selection"]["search"]["searched_as_one"], "not_in_joint_space") self.assertNotIn("independent components", text) self.assertIn("discarded before composition: no accuracy guarantee ×7 (q3, q4, q5, q6, q7) · ", text) self.assertIn("Stage 2 assignments skipped: they scan raw data at query time", text)