Skip to content

LoopyKeyBuilder: hash for BasicSet differs for objects that compare equal #912

Open
@matthiasdiener

Description

@matthiasdiener
import islpy as isl

a=isl.BasicSet("[im_w, im_h, nimgs, nfeats] -> {  : im_w >= 7 and im_h >= 7 and nimgs >= 0 and nfeats > 0 }")

b=isl.BasicSet("[nfeats, nimgs, im_h, im_w] -> {  : nfeats > 0 and nimgs >= 0 and im_h >= 7 and im_w >= 7 }")

from loopy.tools import LoopyKeyBuilder

assert a == b
assert LoopyKeyBuilder()(a) == LoopyKeyBuilder()(b)
$ python set.py
Traceback (most recent call last):
  File "/Users/mdiener/Work/e12test/loopy/set.py", line 12, in <module>
    assert LoopyKeyBuilder()(a) == LoopyKeyBuilder()(b)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

The same issue exists with hash(), as well as Set(including Set.get_hash).

cc: #576, #828, inducer/islpy#89

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions