Skip to content

fix(#51): use deterministic hashlib.sha256 instead of Python hash() - #103

Merged
Manideep3969 merged 1 commit into
mainfrom
fix/issue-51-deterministic-core-hash
Aug 20, 2026
Merged

fix(#51): use deterministic hashlib.sha256 instead of Python hash()#103
Manideep3969 merged 1 commit into
mainfrom
fix/issue-51-deterministic-core-hash

Conversation

@Manideep3969

Copy link
Copy Markdown
Owner

Replaces non-deterministic Python hash() in _compute_core_hash with hashlib.sha256. Same circuit now produces the same hash across interpreter sessions, fixing persistent caching. 2 regression tests. All 351 tests pass.

_compute_core_hash used Python's hash() which is salted with a random
seed in Python 3.3+, producing different hashes across interpreter
sessions and breaking persistent caching reproducibility.

Fix: Replace hash(tuple) with hashlib.sha256(str(tuple).encode())
converted to int. Same circuit always produces the same hash. Add 2
regression tests.
@Manideep3969
Manideep3969 merged commit e02dafa into main Aug 20, 2026
4 checks passed
@Manideep3969
Manideep3969 deleted the fix/issue-51-deterministic-core-hash branch August 20, 2026 07:04
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