Skip to content
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
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

577 new fast tbl #611

wants to merge 18 commits into from

Conversation

CblPOK-git
Copy link
Contributor

@CblPOK-git CblPOK-git commented Jun 13, 2024

Works fine except last commit, revert it and everything will work fine. Is compatible with old version of crypto3 that is not monorep yet and consists of 15 libraries, so please don't delete these libraries.

Possible assigner modes:
circuit: generate crct, table_pieces, table header, constants and selectors using IR.
assignment: generate witness and public_input using IR.
assignment-fast: generate witness and public_input using table pieces and table_header + constants
circuit-assignment: generate everything using IR.
public-input-column: generate public_input using IR.
size_estimation: count components amount using IR

@CblPOK-git CblPOK-git self-assigned this Jun 13, 2024
@CblPOK-git CblPOK-git force-pushed the 577-new-fast-tbl branch 2 times, most recently from 10af322 to 8521548 Compare June 13, 2024 14:11
@CblPOK-git CblPOK-git force-pushed the 577-new-fast-tbl branch 7 times, most recently from c5bbcfe to c6d39d3 Compare June 14, 2024 10:39
@CblPOK-git CblPOK-git requested a review from akokoshn June 14, 2024 10:52
@CblPOK-git CblPOK-git marked this pull request as ready for review June 14, 2024 10:52
nil::blueprint::assigner<BlueprintFieldType> &assigner_instance,
const std::size_t &ComponentConstantColumns,
const std::size_t &ComponentSelectorColumns
nil::blueprint::assigner<BlueprintFieldType> &assigner_instance

Choose a reason for hiding this comment

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

why not
const std::vector<assignment_proxy<ArithmetizationType>>& assignments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why should be? Earlier it was assigner_instance too, just implemented needed feature with minimal change in the existing code

Choose a reason for hiding this comment

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

i guess it good time for fix this palace, or using const here leads problems?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

const will work

bin/assigner/src/main.cpp Outdated Show resolved Hide resolved
bin/assigner/src/main.cpp Show resolved Hide resolved
bin/assigner/src/main.cpp Outdated Show resolved Hide resolved
Copy link

@akokoshn akokoshn left a comment

Choose a reason for hiding this comment

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

Could you please add to the PR description all possible modes run assigner: mode, required inputs, outputs

bin/recursive_gen/src/main.cpp Outdated Show resolved Hide resolved
bin/table_packing.hpp Outdated Show resolved Hide resolved
bin/table_packing.hpp Outdated Show resolved Hide resolved
examples/CMakeLists.txt Outdated Show resolved Hide resolved
@@ -62,6 +67,7 @@ function(assign_ir)
-i ${INPUTS_DIR}/${input}
${minus_p} ${private_input_string}
-c circuit_${target}.crct
-j table_pieces_${target}.json

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?

Copy link
Contributor Author

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

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 used generate_both

Copy link
Contributor Author

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?

@@ -849,24 +1220,41 @@ int main(int argc, char *argv[]) {
public_input_file_name = vm["public-input"].as<std::string>();
}

if (gen_mode.has_assignments()) {
if (gen_mode.has_circuit() || gen_mode.has_fast_tbl() || gen_mode.has_slow_tbl()) {

Choose a reason for hiding this comment

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

We should not ask assignment-table file name for pure circuit generation mode (even if table somehow generated for calculate used rows)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pure circuit generation mode generates constants and selectors part of the assignment table so assignment table file name is needed. Other question is that it may be more reasonable to use circuit file name for constants and selectors, like that:
circuit_file_name.crct
selectors_circuit_file_name.crct
table_header_circuit_file_name.crct
constants_circuit_file_name.crct
witness_assignment_file_name.tbl
pub_inp_assignment_file_name.tbl

I think I will do in that way if you don't mind

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.

2 participants