8000 #551 PR 2: delete the executor's query path, test-hooks, size gate by adityamukho · Pull Request #716 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

#551 PR 2: delete the executor's query path, test-hooks, size gate - #716

Merged
adityamukho merged 8 commits into
v3from
feat/551-delete-executor
Oct 23, 2026
Merged

adityamukho merged 8 commits into
v3from
feat/551-delete-executor

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Part 2 of 3 for #551 (streaming engine 9/9, part of #473). Plan: docs/superpowers/plans/2026-10-23-551-executor-removal.md, steps 14–21. After PR 1 (#715) every query runs on the engine. This PR deletes the code that only the oracle reached. No answer changes.

What goes

  • engine/oracle.rs and the oracle checks in open_query / open_rule_query. The two answer-change tests (spec §4) keep the engine's answer; the executor's answer is now a comment.
  • The executor's query path (execute_query_on_executor, execute_query_with_rules, filter_facts_for_query, selective_fact_fetch, evaluate_branch, apply_* and their helpers), PatternMatcher, RecursiveEvaluator, StratifiedEvaluator and evaluate_not_join. 6,104 lines deleted in that commit.
  • FindSpec::var and DatalogQuery::get_top_level_rule_invocations, which had no other users. Fact-level storage reads that unit tests still use are now cfg(test).

Tests

  • Frozen answers (plan decision 18, deviation 7). The oracle was the only answer check for three suites: query::engine::tests (its rows() returns a count), recursive_engine_test and plan_independence_test. Their answers were recorded in tests/answers/<suite>.txt on the commit before the oracle goes (038f53b), with the oracle on, so every recorded answer had just matched the executor. Each line holds a test, a query digest, a row count and a digest of the rows as a bag, about 400 KB in total. Integers within a week of now (wall-clock tx-ids) compare as "now". MINIGRAF_BLESS_ANSWERS=1 re-records. I checked that changing one recorded digest fails exactly one test. One answer was recorded after the freeze: the ported limit test below, which also asserts its own rows.
  • Deleted: 73 unit tests of executor internals: apply_post_processing aggregation, filter_facts_for_query, selective_fact_fetch, apply_expr unification, evaluate_branch, branch_outer_reads, apply_window_functions, and the PatternMatcher and evaluator tests. Engine tests that cover the same shapes: aggregation_test, window_functions_test, the bitemporal/retraction/multi-value tests, join_rules_test (Expression binding a variable a pattern also binds depends on plan order #596 unification, keyword/ref, ±0.0), disjunction_test, recursive_engine_test, recursive_rules_test (QRY-013, INT-022, INT-020).
  • Ported (no engine test covered them before): the derived-fact limit through a not rule, exactly 7 versus 6 (Recursion through a rule with not / not-join / or returns too few rows #633); count/sum skipping nil; and live_facts of unknown ids, which only the executor reached (keeps reader.rs at its coverage floor).
  • Kept in place (deviation 6): unit tests that query through DatalogExecutor::execute. They already run on the engine.
  • Counts: 1,697 passed / 12 ignored, and with --features test-hooks 1,713 / 13. Was 1,767 / 12 (oracle builds: 1,782 / 16). Run on the bench machine. The coverage gates pass there too: total 95.32% lines / 85.53% branches. evaluator.rs has no branches left, so its branches floor is removed.

test-oracle → test-hooks

The feature now gates only __reorder, __subplans, __tx_chunk_facts and __statement_facts_high_water. rust.yml's oracle job becomes test-hooks, and smoke.yml and crash-kill.yml use the new name. The matching crash-kill.yml change for main is a separate PR, so the file stays identical on both branches (#687). integrity_test's internal-node test was ignored under the oracle; it now runs in every build.

Binary size

The release binary is 1,173 KiB (local stable build). binary-size.yml enforces 1,200 KiB again, and the report-only gate and the PHILOSOPHY.md §4 note are gone (#680). The gate no longer has a SIZE_GATE switch at all (deviation 8), so the file differs from main's only in its branch filters.

Left for PR 3

CHANGELOG.md's per-PR engine entries still describe the steps in between ("still run on the executor"). PR 3 rewrites them along with the migration notes (spec §7). This PR only renames test-oracle there.

Codex review: no findings in the code. It raised two weaknesses in the digest: the "now" mask would also cover data integers near the wall clock, and the separators are ambiguous if a string contained U+001E/U+001F. No test data does either, and the helper's doc now says so. It also flagged the CHANGELOG text above.

🤖 Generated with Claude Code

https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW

adityamukho and others added 8 commits October 23, 2026 16:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
src/query/engine/tests.rs, recursive_engine_test and plan_independence_test
relied on the executor oracle to check their answers. Each answer is now
also compared with one recorded in tests/answers/<suite>.txt, blessed on
this commit with the oracle on, so every recorded answer agreed with the
executor when it was written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
…551)

The two answer-change tests keep the engine's answer; the executor's is a
comment. Steps 16-18 delete the code only the oracle reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
…aluators go (#551)

Deleted with the code they tested: executor unit tests of its internals
(apply_post_processing, filter_facts_for_query, selective_fact_fetch,
apply_expr, evaluate_branch, branch_outer_reads, apply_window_functions,
execute_query_with_rules), PatternMatcher's tests and the evaluator tests;
each shape is covered on the engine by aggregation_test, bitemporal and
retraction tests, join_rules_test, disjunction_test, window_functions_test,
recursive_engine_test and recursive_rules_test. Ported where the engine had
no test: the derived-fact limit through a not rule (recursive_engine_test)
and count/sum over nil (aggregation_test). Tests that query through
DatalogExecutor::execute stay: they run on the engine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
…pers go (#551)

Items the oracle shared with unit tests are cfg(test); FindSpec::var and
DatalogQuery::get_top_level_rule_invocations had no other user and go with
their tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
It gates the test-only switches (__reorder, __subplans, __tx_chunk_facts,
__statement_facts_high_water) and nothing else. rust.yml's oracle job is
the test-hooks job; smoke.yml and crash-kill.yml pass the new name; the
integrity test that skipped under the oracle runs everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
With the executor's query path gone the release binary is 1,173 KiB
(local stable build). The report-only gate and the temporary note in
PHILOSOPHY.md §4 go (#680).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
live_facts' unknown entity and attribute reads were reached only through
the executor; a unit test covers them. rule_invocation_to_pattern matches
on the argument slice, without unreachable INT-022 arms; evaluator.rs has
no branches left, so its branches floor goes.

Also the docs and counts of PR 2 (CLAUDE.md, TEST_COVERAGE.md, plan
decision 18 and deviations 7-8), and the ported test's recorded answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
@codecov
codecov Bot commented Oct 23, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit ef6bc58 into v3 Oct 23, 2026
19 of 20 checks passed
@adityamukho
adityamukho deleted the feat/551-delete-executor branch October 23, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0