@@ -27,13 +27,16 @@ template <typename Relation> constexpr bool subrelation_is_linearly_independent(
27
27
}
28
28
29
29
template <typename Relation, typename Trace, typename RowGetter>
30
- void check_relation_internal (const Trace& trace, std::span<const size_t > subrelations, RowGetter get_row)
30
+ void check_relation_internal (const Trace& trace,
31
+ std::span<const size_t > subrelations,
32
+ uint32_t num_rows,
33
+ RowGetter get_row)
31
34
{
32
35
typename Relation::SumcheckArrayOfValuesOverSubrelations result{};
33
36
34
37
// Accumulate the trace over the subrelations and check the result
35
38
// if the subrelation is linearly independent.
36
- for (size_t r = 0 ; r < trace. size () ; ++r) {
39
+ for (size_t r = 0 ; r < num_rows ; ++r) {
37
40
Relation::accumulate (result, get_row (trace, r), get_test_params (), 1 );
38
41
for (size_t j : subrelations) {
39
42
if (subrelation_is_linearly_independent<Relation>(j) && !result[j].is_zero ()) {
@@ -65,7 +68,7 @@ void check_relation(const tracegen::TestTraceContainer& trace, Ts... subrelation
65
68
{
66
69
std::array<size_t , sizeof ...(Ts)> subrelations = { subrelation... };
67
70
detail::check_relation_internal<Relation>(
68
- trace.as_rows (), subrelations, [](const auto & trace, size_t r) { return trace.at (r); });
71
+ trace.as_rows (), subrelations, trace. get_num_rows (), [](const auto & trace, size_t r) { return trace.at (r); });
69
72
}
70
73
71
74
template <typename Relation> void check_relation (const tracegen::TestTraceContainer& trace)
@@ -93,8 +96,8 @@ template <typename Lookup> void check_interaction(const tracegen::TestTraceConta
93
96
[&]<size_t ... Is>(std::index_sequence<Is...>) {
94
97
constexpr std::array<size_t , sizeof ...(Is)> subrels = { Is... };
95
98
detail::check_relation_internal<Lookup>(
96
- polys, subrels, [](const auto & polys, size_t r) { return polys.get_row (r); });
99
+ polys, subrels, num_rows, [](const auto & polys, size_t r) { return polys.get_row (r); });
97
100
}(std::make_index_sequence<Lookup::SUBRELATION_PARTIAL_LENGTHS.size ()>());
98
101
}
99
102
100
- } // namespace bb::avm2::constraining
103
+ } // namespace bb::avm2::constraining
0 commit comments