Skip to content

Add weights to decision points#11

Open
Soupstraw wants to merge 9 commits intomasterfrom
jj/weighted-decision-points
Open

Add weights to decision points#11
Soupstraw wants to merge 9 commits intomasterfrom
jj/weighted-decision-points

Conversation

@Soupstraw
Copy link
Collaborator

@Soupstraw Soupstraw commented Mar 6, 2026

This PR adds weights to decision points. This makes it possible to fine-tune the probabilities of decision points to ensure a better test case distribution.

close #6

@Soupstraw Soupstraw marked this pull request as draft March 6, 2026 14:05
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for weighted decision points in AntiGen, allowing callers to influence which negatable generator is “zapped” based on per-point weight rather than uniform selection.

Changes:

  • Extend BiGen/DecisionPoint plumbing to carry and apply a Float weight, and switch zapping selection from “N-th decision point” to “cutoff weight”.
  • Add new public APIs scaleWeight and reweigh to adjust decision-point weights, plus replicateMNorm to normalize list weights.
  • Update benchmarks and changelog to reflect the new weighting feature.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
src/Test/AntiGen/Internal.hs Core implementation: weight propagation, weight-based zapping selection, new combinators (scaleWeight, reweigh).
src/Test/AntiGen.hs Re-export new weighting APIs and add replicateMNorm.
bench/Main.hs Update benchmark calls for zapAt’s new Float-based cutoff.
CHANGELOG.md Note the new weighting-related additions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Soupstraw and others added 3 commits March 6, 2026 14:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Soupstraw Soupstraw force-pushed the jj/weighted-decision-points branch from cdbfdac to 8379355 Compare March 6, 2026 14:28
Soupstraw and others added 2 commits March 6, 2026 14:31
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Soupstraw Soupstraw marked this pull request as ready for review March 6, 2026 14:37
Verifies that a generator with weight 0 is never zapped.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Add support for weighted decision points

2 participants