feat: Conjecture engine (Hypothesis-style byte-buffer testing)#61
Draft
alok wants to merge 1 commit intoleanprover-community:mainfrom
Draft
feat: Conjecture engine (Hypothesis-style byte-buffer testing)#61alok wants to merge 1 commit intoleanprover-community:mainfrom
alok wants to merge 1 commit intoleanprover-community:mainfrom
Conversation
0bacbea to
6a15d6f
Compare
Adds a Hypothesis-style testing engine that generates and shrinks at the byte level rather than the value level. Core: - ChoiceSequence: byte buffer with span annotations for smart shrinking - Strategy typeclass: interprets bytes as typed values (Nat, Bool, List, etc.) - Shrinker: byte-level operations (delete spans, halve bytes, zero spans) Features: - Parallel testing via IO.asTask with auto-fallback for <1000 tests - Binary search shrinking for numeric types (O(log n) vs O(n) halving) - Example database: persists failing cases across runs - Health checks: detects slow/problematic generators - Targeted PBT: score-guided evolutionary search
6a15d6f to
0e24676
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-style byte-buffer generation and shrinking.
Shrinking at byte level eliminates per-type
Shrinkableinstances.ChoiceSequence: byte buffer + span annotationsStrategy α: bytes → typed valuesShrinker: delete/zero spans, halve bytesIO.asTask) with early termination, fallback for <1000 testsNat.shrinkToMinimal: binary search finds 50, not 64