Skip to content

BigInt test failures on 49 #5579

@michaeljklein

Description

@michaeljklein

Aim

Attempted to test:

  • BigIntAdd left/right identity (0)
  • BigIntMul left/right identity (1)
  • BigIntSub right identity (0)
  • BigIntDiv right identity (1)

Expected Behavior

Expected all tests to pass

Bug

Tests fail on 49 for at least one modulus, see below for a particular case.

Note that bigint_add_sub and bigint_sub_add are also currently failing. It's likely that it's the same bug, but they're failing on different inputs, e.g. (x=0, y=97).

// TODO(https://github.com/noir-lang/noir/issues/5579):
// this test is redundant with bigint_add_zero_l, but may be useful for
// debugging. It can be removed once bigint_add_zero_l is
// passing because proptest automatically retries previous failures first.
#[test]
#[should_panic(expected = "assertion `left == right` failed")]
fn bigint_add_zero_l_single_case_49() {
    let modulus = &allowed_bigint_moduli()[0];
    let mut xs: Vec<_> = modulus.iter().map(|_| (FieldElement::zero(), false)).collect();
    xs[modulus.len() - 1] = (FieldElement::from(49u128), false);

    let zero = bigint_zeroed(&xs);
    let expected_results = drop_use_constant(&xs);
    let results = bigint_solve_binary_op(bigint_add_op(), modulus.clone(), zero, xs);

    assert_eq!(results, expected_results)
}

To Reproduce

Project Impact

None

Impact Context

No response

Workaround

None

Workaround Description

No response

Additional Context

No response

Installation Method

None

Nargo Version

No response

NoirJS Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions