Skip to content

custom generation strategies#197

Merged
CrockAgile merged 1 commit intomainfrom
traversal-strategies
Feb 3, 2026
Merged

custom generation strategies#197
CrockAgile merged 1 commit intomainfrom
traversal-strategies

Conversation

@CrockAgile
Copy link
Collaborator

@CrockAgile CrockAgile commented Feb 1, 2026

custom generation strategies

Generation used to pick RHS alternatives uniformly at random. Now you can pass a strategy.

  • GenerationStrategy trait: implement choose(production, depth) to pick which alternative gets expanded
  • Built-ins: RandomWalk (same as before), DepthBounded (cap depth / guarantee termination), CoverageGuided (prefer unexplored (LHS, index)), Weighted (bias recursive vs not)
  • API: generate_seeded_with_strategy(&self, strategy) and generate_seeded_callback_with_strategy(f, strategy). Existing generate_seeded etc. unchanged, still use RandomWalk

closes #190

@coveralls
Copy link

coveralls commented Feb 1, 2026

Coverage Status

coverage: 97.621% (-0.5%) from 98.104%
when pulling 0f9cc2e on traversal-strategies
into b201e0f on main.

@CrockAgile CrockAgile force-pushed the traversal-strategies branch 6 times, most recently from 22039ec to 3179d6e Compare February 2, 2026 02:50
@CrockAgile CrockAgile changed the title first pass of traversal strategies custom generation strategies Feb 2, 2026
@CrockAgile CrockAgile marked this pull request as ready for review February 2, 2026 02:57
@CrockAgile CrockAgile self-assigned this Feb 2, 2026
@CrockAgile CrockAgile requested a review from shnewto February 2, 2026 02:57
Copy link
Owner

@shnewto shnewto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, this is very cool

@CrockAgile CrockAgile force-pushed the traversal-strategies branch from 3179d6e to 0f9cc2e Compare February 3, 2026 01:41
@CrockAgile CrockAgile merged commit 3aee4f8 into main Feb 3, 2026
9 checks passed
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.

multiple grammar traversal strategies

3 participants