Repository navigation
fix(or): an or branch meets a keyword value as the entity it names (#637) - #638
Merged
Merged
Conversation
) 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 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
This was referenced Oct 20, 2026
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 #637 (v2.x only; stays open until the v2.0.x patch ships). On
v3the same answer came with #546 (PR #626), so there is no v3 PR.Problem
The executor's joined
or/or-joinpath (taken unless a branch holds anotor an expression reading an outer variable) runs each branch alone and hash-joins its rows to the outer rows on exactValues. A keyword bound by an outer pattern (?fof[?e :friend ?f]with[:alice :friend :bob]) never met theRefa 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 thenot-joinexclusion set already does. The merged row keeps the outer row's value, as before. Scope is #637 only: #546's otherorchanges (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-filteror), entity → keyword,or-join,orin a rule body; all four fail onmain. The #633 recursion-through-ortest goes back to its v3 form (theorbinds 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 indisjunction_test.rsfail onmainwith or without this change (they assume cost sorting).🤖 Generated with Claude Code
https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz