-
Notifications
You must be signed in to change notification settings - Fork 48
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
577 new fast tbl #611
Open
CblPOK-git
wants to merge
18
commits into
master
Choose a base branch
from
577-new-fast-tbl
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
577 new fast tbl #611
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
36befe1
add _generate_tbl_fast target
CblPOK-git b6fa261
add larger poseidon merkle tree example
CblPOK-git 724ea57
add table_pieces handling into assigner main
CblPOK-git 359994e
store different column types in different files, read constants from …
CblPOK-git 905b062
add used_rows and to_be_shared reading/writing
CblPOK-git 0f407fb
handle fast table printing in assigner main
CblPOK-git 760ca50
update proof producer version in CI
CblPOK-git d9ecc1b
update assigner
CblPOK-git 74ab53c
update blueprint
CblPOK-git c480e5d
update crypto3
CblPOK-git 5c4e6b7
cleanup
CblPOK-git 5fd0f38
cleanup 2
CblPOK-git 9e17d89
cleanup 3
CblPOK-git 54b2a6a
cleanup 4
CblPOK-git ff38665
update assigner
CblPOK-git 64a6b7b
update crypto3
CblPOK-git e88603a
band-aid rust
CblPOK-git 6d8e3e7
store table pieces, constants and selectors in .crct files
CblPOK-git File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
std::string add_filename_prefix( | ||
const std::string& prefix, | ||
const std::string& file_name | ||
) { | ||
std::filesystem::path path(file_name); | ||
std::filesystem::path parent_path = path.parent_path(); | ||
std::filesystem::path filename = path.filename(); | ||
|
||
std::string new_filename = prefix + filename.string(); | ||
std::filesystem::path new_path = parent_path / new_filename; | ||
|
||
return new_path.string(); | ||
} | ||
|
||
|
||
bool append_binary_file_content_to_vector ( | ||
std::vector<std::uint8_t>& result_vector, | ||
const std::string& prefix, | ||
const std::string& assignment_table_file_name | ||
|
||
) { | ||
std::ifstream icolumn; | ||
icolumn.open(add_filename_prefix(prefix, assignment_table_file_name), std::ios_base::binary | std::ios_base::in); | ||
if (!icolumn) { | ||
std::cout << "Cannot open " << add_filename_prefix(prefix, assignment_table_file_name) << std::endl; | ||
return false; | ||
} | ||
icolumn.seekg(0, std::ios_base::end); | ||
const auto input_size = icolumn.tellg(); | ||
std::size_t old_size = result_vector.size(); | ||
result_vector.resize(old_size + input_size); | ||
icolumn.seekg(0, std::ios_base::beg); | ||
icolumn.read(reinterpret_cast<char*>(result_vector.data() + old_size), input_size); | ||
icolumn.close(); | ||
return true; | ||
} | ||
|
||
template<typename marshalling_type> | ||
void unmarshall_from_vector ( | ||
const std::vector<std::uint8_t>& v, | ||
marshalling_type& marhsalling_data | ||
) { | ||
auto vect_iterator = v.begin(); | ||
auto marshalling_status = marhsalling_data.read(vect_iterator, v.size()); | ||
ASSERT(marshalling_status == nil::marshalling::status_type::success); | ||
} | ||
|
||
template<typename marshalling_type> | ||
void extract_from_binary_file( | ||
marshalling_type& marshalling_file, | ||
const std::string& prefix, | ||
const std::string& file_name | ||
) { | ||
std::vector<std::uint8_t> file_vector = {}; | ||
ASSERT(append_binary_file_content_to_vector(file_vector, prefix, file_name)); | ||
unmarshall_from_vector<marshalling_type> (file_vector, marshalling_file); | ||
} | ||
|
||
template<typename marshalling_type> | ||
marshalling_type extract_table_from_binary_file( | ||
const std::string& file_name | ||
) { | ||
std::vector<std::uint8_t> file_vector = {}; | ||
ASSERT(append_binary_file_content_to_vector(file_vector, "header_", file_name)); | ||
ASSERT(append_binary_file_content_to_vector(file_vector, "witness_", file_name)); | ||
ASSERT(append_binary_file_content_to_vector(file_vector, "pub_inp_", file_name)); | ||
ASSERT(append_binary_file_content_to_vector(file_vector, "constants_", file_name)); | ||
ASSERT(append_binary_file_content_to_vector(file_vector, "selectors_", file_name)); | ||
marshalling_type marshalling_data; | ||
unmarshall_from_vector<marshalling_type> (file_vector, marshalling_data); | ||
return marshalling_data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why need
table_pieces
for generate both?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.
it includes generate_crct, and generate_crct generates table_pieces
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.
we should allow skip
table_pieces
command parameter if usedgenerate_both
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.
I don't like that idea, generate_both includes circuit and table generation, first one generates table_pieces. One would expect that circuit generation generates table pieces regardless of whether circuit and table are generated simultaneously or separately. contradicts the principle of least astonishment. And maybe there shouldn't be such thing as table_pieces_name at all. Just use table_pieces_circuit_file_name.crct. What do you think?