test(properties): add hypothesis property-based testing and fix __iadd__ padding bug#44
Merged
Conversation
…d__ padding bug - Add `hypothesis>=6.0.0` to the dev dependency group in pyproject.toml and update uv.lock. - Create tests/test_properties.py with property-based test suites using hypothesis to verify mathematical invariants, involution properties, and bitwise commutativity. - Include the exact reproduction test case for addition after inversion as described in issue #36. - Fix bug in BitVector.__iadd__ where residual 1s in destination padding words (such as from __invert__) were not masked out prior to bitwise ORing new bits, causing corruption when appending to modified vectors. Fixes #36 Refs #39
- Add hypothesis strategy generating arbitrary non-negative start and stop slice indices. - Verify BitVector slicing __getitem__ against standard Python string slicing str(bv)[start:stop] across 16-bit word boundaries.
- Add `hypofuzz>=24.0.0` to dev dependencies in pyproject.toml and update uv.lock. - Create scripts/fuzz.sh as a dedicated executable script to run adaptive, coverage-guided continuous fuzzing on tests/test_properties.py. - Document hypofuzz usage and continuous fuzzing commands in AGENTS.md and README.md. Fixes #39
schwehr
force-pushed
the
feat/hypothesis-testing
branch
from
July 9, 2026 17:41
da45072 to
972296e
Compare
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.
hypothesis>=6.0.0to the dev dependency group in pyproject.toml and update uv.lock.__iadd__implementation known bad #36.Fixes #36
Refs #39