Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwards2225 committed Nov 30, 2023
1 parent cf12dac commit 407e298
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@ void UltraCircuitBuilder_<Arithmetization>::add_gates_to_ensure_all_polys_are_no
check_selector_length_consistency();
++this->num_gates;

info("in ultra builder method.");
info("q_arith size = ", q_arith.size());
info("w_l size = ", w_l.size());
info("w_r size = ", w_r.size());

// Some relations depend on wire shifts so we add another gate with
// wires set to 0 to ensure corresponding constraints are satisfied
create_poly_gate({ this->zero_idx, this->zero_idx, this->zero_idx, 0, 0, 0, 0, 0 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,21 +678,23 @@ class UltraCircuitBuilder_ : public CircuitBuilderBase<typename Arithmetization:
};
~UltraCircuitBuilder_() override = default;

/**
* @brief Debug helper method for ensuring all selectors have the same size
* @details Each gate construction method manually appends values to the selectors. Failing to update one of the
* selectors will lead to an unsatisfiable circuit. This method provides a mechanism for ensuring that each selector
* has been updated as expected. Its logic is only active in debug mode.
*
*/
void check_selector_length_consistency()
{
bool sizes_consistent = true;
#if NDEBUG
// do nothing
#else
size_t nominal_size = selectors.get()[0].size();
// for (auto& selector : selectors.get()) {
for (size_t idx = 0; idx < selectors.get().size(); ++idx) {
sizes_consistent = sizes_consistent && (selectors.get()[idx].size() == nominal_size);
}
if (!sizes_consistent) {
for (size_t idx = 0; idx < selectors.get().size(); ++idx) {
info("idx = ", idx);
info(selectors.get()[idx].size());
}
ASSERT(selectors.get()[idx].size() == nominal_size);
}
ASSERT(sizes_consistent);
#endif // NDEBUG
}

void finalize_circuit();
Expand Down
27 changes: 0 additions & 27 deletions barretenberg/cpp/src/barretenberg/ultra_honk/ultra_prover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,32 +100,6 @@ template <UltraFlavor Flavor> void UltraProver_<Flavor>::execute_log_derivative_
if constexpr (IsGoblinFlavor<Flavor>) {
instance->compute_logderivative_inverse(beta, gamma);

for (size_t i = 0; i < instance->proving_key->lookup_inverses.size(); ++i) {
if (instance->proving_key->lookup_inverses[i] != 0) {
info("lookup_inverses nonzero at idx ", i);
info("instance->proving_key->lookup_inverses[i] = ", instance->proving_key->lookup_inverses[i]);
}
if (instance->proving_key->q_busread[i] != 0) {
info("q_busread nonzero at idx ", i);
info("instance->proving_key->q_busread[i] = ", instance->proving_key->q_busread[i]);
info("instance->proving_key->w_l[i] = ", instance->proving_key->w_l[i]);
info("instance->proving_key->w_r[i] = ", instance->proving_key->w_r[i]);
}
if (instance->proving_key->calldata_read_counts[i] != 0) {
info("calldata_read_counts nonzero at idx ", i);
info("instance->proving_key->calldata_read_counts[i] = ",
instance->proving_key->calldata_read_counts[i]);
info("instance->proving_key->calldata[i] = ", instance->proving_key->calldata[i]);
info("instance->proving_key->databus_id[i] = ", instance->proving_key->databus_id[i]);
}
if (i == 137323 || i == 137325) {
info("i = ", i);
info("instance->proving_key->q_busread[i] = ", instance->proving_key->q_busread[i]);
info("instance->proving_key->w_l[i] = ", instance->proving_key->w_l[i]);
info("instance->proving_key->w_r[i] = ", instance->proving_key->w_r[i]);
}
}

auto lookup_inverses_commitment = commitment_key->commit(instance->proving_key->lookup_inverses);
transcript.send_to_verifier(commitment_labels.lookup_inverses, lookup_inverses_commitment);
}
Expand Down Expand Up @@ -156,7 +130,6 @@ template <UltraFlavor Flavor> void UltraProver_<Flavor>::execute_relation_check_

auto sumcheck = Sumcheck(instance->proving_key->circuit_size, transcript);
instance->alpha = transcript.get_challenge("alpha");
info("prover alpha = ", instance->alpha);
sumcheck_output = sumcheck.prove(instance);
}

Expand Down

0 comments on commit 407e298

Please sign in to comment.