8000 fix(or): an or branch meets a keyword value as the entity it names (#637) by adityamukho · Pull Request #638 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(or): an or branch meets a keyword value as the entity it names (#637) - #638

Merged
adityamukho merged 1 commit into
mainfrom
fix/637-or-keyword-ref
Oct 20, 2026
Merged

adityamukho merged 1 commit into
mainfrom
fix/637-or-keyword-ref

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Refs #637 (v2.x only; stays open until the v2.0.x patch ships). On v3 the same answer came with #546 (PR #626), so there is no v3 PR.

Problem

The executor's joined or / or-join path (taken unless a branch holds a not or an expression reading an outer variable) runs each branch alone and hash-joins its rows to the outer rows on exact Values. A keyword bound by an outer pattern (?f of [?e :friend ?f] with [:alice :friend :bob]) never met the Ref a branch binds for entity :bob, so (or [?f :name ?n] [?f :alias ?n]) dropped every row, silently, in queries and rule bodies.

Fix

Build the join keys — and the #250 short-circuit's coverage keys — from normalize_value (keyword → ref of the entity it names), as the not-join exclusion set already does. The merged row keeps the outer row's value, as before. Scope is #637 only: #546's other or changes (float IEEE equality, per-branch shared variables, or-join branches not binding every join var) are not backported.

Tests

tests/disjunction_test.rs: keyword → entity (query and pure-filter or), entity → keyword, or-join, or in a rule body; all four fail on main. The #633 recursion-through-or test goes back to its v3 form (the or binds the next step), which this makes pass.

1311 tests (1302 passing, 9 ignored). Docs: CHANGELOG (Unreleased), CLAUDE.md, README, TEST_COVERAGE. Under --features wasm, three #250 short-circuit tests in disjunction_test.rs fail on main with or without this change (they assume cost sorting).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

)

The joined or / or-join path keyed its hash join on exact values, so a
keyword bound by an outer pattern never met the ref a branch bound for
the entity it names (and the reverse): those rows were dropped with no
error. Key the join, and the #250 short-circuit's coverage check, on
normalize_value, as the not-join exclusion set already does. On v3 the
same answer came with #546.

The #633 or test goes back to the v3 form, which this makes pass.

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

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

< 8000 button aria-expanded="false" type="button" data-view-component="true" class="js-details-target btn-sm btn float-right"> Hide details View details
@adityamukho
adityamukho merged commit 72650b0 into main Oct 20, 2026
22 checks passed
@adityamukho
adityamukho deleted the fix/637-or-keyword-ref branch October 20, 2026 03:29
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