8000 fix(query): float constants match equal floats only (#706) — backport by adityamukho · Pull Request #711 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(query): float constants match equal floats only (#706) — backport - #711

Merged
adityamukho merged 2 commits into
mainfrom
fix/706-float-exact-main
Oct 23, 2026
Merged

adityamukho merged 2 commits into
mainfrom
fix/706-float-exact-main

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Backport of #710 to v2.x (issue #706, data-integrity; stays open until v2.0.10 is published).

Summary

On main the only site is src/query/datalog/matcher.rs. A float constant in a pattern, whether written out or bound to a $slot, matched every stored float within f64::EPSILON. It now compares with IEEE ==, as joins and predicates do. 0.0 still matches -0.0.

Tests

  • New tests/float_constant_test.rs (2 tests) covers a literal, -0.0, an = predicate, a rule body, a not body and a prepared $v bound to 0.0 and to 1e-17. It runs in memory and on file before and after a checkpoint and after reopen. Both tests fail before the fix.
  • The full suite passes: 1316 passed, 9 ignored. cargo clippy --all-features -- -D warnings and cargo fmt --check are clean.

CHANGELOG (Unreleased → Fixed), TEST_COVERAGE.md and the test count are synced.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WvnzWaNkVaLTTAMBM4jAaq

A float constant in a pattern, written or bound with `$slot`, matched
every stored float within an absolute `f64::EPSILON`, so `0.0` matched
`1e-17` while `[(= ?v 0.0)]` did not. Compare with IEEE `==`, as joins
and predicates already do: `0.0` matches `-0.0`, nothing else changes.

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

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit e8b4e13 into main Oct 23, 2026
16 checks passed
@adityamukho
adityamukho deleted the fix/706-float-exact-main branch October 23, 2026 06:39
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