8000 v2.x: a rule call with a float literal returns -0.0's row in some runs (float_constant_test flaky) · Issue #750 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

v2.x: a rule call with a float literal returns -0.0's row in some runs (float_constant_test flaky) #750

Closed

Description

@adityamukho

Summary

On main (v2.0.10 line), the answer to a rule call with a float literal argument differs from run to run. tests/float_constant_test.rs::float_constant_matches_equal_floats_only fails in about 6–10% of runs (19/300, 24/300 and 29/300 in three local Linux loops; also failed once in Windows CI on #749, passed on rerun).

Repro

(transact [[:tiny :m/x 0.00000000000000001] [:zero :m/x 0.0] [:neg :m/x -0.0]])
(rule [(xval ?e ?v) [?e :m/x ?v]])
(query [:find ?e :where (xval ?e 0.0)])

Most runs return :zero only (the rule call's literal joins by Value's hash on v2.x, which tells -0.0 from 0.0, as the test's comment says). Some runs return :zero and :neg. The same process gives the same answer within one run, so the choice looks seeded by RandomState (map iteration order picking a path).

cargo test -q --test float_constant_test --no-run
B=$(ls -t target/debug/deps/float_constant_test-* | grep -v '\.d$' | head -1)
f=0; for i in $(seq 1 300); do $B -q float_constant_matches_equal_floats_only >/dev/null 2>&1 || f=$((f+1)); done; echo $f/300

Failure: assertion left == right failed: a rule call's float argument; left: [":neg", ":zero"], right: [":zero"] at tests/float_constant_test.rs:59.

Notes

Found in passing while running CI for #749 (#744 backport).

🤖 Generated with Claude Code

Activity

  1. added
    bugSomething isn't working
    known-issueBug present in a published release and not yet fixed in one; listed in the pinned known-issues issue
    on Oct 24, 2026
  2. adityamukho commented on Oct 26, 2026

    @adityamukho
    CollaboratorAuthor

    Fixed in v2.0.11, now published: https://github.com/project-minigraf/minigraf/releases/tag/v2.0.11. The fix shipped in #752: equal zero floats hash alike, so a rule call returns -0.0 rows in every run. Updated the pinned known-issues list (#421).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdata-integrityData integrity issueknown-issueBug present in a published release and not yet fixed in one; listed in the pinned known-issues issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0