-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(bb): make compile on stock mac clang #8278
Changes from 2 commits
34132c3
898ac9b
08860d4
8363ddd
d467d35
0727a60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,9 +134,9 @@ TYPED_TEST(KZGTest, GeminiShplonkKzgWithShift) | |
std::string label = "Gemini:a_" + std::to_string(l); | ||
const auto& evaluation = gemini_opening_pairs[l + 1].evaluation; | ||
prover_transcript->send_to_verifier(label, evaluation); | ||
opening_claims.emplace_back(gemini_witnesses[l], gemini_opening_pairs[l]); | ||
opening_claims.push_back({gemini_witnesses[l], gemini_opening_pairs[l]}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: vscode may complain, please don't change it back :) |
||
} | ||
opening_claims.emplace_back(gemini_witnesses[log_n], gemini_opening_pairs[log_n]); | ||
opening_claims.push_back({gemini_witnesses[log_n], gemini_opening_pairs[log_n]}); | ||
|
||
// Shplonk prover output: | ||
// - opening pair: (z_challenge, 0) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,27 +4,27 @@ | |
|
||
namespace bb::crypto::merkle_tree { | ||
/** | ||
* @brief Used in parallel insertions in the the IndexedTree. Workers signal to other following workes as they move up | ||
* @brief Used in parallel insertions in the IndexedTree. Workers signal to other following workes as they move up | ||
* the level of the tree. | ||
* | ||
*/ | ||
class Signal { | ||
public: | ||
Signal(uint32_t initial_level = 1) | ||
: signal_(initial_level){}; | ||
explicit Signal(uint32_t initial_level = 1) | ||
: signal_(std::make_unique<std::atomic<uint32_t>>(initial_level)){}; | ||
~Signal() = default; | ||
Signal(const Signal& other) | ||
: signal_(other.signal_.load()) | ||
: signal_(std::make_unique<std::atomic<uint32_t>>(other.signal_->load())) | ||
{} | ||
Signal(const Signal&& other) = delete; | ||
Signal(Signal&& other) = default; | ||
Signal& operator=(const Signal& other) | ||
{ | ||
if (this != &other) { | ||
signal_.store(other.signal_.load()); | ||
signal_->store(other.signal_->load()); | ||
} | ||
return *this; | ||
} | ||
Signal& operator=(const Signal&& other) = delete; | ||
Signal& operator=(Signal&& other) = default; | ||
|
||
/** | ||
* @brief Causes the thread to wait until the required level has been signalled | ||
|
@@ -33,10 +33,10 @@ class Signal { | |
*/ | ||
void wait_for_level(uint32_t level = 0) | ||
{ | ||
uint32_t current_level = signal_.load(); | ||
uint32_t current_level = signal_->load(); | ||
while (current_level > level) { | ||
signal_.wait(current_level); | ||
current_level = signal_.load(); | ||
signal_->wait(current_level); | ||
current_level = signal_->load(); | ||
} | ||
} | ||
|
||
|
@@ -47,17 +47,18 @@ class Signal { | |
*/ | ||
void signal_level(uint32_t level = 0) | ||
{ | ||
signal_.store(level); | ||
signal_.notify_all(); | ||
signal_->store(level); | ||
signal_->notify_all(); | ||
} | ||
|
||
void signal_decrement(uint32_t delta = 1) | ||
{ | ||
signal_.fetch_sub(delta); | ||
signal_.notify_all(); | ||
signal_->fetch_sub(delta); | ||
signal_->notify_all(); | ||
} | ||
|
||
private: | ||
std::atomic<uint32_t> signal_; | ||
// apple clang has issues if this cannot be move-constructed, so we wrap in unique_ptr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. std::atomic seems a bit useless for storing in containers without a move constructor - wrap it |
||
std::unique_ptr<std::atomic<uint32_t>> signal_; | ||
}; | ||
} // namespace bb::crypto::merkle_tree |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <cstddef> | ||
namespace bb::crypto::merkle_tree { | ||
using index_t = uint64_t; | ||
using index_t = size_t; | ||
} // namespace bb::crypto::merkle_tree |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
#include "barretenberg/vm/avm/trace/helper.hpp" | ||
#include "barretenberg/vm/constants.hpp" | ||
#include "common.test.hpp" | ||
#include <bits/utility.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gcc internals |
||
|
||
namespace tests_avm { | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this was here, we can just target aarch64