Include synthetic_key in TargetRelations equality and hashing - #271
Merged
Conversation
The hand-written Julia equality for `TargetRelations` compared only `keys` and `body`, so it never picked up the `synthetic_key` field added in #269. Two `TargetRelations` differing only in whether the shared key is synthetic compared equal and hashed alike — meaning they collided in dictionaries and sets, and `==` reported a false positive. Add `synthetic_key` to `==`, `isequal`, and `hash`, with a regression test that fails against the previous implementation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
minsungc
approved these changes
Jul 27, 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.
Summary
The hand-written Julia equality for
TargetRelationsinsdks/julia/LogicalQueryProtocol.jl/src/equality.jlcompares onlykeysandbody. It was never updated when thesynthetic_keyfield landed in #269.As a result, two
TargetRelationsthat differ only in whether the shared key is synthetic compared equal and hashed identically — so they collided inDict/Setkeys, and==reported a false positive.Changes
synthetic_keyto==,isequal, andhashforTargetRelations.Verification
The new
@test s1 != g3assertion fails against the previous implementation and passes with the fix. Full Julia suite green (174 test items).Split out of the
load_errorswork so the fix can land on its own; #272 is stacked on this branch.🤖 Generated with Claude Code