Repository navigation
feat: configurable recursion round limit (#861) - #875
Merged
Merged
Conversation
OpenOptions::max_iterations sets the most rounds one stratum of a rule query may run; the default rises from a fixed 1,000 to 1,000,000, equal to max_derived_facts (a round that continues derived a new fact, so the derived-facts limit binds first). :max-iterations N|$slot replaces it per query, gated by Overridable::MaxIterations (in DEFAULTS); PreparedQuery::with_max_iterations replaces it per statement, ungated. Rounds stay per stratum. INT-020's round message says how to raise it. The database, executor, prepared queries and BrowserDb now carry one engine::Limits. Grammar, GRAMMAR.md, corpus, fuzz seed, verifier (42 tokens), docs and counts updated. Refs #861, #862 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H2a7QoYX6tc5G3sKVzvLjD
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
adityamukho
added a commit
to project-minigraf/minigraf-docs
that referenced
this pull request
Nov 6, 2026
…93) Datalog reference: the keyword, its range, DEFAULTS, the 1,000 -> 1,000,000 default; slot list. Performance tuning: the option, the override table row, the setter. All under @SInCE v3.0.0. Refs project-minigraf/minigraf#861, project-minigraf/minigraf#875 Claude-Session: https://claude.ai/code/session_01H2a7QoYX6tc5G3sKVzvLjD Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #861, #862 (no closing keyword: v3 branch; close #861 by hand after merge).
Implements the #861 decisions (issue comment of 2026-11-06), reusing #870's slot and setter code. Plan:
docs/superpowers/plans/2026-11-06-861-max-iterations.md.What changes
OpenOptions::max_iterations: the most rounds one stratum of a rule query may run. The default goes from a fixed 1,000 to 1,000,000, the same asmax_derived_facts. A stratum only starts another round after deriving a new fact, so at the defaults the derived-facts limit is reached first. This changes answers on v3: a recursion over a chain of more than about 1,000 edges now returns its rows instead of INT-020. It is listed under CHANGELOG Breaking changes.:max-iterations N/$slot: replaces the database value for one query, up or down. INT-012/013/014/015 work as for:max-derived-facts. It is gated by the newOverridable::MaxIterations, which is inDEFAULTS, so it works without configuration, including inBrowserDb.PreparedQuery::with_max_iterations: replaces the database value for one statement. It is not gated, and an allowed keyword still overrides it.:max-iterations NorOpenOptions::max_iterations).BrowserDbnow pass oneengine::Limitsvalue instead of(usize, usize)pairs. The unusedDatalogExecutor::new_with_limitsis removed.grammar.pest,GRAMMAR.md, 6 corpus fixtures, a fuzz seed, and the verifier (41 → 42 tokens).Verification
--features test-hooks: 2,118 / 24allow_overrides_test::defaults_read_back_and_compose, which checked for the old two-entryDEFAULTS. I updated it to includeMaxIterations, and it now passes in both feature sets.tests/limit_keywords_test.rs:check_overridesorder test, a doc test, and a#[wasm_bindgen_test].cargo clippy --all-features -- -D warningsand clippy for both wasm targets: clean.--profile distgrows by +624 B over base83fbaa8d(measured locally with stable 1.94). Going from feat: :query-memory-limit, limit bind slots and PreparedQuery limit setters (#870) #874's CI number, the binary should stay about 5 KiB under the 1,240 KiB gate, so the gate is not changed.Docs site: the companion PR in project-minigraf/minigraf-docs should merge after this one.
🤖 Generated with Claude Code
https://claude.ai/code/session_01H2a7QoYX6tc5G3sKVzvLjD