Skip to content

Commit 00002b8

Browse files
lmeyerovclaude
andcommitted
test(gfql): engagement pins from the 7-mode routes-off replay carry the route_engaged marker
Replay at the harness head (scratchpad ledger kept under reviews/2054/): every remaining single-route id was an engagement pin (a served spy, a trace or a lane-specific explain step) or the #2058 dtype class; the all-off residue adds four combined-route engagement pins and the #2034 duplicate-id case. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QztW7jYsDd66e8rb8pJNQA
1 parent 2c75c3b commit 00002b8

19 files changed

Lines changed: 215 additions & 1 deletion

graphistry/tests/compute/gfql/cypher/test_lowering.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18626,6 +18626,7 @@ def test_t6_col_stats_decisions_are_visible_in_the_trace() -> None:
1862618626
outcomes={"nodes.id": "served", "edges.s": "served"})
1862718627

1862818628

18629+
@pytest.mark.route_engaged("cypher-fast")
1862918630
def test_t6_assert_col_stats_helper_fails_loudly() -> None:
1863018631
"""The helper must FAIL when the optimization did not fire -- an engagement
1863118632
pin that cannot fail is worse than none, which is the whole failure mode
@@ -19225,6 +19226,7 @@ def _mk_h3_case_data(fixture: str) -> Tuple[pd.DataFrame, pd.DataFrame]:
1922519226
raise AssertionError(f"unknown fixture {fixture}")
1922619227

1922719228

19229+
@pytest.mark.route_engaged("cypher-fast")
1922819230
@pytest.mark.parametrize("engine", ["polars", "polars-gpu"])
1922919231
@pytest.mark.parametrize("label,fixture,query", _H3_DIFFERENTIAL_CASES, ids=[c[0] for c in _H3_DIFFERENTIAL_CASES])
1923019232
def test_h3_fused_two_hop_count_matches_eager_twin_and_pandas(
@@ -19249,6 +19251,7 @@ def test_h3_fused_two_hop_count_matches_eager_twin_and_pandas(
1924919251
assert fused == oracle, f"{label}: fused lane diverged from the pandas oracle"
1925019252

1925119253

19254+
@pytest.mark.route_engaged("cypher-fast")
1925219255
@pytest.mark.parametrize("engine", ["polars", "polars-gpu"])
1925319256
def test_h3_fused_two_hop_count_empty_match_counts_zero(engine: str, monkeypatch: pytest.MonkeyPatch) -> None:
1925419257
"""openCypher counts over no rows as 0 -- not an empty frame."""
@@ -19359,6 +19362,7 @@ def test_h3_two_hop_count_fast_path_has_no_order_by_or_limit_surface(suffix: str
1935919362
assert _two_hop_count_alias(compiled.chain) == expect_alias
1936019363

1936119364

19365+
@pytest.mark.route_engaged("cypher-fast")
1936219366
@pytest.mark.parametrize("engine", ["polars", "polars-gpu"])
1936319367
def test_h3_fused_two_hop_count_handles_degenerate_bindings(engine: str, monkeypatch: pytest.MonkeyPatch) -> None:
1936419368
"""The node key may share a name with an endpoint column, and source/destination may be bound

graphistry/tests/compute/gfql/index/test_degree_consult.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def test_identity_anchors_to_the_bound_frame_not_the_partition() -> None:
102102
assert fact.source_ref is g._edges
103103

104104

105+
@pytest.mark.route_engaged("cypher-fast")
105106
@pytest.mark.parametrize("engine", ENGINES)
106107
@pytest.mark.parametrize("n_p,n_c", [(3, 3), (5, 1), (2, 8), (7, 2)])
107108
def test_slice_is_exact_across_domain_shapes(n_p: int, n_c: int, engine: str) -> None:
@@ -117,6 +118,7 @@ def test_slice_is_exact_across_domain_shapes(n_p: int, n_c: int, engine: str) ->
117118
assert value == oracle
118119

119120

