Skip to content

Cl/mum merge#4

Merged
charlielye merged 11 commits into
aztec3from
cl/mum_merge
Dec 16, 2022
Merged

Cl/mum merge#4
charlielye merged 11 commits into
aztec3from
cl/mum_merge

Conversation

@charlielye

Copy link
Copy Markdown

No description provided.

@charlielye charlielye changed the base branch from master to aztec3 December 14, 2022 19:11
Comment thread cpp/CMakeLists.txt Outdated
@@ -0,0 +1,294 @@
/*

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why two blake3s and blake3s_full? Pls keep just one.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: as a separate PR after this one's merged.

Comment thread cpp/dockerfiles/Dockerfile.arm64-linux-gcc Outdated
@@ -18,7 +18,6 @@ namespace {
auto& engine = numeric::random::get_debug_engine();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of srs as a dependency of ecc? Because its used only in the tests.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: do this as a separate PR, one idea can be to filter out io as its own module for read-write of transcripts. That will help us get rid of the circular dependency.

}

WASM_EXPORT void prover_process_queue(waffle::TurboProver* prover)
typedef std::conditional_t<waffle::SYSTEM_COMPOSER == waffle::TURBO, waffle::TurboProver, waffle::UltraProver>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prover should not be a compile time but runtime declaration. Use polymorphism (assign someone, should be done in a fresh PR)


monomials_[0] = barretenberg::g1::affine_one;
size_t index = 0;
if (!is_lagrange) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: this conditional logic to handle the generator $[1]_1 \in \mathbb{G}_1$ creates the need for is_lagrange variable. If we can add $[1]_1$ to the first monomial transcript, we can get rid of this is_lagrange. Do this as a fresh PR.


circuit_proving_key->recursive_proof_public_input_indices =
std::vector<uint32_t>(recursive_proof_public_input_indices.begin(), recursive_proof_public_input_indices.end());
// What does this line do exactly?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: contains_recursive_proof was removed from the proving key iirc. Check this.

}

WASM_EXPORT size_t prover_get_circuit_size(waffle::TurboProver* prover)
WASM_EXPORT size_t prover_get_circuit_size(WasmProver* prover)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Longer term, we want to use only the unrolled prover, so we should get rid of the linearised prover to reduce some code complexity.

barretenberg::polynomial& w_4_lagrange = key->polynomial_cache.get(wire_tag + "_lagrange");
// barretenberg::polynomial& wire_fft = key->polynomial_cache.get(wire_tag + "_fft");
barretenberg::polynomial w_4(key->n);
// barretenberg::polynomial_arithmetic::copy_polynomial(&wire[0], &wire_fft[0], n, n);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: get rid of commented out parts.

@@ -49,17 +49,30 @@ void ifft_with_constant(fr* coeffs, const evaluation_domain& domain, const fr& v
void coset_ifft(fr* coeffs, const evaluation_domain& domain);
void coset_ifft(std::vector<fr*> coeffs, const evaluation_domain& domain);

void partial_fft_serial_inner(fr* coeffs,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: check if these functions are tested.

@@ -254,8 +255,8 @@ bool verify_proof(waffle::plonk_proof const& proof)
UnrolledVerifier verifier(verification_key,
Composer::create_unrolled_manifest(verification_key->num_public_inputs));

std::unique_ptr<waffle::KateCommitmentScheme<waffle::unrolled_turbo_settings>> kate_commitment_scheme =
std::make_unique<waffle::KateCommitmentScheme<waffle::unrolled_turbo_settings>>();
std::unique_ptr<waffle::KateCommitmentScheme<waffle::unrolled_ultra_settings>> kate_commitment_scheme =

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO (future): make this composer-agnostic.

Comment thread cpp/ultra_dev_tests.sh
@@ -0,0 +1,14 @@
#!/bin/zsh

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this? (ask Cody)

@@ -13,14 +14,14 @@ using namespace plonk;
namespace {
auto& engine = numeric::random::get_debug_engine();
}
typedef stdlib::packed_byte_array<waffle::TurboComposer> packed_byte_array;
typedef stdlib::byte_array<waffle::TurboComposer> byte_array;
typedef stdlib::packed_byte_array<waffle::UltraComposer> packed_byte_array;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: use Composer from types.hpp.

: typeid(composer) == typeid(waffle::TurboComposer) ? "TurboPlonk" : "NULLPlonk")
(typeid(composer) == typeid(waffle::StandardComposer) ? "StandardPlonk" \
: typeid(composer) == typeid(waffle::TurboComposer) ? "TurboPlonk" \
: "NULLPlonk")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: why NULLPlonk?

Comment thread cpp/src/aztec/stdlib/encryption/aes128/aes128.cpp
@charlielye charlielye merged commit 1fd4749 into aztec3 Dec 16, 2022
@charlielye charlielye deleted the cl/mum_merge branch December 16, 2022 11:23
charlielye added a commit that referenced this pull request Dec 16, 2022
* Fix to bootstrap.sh after move into submodule (#1)

* Updated bootstrap now that bberg may be a submodule, and now that cpp subdir exists

* fix gitignore, wasnt properly ignoring cpp/build*

* fix the barretenberg cpp formatting pre-commit hook now that barretenberg iss its own repo and may be a submodule

* Contrived change.

* Revert "Contrived change."

This reverts commit 68aff9c.

* Revert "Revert "Contrived change.""

This reverts commit 3eee2fd.

* Introduce cpp to paths.

* More cpp path.

* Cl/mum merge (#4)

* Initial merge. Still has conflicts.

* Tidied up bigfield and biggroup

* Builds.

* Order constants.

* Fix.

* Make more tests pass.

* Update circuit change detection stuff to be local to tests.

* Include header.

* Cleanup and settings.

* Path updates.

* Path updates.

Co-authored-by: Rumata888 <isennovskiy@gmail.com>

Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com>
Co-authored-by: Rumata888 <isennovskiy@gmail.com>
dbanks12 added a commit that referenced this pull request Jan 26, 2023
* Fix to bootstrap.sh after move into submodule (#1)

* Updated bootstrap now that bberg may be a submodule, and now that cpp subdir exists

* fix gitignore, wasnt properly ignoring cpp/build*

* fix the barretenberg cpp formatting pre-commit hook now that barretenberg iss its own repo and may be a submodule

* Contrived change.

* Revert "Contrived change."

This reverts commit 68aff9c.

* Revert "Revert "Contrived change.""

This reverts commit 3eee2fd.

* Introduce cpp to paths.

* More cpp path.

* Cl/mum merge (#4)

* Initial merge. Still has conflicts.

* Tidied up bigfield and biggroup

* Builds.

* Order constants.

* Fix.

* Make more tests pass.

* Update circuit change detection stuff to be local to tests.

* Include header.

* Cleanup and settings.

* Path updates.

* Path updates.

Co-authored-by: Rumata888 <isennovskiy@gmail.com>

Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com>
Co-authored-by: Rumata888 <isennovskiy@gmail.com>
dbanks12 added a commit that referenced this pull request Jan 27, 2023
* Fix to bootstrap.sh after move into submodule (#1)

* Updated bootstrap now that bberg may be a submodule, and now that cpp subdir exists

* fix gitignore, wasnt properly ignoring cpp/build*

* fix the barretenberg cpp formatting pre-commit hook now that barretenberg iss its own repo and may be a submodule

* Contrived change.

* Revert "Contrived change."

This reverts commit 68aff9c.

* Revert "Revert "Contrived change.""

This reverts commit 3eee2fd.

* Introduce cpp to paths.

* More cpp path.

* Cl/mum merge (#4)

* Initial merge. Still has conflicts.

* Tidied up bigfield and biggroup

* Builds.

* Order constants.

* Fix.

* Make more tests pass.

* Update circuit change detection stuff to be local to tests.

* Include header.

* Cleanup and settings.

* Path updates.

* Path updates.

Co-authored-by: Rumata888 <isennovskiy@gmail.com>

Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com>
Co-authored-by: Rumata888 <isennovskiy@gmail.com>
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 22, 2023
* Fix to bootstrap.sh after move into submodule (AztecProtocol/barretenberg#1)

* Updated bootstrap now that bberg may be a submodule, and now that cpp subdir exists

* fix gitignore, wasnt properly ignoring cpp/build*

* fix the barretenberg cpp formatting pre-commit hook now that barretenberg iss its own repo and may be a submodule

* Contrived change.

* Revert "Contrived change."

This reverts commit f01a24e76362ed98875b7ad027ccce32802f3584.

* Revert "Revert "Contrived change.""

This reverts commit e500666fdcb9fb7d684a5fb717268fd0c6c88aea.

* Introduce cpp to paths.

* More cpp path.

* Cl/mum merge (AztecProtocol/barretenberg#4)

* Initial merge. Still has conflicts.

* Tidied up bigfield and biggroup

* Builds.

* Order constants.

* Fix.

* Make more tests pass.

* Update circuit change detection stuff to be local to tests.

* Include header.

* Cleanup and settings.

* Path updates.

* Path updates.

Co-authored-by: Rumata888 <isennovskiy@gmail.com>

Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com>
Co-authored-by: Rumata888 <isennovskiy@gmail.com>
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 24, 2023
* Fix to bootstrap.sh after move into submodule (AztecProtocol/barretenberg#1)

* Updated bootstrap now that bberg may be a submodule, and now that cpp subdir exists

* fix gitignore, wasnt properly ignoring cpp/build*

* fix the barretenberg cpp formatting pre-commit hook now that barretenberg iss its own repo and may be a submodule

* Contrived change.

* Revert "Contrived change."

This reverts commit a474f39b35fd024cc8be65dd8668124913da909e.

* Revert "Revert "Contrived change.""

This reverts commit 7a2ea1bcf35f1fa8b6d42bed7cf36d112ccafd45.

* Introduce cpp to paths.

* More cpp path.

* Cl/mum merge (AztecProtocol/barretenberg#4)

* Initial merge. Still has conflicts.

* Tidied up bigfield and biggroup

* Builds.

* Order constants.

* Fix.

* Make more tests pass.

* Update circuit change detection stuff to be local to tests.

* Include header.

* Cleanup and settings.

* Path updates.

* Path updates.

Co-authored-by: Rumata888 <isennovskiy@gmail.com>

Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com>
Co-authored-by: Rumata888 <isennovskiy@gmail.com>
@ludamad ludamad mentioned this pull request Mar 26, 2024
AztecBot pushed a commit that referenced this pull request Jun 7, 2024
Overview:
If you are in a scenario where you have a failing call to check_circuit
and wish to get more information out of it than just the gate index, you
can use this feature to get a stack trace, see example below.

Usage instructions:
- On ubuntu (or our mainframe accounts) use `sudo apt-get install
libdw-dev` to support trace printing
- Use `cmake --preset clang16-dbg-fast-circuit-check-traces` and `cmake
--build --preset clang16-dbg-fast-circuit-check-traces` to enable the
backward-cpp dependency through the CHECK_CIRCUIT_STACKTRACES CMake
variable.
- Run any case where you have a failing check_circuit call, you will now
have a stack trace illuminating where this constraint was added in code.

Caveats:
- This works best for code that is not overly generic, i.e. where just
the sequence of function calls carries a lot of information. It is
possible to tag extra data along with the stack trace, this can be done
as a followup, please leave feedback if desired.
- There are certain functions like `assert_equals` that can cause gates
that occur _before_ them to fail. If this would be useful to
automatically report, please leave feedback.

Example:
```
[ RUN      ] standard_circuit_constructor.test_check_circuit_broken
Stack trace (most recent call last):
#4    Source "_deps/gtest-src/googletest/src/gtest.cc", line 2845, in Run
       2842:   if (!Test::HasFatalFailure() && !Test::IsSkipped()) {
       2843:     // This doesn't throw as all user code that can throw are wrapped into
       2844:     // exception handling code.
      >2845:     test->Run();
       2846:   }
       2847: 
       2848:   if (test != nullptr) {
#3    Source "_deps/gtest-src/googletest/src/gtest.cc", line 2696, in Run
       2693:   // GTEST_SKIP().
       2694:   if (!HasFatalFailure() && !IsSkipped()) {
       2695:     impl->os_stack_trace_getter()->UponLeavingGTest();
      >2696:     internal::HandleExceptionsInMethodIfSupported(this, &Test::TestBody,
       2697:                                                   "the test body");
       2698:   }
#2  | Source "_deps/gtest-src/googletest/src/gtest.cc", line 2657, in HandleSehExceptionsInMethodIfSupported<testing::Test, void>
    |  2655: #if GTEST_HAS_EXCEPTIONS
    |  2656:     try {
    | >2657:       return HandleSehExceptionsInMethodIfSupported(object, method, location);
    |  2658:     } catch (const AssertionException&) {  // NOLINT
    |  2659:       // This failure was reported already.
      Source "_deps/gtest-src/googletest/src/gtest.cc", line 2621, in HandleExceptionsInMethodIfSupported<testing::Test, void>
       2618:   }
       2619: #else
       2620:   (void)location;
      >2621:   return (object->*method)();
       2622: #endif  // GTEST_HAS_SEH
       2623: }
#1    Source "/mnt/user-data/adam/aztec-packages/barretenberg/cpp/src/barretenberg/circuit_checker/standard_circuit_builder.test.cpp", line 464, in TestBody
        461:     uint32_t d_idx = circuit_constructor.add_variable(d);
        462:     circuit_constructor.create_add_gate({ a_idx, b_idx, c_idx, fr::one(), fr::one(), fr::neg_one(), fr::zero() });
        463: 
      > 464:     circuit_constructor.create_add_gate({ d_idx, c_idx, a_idx, fr::one(), fr::neg_one(), fr::neg_one(), fr::zero() });
        465: 
        466:     bool result = CircuitChecker::check(circuit_constructor);
        467:     EXPECT_EQ(result, false);
#0    Source "/mnt/user-data/adam/aztec-packages/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/standard_circuit_builder.cpp", line 22, in create_add_gate
         19: {
         20:     this->assert_valid_variables({ in.a, in.b, in.c });
         21: 
      >  22:     blocks.arithmetic.populate_wires(in.a, in.b, in.c);
         23:     blocks.arithmetic.q_m().emplace_back(FF::zero());
         24:     blocks.arithmetic.q_1().emplace_back(in.a_scaling);
         25:     blocks.arithmetic.q_2().emplace_back(in.b_scaling);
gate number4
```
AztecBot added a commit that referenced this pull request Dec 3, 2025
BEGIN_COMMIT_OVERRIDE
chore: cycle group cleanup #3 (#16902)
fix: improve polynomial structuring in translator and fix bug (#16941)
refactor(bb): thread chunk for better work distribution (#16966)
fix(bb): shell injection vectors (#16958)
chore: cycle group cleanup #4 (#16937)
fix: use consistent default build dir in benchmark_remote.sh (#17047)
fix: misuse of slice() in cycle_scalar (#16982)
vks update
docs: improve some Protogalaxy and Translator docs (#17035)
fix: edge case in the ECCVM related to splitting scalars (#16816)
update vks hash
chore: return of the instance (#17043)
a second attempt at VK update
fix: chmod +x test_civc_standalone_vks_havent_changed.sh
fix avm build and update vks
chore: Gemini high degree test (#17055)
fix: update-vk
refactor(bb): Optimize interleaved polynomial batching in Gemini with
parallel chunking (#17049)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants