8000 fix(magic-sets): guard a rule only by demand every call site supplies (#608) by adityamukho · Pull Request #611 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(magic-sets): guard a rule only by demand every call site supplies (#608) - #611

Merged
adityamukho merged 1 commit into
mainfrom
fix/608-magic-sets-v2
Oct 16, 2026
Merged

adityamukho merged 1 commit into
mainfrom
fix/608-magic-sets-v2

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Backport of #609 (merged on v3 as b1e8b73) to v2.x for #608.

magic_sets.rs and tests/magic_sets_test.rs were identical on main and v3, so the code change applies unchanged. Only the doc lines were redone for main: the CHANGELOG [Unreleased] entry and the test counts.

See #609 for the root cause and the fix. In short, magic sets used the first call to each rule to decide its bound arguments, so other calls either failed with INT-022 or got too few rows. Each rule is now narrowed only to what every call to it can provide.

On main, the 7 new integration tests reproduce #608 and the cases where too few rows came back silently. The full suite passes: 1258 passed, 9 ignored. cargo clippy --all-features -- -D warnings is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR

…#608)

Backport of #609 from v3. Adornments were taken from the first call to each
rule and assumed for every other call. A call that did not match — a rule-body
call whose argument nothing had bound yet, the same rule called with free
arguments, a call inside or/not, or a call from an unguarded rule — failed with
INT-022 or silently got only the demanded facts. solve_adornments now starts
each reachable rule all-bound and weakens it to the meet of every call site's
adornment until a fixpoint; a rule left with no bound position is evaluated
unguarded.

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

Codecov Report

❌ Patch coverage is 97.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/query/datalog/magic_sets.rs 97.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit 4bfdde4 into main Oct 16, 2026
22 checks passed
@adityamukho
adityamukho deleted the fix/608-magic-sets-v2 branch October 16, 2026 07:16
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