Skip to content

Commit

Permalink
add _no_check targets
Browse files Browse the repository at this point in the history
  • Loading branch information
CblPOK-git committed Apr 16, 2024
1 parent 6a90049 commit 18711a3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
- name: Build assignment tables(.tbl) of the C++ examples
run: |
cmake --build build -t cpp_examples_generate_tbl
cmake --build build -t cpp_examples_generate_tbl_no_check
ls -al ./build/examples/cpp
- name: Run size estimation for C++ examples
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Build assignment tables(.tbl) of the C++ examples
run: |
cmake --build build -t cpp_examples_generate_tbl
cmake --build build -t cpp_examples_generate_tbl_no_check
ls -al ./build/examples/cpp
- name: Run size estimation for C++ examples
Expand Down
2 changes: 1 addition & 1 deletion bin/assigner/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ int curve_dependent_main(std::string bytecode_file_name,
BOOST_LOG_TRIVIAL(debug) << "overall_table_printing_duration: " << overall_table_printing_duration.count() << "ms";

auto check_validity_start = std::chrono::high_resolution_clock::now();
if (check_validity && gen_mode.has_assignments() && gen_mode.has_circuit()) {
if (check_validity && gen_mode.has_assignments()) {
if (assigner_instance.assignments.size() == 1 && (target_prover == 0 || target_prover == invalid_target_prover)) {
ASSERT_MSG(nil::blueprint::is_satisfied(assigner_instance.circuits[0].get(), assigner_instance.assignments[0].get()),
"The circuit is not satisfied");
Expand Down
27 changes: 27 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ function(assign_ir)
COMMAND_EXPAND_LISTS
VERBATIM)

add_custom_target(${target}_generate_both_no_check
COMMAND $<TARGET_FILE:assigner>
-b ${binary_name}
-i ${INPUTS_DIR}/${input}
${minus_p} ${private_input_string}
-c circuit_${target}.crct
-t assignment_${target}.tbl -e ${curve_type}
--generate-type circuit-assignment
${max_num_provers_flag} ${max_num_provers_amount}
${arithmetization_flag} ${arithmetization_amount}
DEPENDS ${target} ${INPUTS_DIR}/${input} $<TARGET_FILE:assigner>
COMMAND_EXPAND_LISTS
VERBATIM)

add_custom_target(${target}_generate_tbl
COMMAND $<TARGET_FILE:assigner>
-b ${binary_name}
Expand All @@ -69,6 +83,19 @@ function(assign_ir)
COMMAND_EXPAND_LISTS
VERBATIM)

add_custom_target(${target}_generate_tbl_no_check
COMMAND $<TARGET_FILE:assigner>
-b ${binary_name}
-i ${INPUTS_DIR}/${input}
${minus_p} ${private_input_string}
-t assignment_${target}.tbl -e ${curve_type}
--generate-type assignment
${max_num_provers_flag} ${max_num_provers_amount}
${arithmetization_flag} ${arithmetization_amount}
DEPENDS ${target} ${INPUTS_DIR}/${input} $<TARGET_FILE:assigner>
COMMAND_EXPAND_LISTS
VERBATIM)

add_custom_target(${target}_estimate_size
COMMAND $<TARGET_FILE:assigner>
-b ${binary_name}
Expand Down
4 changes: 4 additions & 0 deletions examples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
add_custom_target(compile_cpp_examples)
add_custom_target(cpp_examples_generate_tbl)
add_custom_target(cpp_examples_generate_tbl_no_check)
add_custom_target(cpp_examples_generate_crct)
add_custom_target(cpp_examples_generate_both)
add_custom_target(cpp_examples_generate_both_no_check)
add_custom_target(prove_cpp_examples)
add_custom_target(cpp_examples_estimate_size)

Expand Down Expand Up @@ -68,8 +70,10 @@ function(add_example_without_proving example_target)
assign_ir(${example_target} ${binary_name} ${ARG_INPUT} ${ARG_PRIVATE_INPUT} ${ARG_CURVE_TYPE} ${ARG_ARITHMETIZARION} ${ARG_MAX_NUM_PROVERS})

add_dependencies(cpp_examples_generate_tbl ${example_target}_generate_tbl)
add_dependencies(cpp_examples_generate_tbl_no_check ${example_target}_generate_tbl_no_check)
add_dependencies(cpp_examples_generate_crct ${example_target}_generate_crct)
add_dependencies(cpp_examples_generate_both ${example_target}_generate_both)
add_dependencies(cpp_examples_generate_both_no_check ${example_target}_generate_both_no_check)
add_dependencies(cpp_examples_estimate_size ${example_target}_estimate_size)
endfunction()

Expand Down

0 comments on commit 18711a3

Please sign in to comment.