From 472c54a7e89001f5f752da670cc25ec1a537da87 Mon Sep 17 00:00:00 2001 From: Maddiaa <47148561+Maddiaa0@users.noreply.github.com> Date: Wed, 14 Feb 2024 18:43:54 +0000 Subject: [PATCH] fix: master borked arithmetic tests (#4606) --- .../vm/tests/avm_arithmetic.test.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp b/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp index 2f4d24a261f..e9335512e5d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/tests/avm_arithmetic.test.cpp @@ -522,7 +522,7 @@ TEST_F(AvmArithmeticTestsFF, nonEquality) FF elem = FF::modulus - FF(1); trace_builder.calldata_copy(0, 3, 0, std::vector{ elem, elem + FF(1), 0 }); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::FF); // Memory Layout [q - 1, q, 1,0..] - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq(trace, elem, FF(0), FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::FF); @@ -684,7 +684,7 @@ TEST_F(AvmArithmeticTestsU8, equality) trace_builder.set(128, 0, AvmMemoryTag::U8); trace_builder.set(128, 1, AvmMemoryTag::U8); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U8); // Memory layout: [128,128,1,0,..,0] - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq(trace, FF(128), FF(128), FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U8); @@ -701,7 +701,7 @@ TEST_F(AvmArithmeticTestsU8, nonEquality) trace_builder.set(84, 0, AvmMemoryTag::U8); trace_builder.set(200, 1, AvmMemoryTag::U8); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U8); // Memory layout: [84,200,0,0,..,0] - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq(trace, 84, 200, FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U8); @@ -870,7 +870,7 @@ TEST_F(AvmArithmeticTestsU16, equality) trace_builder.set(35823, 0, AvmMemoryTag::U16); trace_builder.set(35823, 1, AvmMemoryTag::U16); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U16); - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq(trace, FF(35823), FF(35823), FF(1), FF(0), FF(1), FF(2), AvmMemoryTag::U16); @@ -887,7 +887,7 @@ TEST_F(AvmArithmeticTestsU16, nonEquality) trace_builder.set(35'823, 0, AvmMemoryTag::U16); trace_builder.set(50'123, 1, AvmMemoryTag::U16); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U16); - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq(trace, 35'823, 50'123, FF(0), FF(0), FF(1), FF(2), AvmMemoryTag::U16); @@ -1069,7 +1069,7 @@ TEST_F(AvmArithmeticTestsU32, equality) trace_builder.set(0xb435e9c1, 0, AvmMemoryTag::U32); trace_builder.set(0xb435e9c1, 1, AvmMemoryTag::U32); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U32); - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = @@ -1087,7 +1087,7 @@ TEST_F(AvmArithmeticTestsU32, nonEquality) trace_builder.set(0xb435e9c1, 0, AvmMemoryTag::U32); trace_builder.set(0xb435e9c0, 1, AvmMemoryTag::U32); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U32); - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = @@ -1294,7 +1294,7 @@ TEST_F(AvmArithmeticTestsU64, equality) trace_builder.set(0xffffffffffffffe0LLU, 0, AvmMemoryTag::U64); trace_builder.set(0xffffffffffffffe0LLU, 1, AvmMemoryTag::U64); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U64); - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq( @@ -1312,7 +1312,7 @@ TEST_F(AvmArithmeticTestsU64, nonEquality) trace_builder.set(0xffffffffffffffe0LLU, 0, AvmMemoryTag::U64); trace_builder.set(0xffffffffffaeffe0LLU, 1, AvmMemoryTag::U64); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U64); - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq( @@ -1589,7 +1589,7 @@ TEST_F(AvmArithmeticTestsU128, equality) trace_builder.set(elem, 0, AvmMemoryTag::U128); trace_builder.set(elem, 1, AvmMemoryTag::U128); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U128); - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq(trace, @@ -1615,7 +1615,7 @@ TEST_F(AvmArithmeticTestsU128, nonEquality) trace_builder.set(a, 0, AvmMemoryTag::U128); trace_builder.set(b, 1, AvmMemoryTag::U128); trace_builder.op_eq(0, 1, 2, AvmMemoryTag::U128); - trace_builder.return_op(0, 3); + trace_builder.return_op(0, 0); auto trace = trace_builder.finalize(); auto alu_row_index = common_validate_eq(trace,