Repository navigation
fix(query): join answers no longer depend on the plan (#545 PR 1) - #592
Merged
Merged
Conversation
Three PRs: the executor's join rules (floats, keyword or ref), then IndexNestedLoopJoin/HashJoin and planner v2, then pseudo-attributes across joins, measurement and docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR
Value's Hash now hashes -0.0 as 0.0, as == already treats them, so a float join key pairs them (it broke the Hash/Eq contract). A variable bound to a keyword and to the ref of the entity it names takes its kind from the first binding pattern in :where text order, not from the one the planner ran first: the executor's plan loops pass the variables a pattern rebinds to PatternMatcher::match_with_hint_seeded. Expression bindings stay fixed; pseudo-attribute patterns never rebind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR
Review found three gaps: a rule call after the binding pattern, a repeated pattern, and a pseudo-attribute pattern that must not replace a value. The matcher's own pseudo-attribute guard duplicated Binders', so the test could not fail; Binders alone decides now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Oct 14, 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.
Part 1 of 3 for #545 (streaming engine 3/9, #473). Plan:
docs/superpowers/plans/2026-10-14-545-joins.md.Before the engine gets its own joins (PR 2), this settles the two cases where today's executor gives a different answer depending on the plan, so the oracle compares against one rule.
Floats.
Value'sHashhashed-0.0and0.0differently although==holds for them (aHash/Eqcontract break), so a float join key never paired them. It now hashes-0.0as0.0. NaN still equals nothing. Float constants in patterns keep the epsilon match. On top-level joins the nested-loop path never compares a bound float. The epsilon comparison of floats substituted intonotbodies is left to #546.Keyword or ref. A variable bound to a keyword by one pattern and to the ref of the entity the keyword names by another now returns the kind from the first of those patterns in the
:wheretext. Before, the answer came from whichever pattern the planner ran first.Binders(executor) records each variable's binding pattern by text position.PatternMatcher::match_with_hint_seededtakes the variables the pattern replaces: the hash path inserts the pattern's value, and the nested-loop path the fact's value. Expression bindings stay fixed, and pseudo-attribute patterns never replace a value. This covers both executor plan loops (with and without rules);or,notand rule bodies are unchanged.Decisions settled with the maintainer (plan, "Design decisions"): IEEE
==for float joins,:wheretext order for kinds,IndexNestedLoopJoinon entity probes only (PR 2), and pseudo-attributes reproduced with a follow-up issue (PR 3).Tests
tests/join_rules_test.rs(10):0.0/-0.0as the join key and as a shared variable; float constant epsilon; keyword vs ref when plan order ≠ text order, through the attribute position, before and after a rule call, with a repeated pattern; an expression's value kept by a later text-earlier pattern; a pseudo-attribute pattern never replaces a value. Each rule test was checked to fail with its guard removed. They also pass under--features wasm.types.rsunit test:-0.0and0.0hash alike.cargo test: 1,490 passed, 10 ignored;cargo test --features test-oracle: all pass; clippy clean (native, all features, wasm32 browser, wasip1).CHANGELOG (Breaking changes) describes the changed answers.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR