Skip to content

Commit

Permalink
fix(avm): fixes AVM full tests and decrease timeout to 35 minutes (#7438
Browse files Browse the repository at this point in the history
)

Fixes failure in:
https://github.com/AztecProtocol/aztec-packages/actions/runs/9885438673
Timeout decrease for the AVM full tests action to 35 minutes.
  • Loading branch information
jeanmon authored Jul 11, 2024
1 parent fd67da3 commit 2a7494b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/vm_full_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
concurrency_key: avm-full-tests-x86
- name: "AVM Full Tests"
working-directory: ./barretenberg/cpp/
timeout-minutes: 70
timeout-minutes: 35
run: |
sudo shutdown -P 70 # hack until core part of the scripts
sudo shutdown -P 35 # hack until core part of the scripts
earthly-ci --no-output +vm-full-test --hardware_concurrency=64 # limit our parallelism to half our cores
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ TEST_F(AvmArithmeticTestsFF, subtraction)
EXPECT_EQ(alu_row.alu_u8_r0, FF(0));

std::vector<FF> const returndata = { 8, 9, 17 };
validate_trace(std::move(trace), public_inputs, calldata);
validate_trace(std::move(trace), public_inputs, calldata, returndata);
}

// Test on basic multiplication over finite field type.
Expand Down Expand Up @@ -483,7 +483,7 @@ TEST_F(AvmArithmeticTestsFF, fDivision)
EXPECT_EQ(row->main_sel_mem_op_c, FF(1));
EXPECT_EQ(row->main_rwc, FF(1));

std::vector<FF> const returndata = { 15, 315, 0 };
std::vector<FF> const returndata = { 15, 315, 21 };
validate_trace(std::move(trace), public_inputs, calldata, returndata);
}

Expand Down Expand Up @@ -619,7 +619,7 @@ TEST_F(AvmArithmeticTestsFF, nonEquality)
gen_trace_builder(calldata);
trace_builder.op_calldata_copy(0, 0, 2, 0);
trace_builder.op_eq(0, 0, 1, 2, AvmMemoryTag::FF); // Memory Layout [q - 1, q, 0, 0..]
trace_builder.op_return(0, 0, 0);
trace_builder.op_return(0, 0, 3);
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1451,9 +1451,10 @@ TEST_F(AvmExecutionTests, kernelInputOpcodes)

// The return data for this test should be a the opcodes in sequence, as the opcodes dst address lines up with
// this array The returndata call above will then return this array
std::vector<FF> returndata = { sender, address, storage_address, function_selector, transaction_fee,
chainid, version, blocknumber, /*coinbase,*/ timestamp, feeperl2gas,
feeperdagas };
std::vector<FF> const expected_returndata = {
address, storage_address, sender, function_selector, transaction_fee, chainid, version,
blocknumber, /*coinbase,*/ timestamp, feeperl2gas, feeperdagas,
};

// Set up public inputs to contain the above values
// TODO: maybe have a javascript like object construction so that this is readable
Expand All @@ -1476,8 +1477,12 @@ TEST_F(AvmExecutionTests, kernelInputOpcodes)
public_inputs_vec[FEE_PER_DA_GAS_OFFSET] = feeperdagas;
public_inputs_vec[FEE_PER_L2_GAS_OFFSET] = feeperl2gas;

std::vector<FF> returndata;
auto trace = Execution::gen_trace(instructions, returndata, calldata, public_inputs_vec);

// Validate returndata
EXPECT_EQ(returndata, expected_returndata);

// Validate that the opcode read the correct value into ia
// Check address
auto address_row =
Expand Down Expand Up @@ -1539,7 +1544,7 @@ TEST_F(AvmExecutionTests, kernelInputOpcodes)
std::ranges::find_if(trace.begin(), trace.end(), [](Row r) { return r.main_sel_op_fee_per_l2_gas == 1; });
EXPECT_EQ(feeperl2gas_row->main_ia, feeperl2gas);

validate_trace(std::move(trace), Execution::convert_public_inputs(public_inputs_vec));
validate_trace(std::move(trace), Execution::convert_public_inputs(public_inputs_vec), calldata, returndata);
}

// Positive test for L2GASLEFT opcode
Expand Down

0 comments on commit 2a7494b

Please sign in to comment.