Skip to content

feat: Conjecture engine (Hypothesis-style byte-buffer testing)#61

Draft
alok wants to merge 1 commit intoleanprover-community:mainfrom
alok:conjecture-engine
Draft

feat: Conjecture engine (Hypothesis-style byte-buffer testing)#61
alok wants to merge 1 commit intoleanprover-community:mainfrom
alok:conjecture-engine

Conversation

@alok
Copy link

@alok alok commented Dec 27, 2025

Hypothesis-style byte-buffer generation and shrinking.

Shrinking at byte level eliminates per-type Shrinkable instances.

  • ChoiceSequence: byte buffer + span annotations
  • Strategy α: bytes → typed values
  • Shrinker: delete/zero spans, halve bytes
  • Parallel workers (IO.asTask) with early termination, fallback for <1000 tests
  • Nat.shrinkToMinimal: binary search finds 50, not 64
  • Example database, health checks

@alok alok force-pushed the conjecture-engine branch from 0bacbea to 6a15d6f Compare December 27, 2025 01:03
@alok alok marked this pull request as draft December 27, 2025 01:03
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
@alok alok force-pushed the conjecture-engine branch from 6a15d6f to 0e24676 Compare December 27, 2025 01:14
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