Skip to content

feat(query): per-query :max-derived-facts and :max-results; raise default to 1M (#288) - #290

Merged
adityamukho merged 10 commits into
mainfrom
feat/288-per-query-limits
Jun 4, 2026
Merged

adityamukho merged 10 commits into
mainfrom
feat/288-per-query-limits

Conversation

@adityamukho

Copy link
Copy Markdown
Collaborator

Summary

  • Adds :max-derived-facts N and :max-results N as optional per-query keys in the Datalog query syntax
  • Per-query values override the OpenOptions database-level limits for that single query only; no shared state mutation
  • Raises DEFAULT_MAX_DERIVED_FACTS from 100,000 to 1,000,000
  • Updates tests/grammar/grammar.pest (+ new corpus files), .wiki/Datalog-Reference.md, .wiki/Performance-Tuning.md

Test plan

  • All existing tests pass (964 total)
  • Parser tests: valid keys, 0 rejected, duplicate rejected, non-integer rejected, order-independent (10 tests)
  • Executor unit tests: per-query override takes effect; does not bleed into next query
  • Integration tests via Minigraf::execute for both :max-derived-facts and :max-results
  • Grammar conformance corpus files added for both new keywords

Closes #288
Tracks long-term magic sets work in #289

Generated with Claude Code

adityamukho and others added 10 commits June 4, 2026 11:28
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…#288)

Add the two new per-query limit fields to all DatalogQuery struct
literal initialisers in types.rs and executor.rs so the build compiles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dd :max-results non-integer test (#288)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…:max-results (#288)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on; add corpus files (#288)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 4, 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 e29d4d4 into main Jun 4, 2026
17 checks passed
@adityamukho
adityamukho deleted the feat/288-per-query-limits branch June 4, 2026 07:33
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.

feat: make max_derived_facts_per_iteration configurable (currently hard-coded at 100,000)

1 participant