Skip to content

Commit

Permalink
fix: Use correct PG degree adjustment in log deriv lookup relation (#…
Browse files Browse the repository at this point in the history
…7863)

In issue AztecProtocol/barretenberg#1036 I
noted that it seemed like all of the lookup tests passed with a
seemingly lower than necessary relation degree adjustment for PG (where
challenges become univariates and thus contribute to the degree). It
turns out that achieving the maximum theoretical degree for this
relation is somewhat of an edge case and was simply never triggered by
any of our tests. I finally triggered it in another PR but I'm putting
this fix in separately so they're not connected.

Also made an unrelated fix to the way the circuit size is determined
based on lookups in Honk.

Closes AztecProtocol/barretenberg#1036
  • Loading branch information
ledwards2225 authored Aug 9, 2024
1 parent 2c5d807 commit 87c940d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ template <typename FF_> class LogDerivLookupRelationImpl {
3, // log derivative lookup argument sub-relation
};

// TODO(https://github.com/AztecProtocol/barretenberg/issues/1036): Scrutinize these adjustment factors. Counting
// degrees suggests the first subrelation should require an adjustment of 2.
// Note: the required correction for the second sub-relation is technically +1 but the two corrections must agree
// due to the way the relation algebra is written so both are set to +2.
static constexpr std::array<size_t, 2> TOTAL_LENGTH_ADJUSTMENTS{
1, // inverse construction sub-relation
1 // log derivative lookup argument sub-relation
2, // inverse construction sub-relation
2 // log derivative lookup argument sub-relation
};

static constexpr std::array<bool, 2> SUBRELATION_LINEARLY_INDEPENDENT = { true, false };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace bb {
*/
template <class Flavor> size_t ProverInstance_<Flavor>::compute_dyadic_size(Circuit& circuit)
{
// minimum circuit size due to lookup argument
const size_t min_size_due_to_lookups = circuit.get_tables_size() + circuit.get_lookups_size();
// for the lookup argument the circuit size must be at least as large as the sum of all tables used
const size_t min_size_due_to_lookups = circuit.get_tables_size();

// minimum size of execution trace due to everything else
size_t min_size_of_execution_trace = circuit.public_inputs.size() + circuit.num_gates;
Expand Down

0 comments on commit 87c940d

Please sign in to comment.