8000 test(engine): recursive acceptance at 5M derived facts and envelope recursive shape (#548) by adityamukho · Pull Request #671 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

test(engine): recursive acceptance at 5M derived facts and envelope recursive shape (#548) - #671

Merged
adityamukho merged 3 commits into
v3from
feat/548-acceptance
Oct 20, 2026
Merged

adityamukho merged 3 commits into
v3from
feat/548-acceptance

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Part 6 of the streaming engine (#473), #548 PR 3 of 3: acceptance and measurement (plan steps 16–19, spec §7). No code change to the library.

Acceptance test

tests/recursive_acceptance_test.rs (#[ignore]d, one test so the process's RSS high-water mark is the query's own): a layered graph, 63 layers of 50 nodes with complete bipartite edges between neighbours (155,000 facts); reach derives 4,882,500 facts in 62 rounds.

  • Every row is returned through a cursor; the high-water mark is reset (/proc/self/clear_refs = 5) just before the query, and its peak must stay under 256 bytes per derived fact. Measured on a laptop: 226 s, 169 B/fact (178 → 966 MiB).
  • With the default max_derived_facts (1M), the same rule fails with INT-020.
  • Run nightly by a new job in smoke.yml (45 min timeout). Note: scheduled runs use main's copy of the workflow, so like the existing size-per-fact step this job runs on workflow_dispatch against v3 until v3 becomes main.

Envelope recursive shape

[:find ?x ?b :where (boss ?x ?b)], the whole transitive closure of :manager with no constant (no magic sets). The envelope now opens with max_derived_facts(usize::MAX) (only rule queries are affected).

A/B on an idle server, v3 before #670 (84ac845, rule queries on the executor, with the new shape) vs this branch, in parallel on different sockets, swapped for round 2; rounds agree within 2%:

Shape 100K 1M 10M
recursive_ancestors p50, executor → engine 2.71 s → 1.45 ms 43.9 s → 2.14 ms > 60 s → 3.04 ms
recursive_ancestors peak RSS 253 → 4 MiB 2,663 → 4 MiB > 8.8 GiB → 4 MiB
recursive p50 3.04 s → 211 ms 51.0 s → 3.21 s > 60 s → 53.8 s
recursive peak RSS 484 → 45 MiB 4,786 → 318 MiB > 8.8 GiB → 2,557 MiB
every other shape unchanged unchanged unchanged

#379 point queries: bimodal per process on that server (~20 µs or ~50 µs at 1M) in both builds; six fresh processes per shape per build gave the same medians within 7 µs. No regression.

Observation (not addressed here)

The 5M test spends its time in ~250M candidate derivations (each reach fact is reached through 50 middle nodes): per-row entity probes decoding a leaf, and SipHash on the identity set. It is a cost of the plan, not memory; a possible follow-up.

Docs

CHANGELOG.md (#548 entry measured at all scales, Tests entry), docs/BENCHMARKS.md (new #548 section, supported-workloads row; the "rule queries not interactive past 100K" limitation removed), counts 1702 (1691 passing, 11 ignored). No docs-site change (measurements only). Codex review: one finding (VmHWM lifetime high-water mark could hide the query's peak), fixed in 93e3746.

Part of #548 (closed by hand after merge) and #473.

🤖 Generated with Claude Code

https://claude.ai/code/session_019kY61Y11gcRD91Y6b7jbGT

@codecov
codecov Bot commented Oct 20, 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 2ee149a into v3 Oct 20, 2026
25 of 26 checks passed
@adityamukho
adityamukho deleted the feat/548-acceptance branch October 20, 2026 22:23
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