From b7944e5c40d282bd6999c10b95a282daff388549 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 11 Dec 2021 01:40:09 +0000 Subject: [PATCH] Make `Assigned::Zero` slightly less likely in `Assigned` proptest --- halo2_proofs/src/plonk/assigned.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/halo2_proofs/src/plonk/assigned.rs b/halo2_proofs/src/plonk/assigned.rs index fcf6b2a3..2216083e 100644 --- a/halo2_proofs/src/plonk/assigned.rs +++ b/halo2_proofs/src/plonk/assigned.rs @@ -522,7 +522,10 @@ mod proptests { /// Generates half of the denominators as zero to represent a deferred inversion. fn arb_rational()( numerator in arb_element(), - denominator in prop_oneof![Just(Fp::zero()), arb_element()], + denominator in prop_oneof![ + 1 => Just(Fp::zero()), + 2 => arb_element(), + ], ) -> Assigned { Assigned::Rational(numerator, denominator) } @@ -546,7 +549,11 @@ mod proptests { num_binary in 0usize..5, )( values in vec( - prop_oneof![Just(Assigned::Zero), arb_trivial(), arb_rational()], + prop_oneof![ + 1 => Just(Assigned::Zero), + 2 => arb_trivial(), + 2 => arb_rational(), + ], // Ensure that: // - we have at least one value to apply unary operators to. // - we can apply every binary operator pairwise sequentially.