121+
@pytest.mark.route_engaged("cypher-fast")
120122
def test_gapped_node_space_builds_facts_and_stays_exact() -> None:
121123
"""Density is NOT required for the degree arrays: ids absent from the span
122124
contribute ZERO to the dot, so a gapped node space builds valid facts. (The
@@ -137,6 +139,7 @@ def test_gapped_node_space_builds_facts_and_stays_exact() -> None:
137139
assert used, "P-domain [0,2] is dense, so the kernel must consult the fact"
138140

139141

142+
@pytest.mark.route_engaged("cypher-fast")
140143
@pytest.mark.parametrize("seed", range(6))
141144
def test_differential_vs_the_scan_on_random_typed_graphs(seed: int) -> None:
142145
"""Values must be identical with and without the fact, on arbitrary degree

graphistry/tests/compute/gfql/index/test_index.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,7 @@ def _polars_indexed_graph():
14651465
return g.gfql_index_all(engine="polars")
14661466

14671467

1468+
@pytest.mark.route_engaged("index-hop")
14681469
def test_auto_engine_gfql_serves_polars_index_1767_cliff():
14691470
"""#1767 cliff pin: polars frames + explicit polars index + gfql with NO engine
14701471
argument must serve path=index on engine=polars (AUTO routes native, so the
@@ -1701,6 +1702,7 @@ def test_col_stats_auto_narrows_lazy_frames(self):
17011702
gi = gl.gfql_index_col_stats() # AUTO on lazy frames must not crash
17021703
assert gi is not None
17031704

1705+
@pytest.mark.route_engaged("index-hop")
17041706
def test_inversion_auto_index_auto_gfql_serves_polars_index(self):
17051707
"""THE INVERSION PIN. The exact scenario the retracted #1767 regressed
17061708
to the scan floor: ``gfql_index_all()`` with NO engine + ``g.gfql(<index-

graphistry/tests/compute/gfql/index/test_index_gpu_edge_match.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def _match_value(null_col_dtype: str):
8585
return {"string": "1", "boolean": True}.get(null_col_dtype, 1)
8686

8787

88+
@pytest.mark.route_engaged("index-hop")
8889
@pytest.mark.parametrize("engine", ["cudf", "polars-gpu"])
8990
@pytest.mark.parametrize("null_col_dtype", NULL_DTYPES)
9091
def test_null_bearing_edge_predicate_matches_the_pandas_oracle_on_device(engine, null_col_dtype):
@@ -110,6 +111,7 @@ def pairs(gg):
110111
assert pairs(got) == pairs(oracle), f"[{engine}/{null_col_dtype}] diverged from pandas"
111112

112113

114+
@pytest.mark.route_engaged("index-hop")
113115
@pytest.mark.parametrize("engine", ["cudf", "polars-gpu"])
114116
def test_empty_candidate_batch_on_device(engine):
115117
"""A seed with no matching typed edges yields a zero-length gather map on device."""

graphistry/tests/compute/gfql/index/test_indexed_bindings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ def test_connected_path_bag_trace_and_lifecycle(
405405
]
406406

407407

408+
@pytest.mark.route_engaged("indexed-kernel")
408409
@pytest.mark.parametrize("engine", ENGINES)
409410
@pytest.mark.parametrize("query", STANDARD_DERIVED_POSITIVES)
410411
def test_standard_derived_connected_parity(
@@ -454,6 +455,7 @@ def unexpected_traversal(*args: Any, **kwargs: Any) -> Any:
454455
_assert_decision(decisions[0], seam="connected_bindings", served=True)
455456

456457

458+
@pytest.mark.route_engaged("cypher-fast")
457459
@pytest.mark.parametrize("engine", ENGINES)
458460
def test_destination_property_projection_dtype_parity(
459461
engine: str,
@@ -726,6 +728,7 @@ def test_node_property_index_prefers_the_most_selective_column(
726728
pytest.param({"grp": 0}, "grp", False, id="unselective-keeps-scan"),
727729
],
728730
)
731+
@pytest.mark.route_engaged("index-hop", "indexed-kernel")
729732
def test_node_property_index_cost_gate_under_policy_use(
730733
seed: Dict[str, Any],
731734
indexed_column: str,

graphistry/tests/compute/gfql/routes/test_route_harness.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def test_admitted_shape_is_served_and_matches_the_general_path(case: Case, reque
154154
pytest.xfail(f"{case.id}: admitted by the predicate, declined by the lane body (attenuation ledger)")
155155

156156

157+
@pytest.mark.route_engaged("native-fast", "polars-plain", "polars-seeded")
157158
def test_every_route_serves_most_of_what_it_admits(monkeypatch):
158159
"""A lane that declines most admitted shapes has a predicate that no longer describes it."""
159160
per_route: Dict[str, List[int]] = {}

graphistry/tests/compute/gfql/test_native_seed_lane_explain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_node_only_lookup_served_by_the_property_index_is_explained(engine):
4444
assert len(g.gfql(NODE_ONLY, engine=engine, index_policy="use")._nodes) == 1
4545

4646

47-
@pytest.mark.route_engaged("native-fast")
47+
@pytest.mark.route_engaged("native-fast", "polars-seeded")
4848
@pytest.mark.parametrize("engine", ENGINES)
4949
def test_seeded_typed_hop_served_by_the_resident_indexes_is_explained(engine):
5050
g = _graph(engine)

graphistry/tests/compute/gfql/test_polars_native_seed_resolution.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def _graph(reverse=False, indexed=True, padding=0):
3333
return g.gfql_index_all(engine="polars").gfql_index_node_props(["id"], engine="polars") if indexed else g
3434

3535

36+
@pytest.mark.route_engaged("polars-seeded")
3637
@pytest.mark.parametrize("reverse", [False, True])
3738
@pytest.mark.parametrize("indexed", [False, True])
3839
@pytest.mark.parametrize("seed", [{"id": 104}, {"kind": "Message"}, {"id": 105}, {"id": 999}])
@@ -73,6 +74,7 @@ def spy(*args):
7374
_NAMED_TYPED_HOP = [n({"id": 104}, name="m"), e_forward({"type": "T"}, name="e"), n({"kind": "Person"}, name="p")]
7475

7576

77+
@pytest.mark.route_engaged("polars-seeded")
7678
def test_native_seeded_hop_is_served_from_the_index_and_traced():
7779
from graphistry.compute.gfql.index import index_trace
7880
g = _graph()
@@ -98,6 +100,7 @@ def test_native_seeded_hop_declines_without_a_usable_index(policy, monkeypatch):
98100
assert_frame_equal(fast._edges, full._edges)
99101

100102

103+
@pytest.mark.route_engaged("polars-seeded")
101104
@pytest.mark.parametrize("single_node", [False, True])
102105
def test_native_property_seed_uses_resident_index(single_node, monkeypatch):
103106
import graphistry.compute.gfql.index.bindings as bindings

graphistry/tests/compute/gfql/test_rewrite_param_discard.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def test_indexed_bypass_table_edges_survives_a_projection(engine: str) -> None:
210210
"(index/bindings.py gate), so polars-gpu always takes the scan path",
211211
)),
212212
])
213+
@pytest.mark.route_engaged("indexed-kernel")
213214
def test_indexed_bypass_still_serves_a_bare_rows(engine: str) -> None:
214215
"""THE NEGATIVE SIDE: declining on a non-default `table` must not decline everything.
215216

graphistry/tests/compute/gfql/test_seeded_node_lookup_fastpath.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def test_node_lookup_engages_with_parity(engine, indexed, q, label):
114114
_assert_parity(_graph(engine, indexed), engine, q, "seeded_node_lookup")
115115

116116

117+
@pytest.mark.route_engaged("cypher-fast")
117118
@pytest.mark.parametrize("engine", ENGINES)
118119
def test_node_lookup_matches_independent_oracle(engine):
119120
g = _graph(engine)
@@ -263,6 +264,7 @@ def test_hub_seed_over_the_frontier_gate_keeps_parity(engine, indexed):
263264
pd.testing.assert_frame_equal(_canon(fast), _canon(full))
264265

265266

267+
@pytest.mark.route_engaged("cypher-fast")
266268
@pytest.mark.parametrize("engine", ENGINES)
267269
def test_seed_matching_several_nodes_projects_each_seed(engine):
268270
"""A non-unique seed predicate: every seed row pairs with its own destinations."""

0 commit comments

Comments
 (0)