Skip to content

Conversation

@Sarkoxed
Copy link
Contributor

@Sarkoxed Sarkoxed commented Nov 10, 2025

Description

This PR adds documentation and cleans up the __barrett_reduction function.

Large docstring was added, explaining the final modulus subtraction.

Problem*

Resolves

Summary*

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ACIR Opcodes

Benchmark suite Current: fc4eecf Previous: 9085dd6 Ratio
add_BLS12_377Fq_Bench.json/main 29 acir_opcodes 29 acir_opcodes 1
add_BLS12_377Fr_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
add_BLS12_381Fq_Bench.json/main 29 acir_opcodes 29 acir_opcodes 1
add_BLS12_381Fr_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
add_BN254_Fq_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
add_U2048_Bench.json/main 127 acir_opcodes 127 acir_opcodes 1
add_U256_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
assert_is_not_equal_BLS12_377Fq_Bench.json/main 15 acir_opcodes 15 acir_opcodes 1
assert_is_not_equal_BLS12_377Fr_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
assert_is_not_equal_BLS12_381Fq_Bench.json/main 15 acir_opcodes 15 acir_opcodes 1
assert_is_not_equal_BLS12_381Fr_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
assert_is_not_equal_BN254_Fq_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
assert_is_not_equal_U2048_Bench.json/main 43 acir_opcodes 43 acir_opcodes 1
assert_is_not_equal_U256_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
batch_invert_10_elements_BLS12_377Fq_Bench.json/main 121 acir_opcodes 121 acir_opcodes 1
batch_invert_10_elements_BLS12_377Fr_Bench.json/main 91 acir_opcodes 91 acir_opcodes 1
batch_invert_10_elements_BLS12_381Fq_Bench.json/main 121 acir_opcodes 121 acir_opcodes 1
batch_invert_10_elements_BLS12_381Fr_Bench.json/main 91 acir_opcodes 91 acir_opcodes 1
batch_invert_10_elements_BN254_Fq_Bench.json/main 91 acir_opcodes 91 acir_opcodes 1
batch_invert_10_elements_U2048_Bench.json/main 541 acir_opcodes 541 acir_opcodes 1
batch_invert_10_elements_U256_Bench.json/main 91 acir_opcodes 91 acir_opcodes 1
cmp_BLS12_377Fq_Bench.json/main 52 acir_opcodes 52 acir_opcodes 1
cmp_BLS12_377Fr_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
cmp_BLS12_381Fq_Bench.json/main 52 acir_opcodes 52 acir_opcodes 1
cmp_BLS12_381Fr_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
cmp_BN254_Fq_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
cmp_U2048_Bench.json/main 206 acir_opcodes 206 acir_opcodes 1
cmp_U256_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
derive_from_seed_13_elements_BLS12_377Fq_Bench.json/main 2312 acir_opcodes 2312 acir_opcodes 1
derive_from_seed_13_elements_BLS12_377Fr_Bench.json/main 1705 acir_opcodes 1705 acir_opcodes 1
derive_from_seed_13_elements_BLS12_381Fq_Bench.json/main 2316 acir_opcodes 2316 acir_opcodes 1
derive_from_seed_13_elements_BLS12_381Fr_Bench.json/main 1705 acir_opcodes 1705 acir_opcodes 1
derive_from_seed_13_elements_BN254_Fq_Bench.json/main 1705 acir_opcodes 1705 acir_opcodes 1
derive_from_seed_13_elements_U2048_Bench.json/main 10554 acir_opcodes 10554 acir_opcodes 1
derive_from_seed_13_elements_U256_Bench.json/main 1697 acir_opcodes 1697 acir_opcodes 1
div_BLS12_377Fq_Bench.json/main 61 acir_opcodes 61 acir_opcodes 1
div_BLS12_377Fr_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
div_BLS12_381Fq_Bench.json/main 61 acir_opcodes 61 acir_opcodes 1
div_BLS12_381Fr_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
div_BN254_Fq_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
div_U2048_Bench.json/main 37 acir_opcodes 37 acir_opcodes 1
div_U256_Bench.json/main 7 acir_opcodes 7 acir_opcodes 1
eq_BLS12_377Fq_Bench.json/main 56 acir_opcodes 56 acir_opcodes 1
eq_BLS12_377Fr_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
eq_BLS12_381Fq_Bench.json/main 56 acir_opcodes 56 acir_opcodes 1
eq_BLS12_381Fr_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
eq_BN254_Fq_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
eq_U2048_Bench.json/main 185 acir_opcodes 185 acir_opcodes 1
eq_U256_Bench.json/main 35 acir_opcodes 35 acir_opcodes 1
evaluate_quadratic_expression_12_elements_BLS12_377Fq_Bench.json/main 2347 acir_opcodes 2347 acir_opcodes 1
evaluate_quadratic_expression_12_elements_BLS12_377Fr_Bench.json/main 1576 acir_opcodes 1576 acir_opcodes 1
evaluate_quadratic_expression_12_elements_BLS12_381Fq_Bench.json/main 2347 acir_opcodes 2347 acir_opcodes 1
evaluate_quadratic_expression_12_elements_BLS12_381Fr_Bench.json/main 1576 acir_opcodes 1576 acir_opcodes 1
evaluate_quadratic_expression_12_elements_BN254_Fq_Bench.json/main 1576 acir_opcodes 1576 acir_opcodes 1
evaluate_quadratic_expression_12_elements_U2048_Bench.json/main 28471 acir_opcodes 28471 acir_opcodes 1
evaluate_quadratic_expression_12_elements_U256_Bench.json/main 1576 acir_opcodes 1576 acir_opcodes 1
evaluate_quadratic_expression_3_elements_BLS12_377Fq_Bench.json/main 655 acir_opcodes 655 acir_opcodes 1
evaluate_quadratic_expression_3_elements_BLS12_377Fr_Bench.json/main 442 acir_opcodes 442 acir_opcodes 1
evaluate_quadratic_expression_3_elements_BLS12_381Fq_Bench.json/main 655 acir_opcodes 655 acir_opcodes 1
evaluate_quadratic_expression_3_elements_BLS12_381Fr_Bench.json/main 442 acir_opcodes 442 acir_opcodes 1
evaluate_quadratic_expression_3_elements_BN254_Fq_Bench.json/main 442 acir_opcodes 442 acir_opcodes 1
evaluate_quadratic_expression_3_elements_U2048_Bench.json/main 7627 acir_opcodes 7627 acir_opcodes 1
evaluate_quadratic_expression_3_elements_U256_Bench.json/main 442 acir_opcodes 442 acir_opcodes 1
from_be_bytes_BLS12_377Fq_Bench.json/main 60 acir_opcodes 60 acir_opcodes 1
from_be_bytes_BLS12_377Fr_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
from_be_bytes_BLS12_381Fq_Bench.json/main 60 acir_opcodes 60 acir_opcodes 1
from_be_bytes_BLS12_381Fr_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
from_be_bytes_BN254_Fq_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
from_be_bytes_U2048_Bench.json/main 311 acir_opcodes 311 acir_opcodes 1
from_be_bytes_U256_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
from_field_BLS12_377Fq_Bench.json/main 28 acir_opcodes 28 acir_opcodes 1
from_field_BLS12_377Fr_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
from_field_BLS12_381Fq_Bench.json/main 28 acir_opcodes 28 acir_opcodes 1
from_field_BLS12_381Fr_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
from_field_BN254_Fq_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
from_field_U2048_Bench.json/main 112 acir_opcodes 112 acir_opcodes 1
from_field_U256_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
from_le_bytes_BLS12_377Fq_Bench.json/main 60 acir_opcodes 60 acir_opcodes 1
from_le_bytes_BLS12_377Fr_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
from_le_bytes_BLS12_381Fq_Bench.json/main 60 acir_opcodes 60 acir_opcodes 1
from_le_bytes_BLS12_381Fr_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
from_le_bytes_BN254_Fq_Bench.json/main 41 acir_opcodes 41 acir_opcodes 1
from_le_bytes_U2048_Bench.json/main 311 acir_opcodes 311 acir_opcodes 1
from_le_bytes_U256_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
is_zero_BLS12_377Fq_Bench.json/main 19 acir_opcodes 19 acir_opcodes 1
is_zero_BLS12_377Fr_Bench.json/main 14 acir_opcodes 14 acir_opcodes 1
is_zero_BLS12_381Fq_Bench.json/main 19 acir_opcodes 19 acir_opcodes 1
is_zero_BLS12_381Fr_Bench.json/main 14 acir_opcodes 14 acir_opcodes 1
is_zero_BN254_Fq_Bench.json/main 14 acir_opcodes 14 acir_opcodes 1
is_zero_U2048_Bench.json/main 89 acir_opcodes 89 acir_opcodes 1
is_zero_U256_Bench.json/main 14 acir_opcodes 14 acir_opcodes 1
mul_BLS12_377Fq_Bench.json/main 61 acir_opcodes 61 acir_opcodes 1
mul_BLS12_377Fr_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
mul_BLS12_381Fq_Bench.json/main 61 acir_opcodes 61 acir_opcodes 1
mul_BLS12_381Fr_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
mul_BN254_Fq_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
mul_U2048_Bench.json/main 537 acir_opcodes 537 acir_opcodes 1
mul_U256_Bench.json/main 42 acir_opcodes 42 acir_opcodes 1
neg_BLS12_377Fq_Bench.json/main 56 acir_opcodes 56 acir_opcodes 1
neg_BLS12_377Fr_Bench.json/main 40 acir_opcodes 40 acir_opcodes 1
neg_BLS12_381Fq_Bench.json/main 56 acir_opcodes 56 acir_opcodes 1
neg_BLS12_381Fr_Bench.json/main 40 acir_opcodes 40 acir_opcodes 1
neg_BN254_Fq_Bench.json/main 40 acir_opcodes 40 acir_opcodes 1
neg_U2048_Bench.json/main 246 acir_opcodes 246 acir_opcodes 1
neg_U256_Bench.json/main 36 acir_opcodes 36 acir_opcodes 1
pow_BLS12_377Fq_Bench.json/main 17 acir_opcodes 17 acir_opcodes 1
pow_BLS12_377Fr_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
pow_BLS12_381Fq_Bench.json/main 17 acir_opcodes 17 acir_opcodes 1
pow_BLS12_381Fr_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
pow_BN254_Fq_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
pow_U2048_Bench.json/main 73 acir_opcodes 73 acir_opcodes 1
pow_U256_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
sqrt_BLS12_377Fq_Bench.json/main 15 acir_opcodes 15 acir_opcodes 1
sqrt_BLS12_377Fr_Bench.json/main 12 acir_opcodes 12 acir_opcodes 1
sqrt_BLS12_381Fq_Bench.json/main 15 acir_opcodes 15 acir_opcodes 1
sqrt_BLS12_381Fr_Bench.json/main 12 acir_opcodes 12 acir_opcodes 1
sqrt_BN254_Fq_Bench.json/main 12 acir_opcodes 12 acir_opcodes 1
sqrt_U2048_Bench.json/main 57 acir_opcodes 57 acir_opcodes 1
sqrt_U256_Bench.json/main 12 acir_opcodes 12 acir_opcodes 1
sub_BLS12_377Fq_Bench.json/main 29 acir_opcodes 29 acir_opcodes 1
sub_BLS12_377Fr_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
sub_BLS12_381Fq_Bench.json/main 29 acir_opcodes 29 acir_opcodes 1
sub_BLS12_381Fr_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
sub_BN254_Fq_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
sub_U2048_Bench.json/main 127 acir_opcodes 127 acir_opcodes 1
sub_U256_Bench.json/main 22 acir_opcodes 22 acir_opcodes 1
to_be_bytes_BLS12_377Fq_Bench.json/main 108 acir_opcodes 108 acir_opcodes 1
to_be_bytes_BLS12_377Fr_Bench.json/main 73 acir_opcodes 73 acir_opcodes 1
to_be_bytes_BLS12_381Fq_Bench.json/main 108 acir_opcodes 108 acir_opcodes 1
to_be_bytes_BLS12_381Fr_Bench.json/main 73 acir_opcodes 73 acir_opcodes 1
to_be_bytes_BN254_Fq_Bench.json/main 73 acir_opcodes 73 acir_opcodes 1
to_be_bytes_U2048_Bench.json/main 568 acir_opcodes 568 acir_opcodes 1
to_be_bytes_U256_Bench.json/main 75 acir_opcodes 75 acir_opcodes 1
to_field_BLS12_377Fq_Bench.json/main 23 acir_opcodes 23 acir_opcodes 1
to_field_BLS12_377Fr_Bench.json/main 18 acir_opcodes 18 acir_opcodes 1
to_field_BLS12_381Fq_Bench.json/main 23 acir_opcodes 23 acir_opcodes 1
to_field_BLS12_381Fr_Bench.json/main 18 acir_opcodes 18 acir_opcodes 1
to_field_BN254_Fq_Bench.json/main 18 acir_opcodes 18 acir_opcodes 1
to_field_U2048_Bench.json/main 93 acir_opcodes 93 acir_opcodes 1
to_field_U256_Bench.json/main 18 acir_opcodes 18 acir_opcodes 1
to_le_bytes_BLS12_377Fq_Bench.json/main 108 acir_opcodes 108 acir_opcodes 1
to_le_bytes_BLS12_377Fr_Bench.json/main 73 acir_opcodes 73 acir_opcodes 1
to_le_bytes_BLS12_381Fq_Bench.json/main 108 acir_opcodes 108 acir_opcodes 1
to_le_bytes_BLS12_381Fr_Bench.json/main 73 acir_opcodes 73 acir_opcodes 1
to_le_bytes_BN254_Fq_Bench.json/main 73 acir_opcodes 73 acir_opcodes 1
to_le_bytes_U2048_Bench.json/main 568 acir_opcodes 568 acir_opcodes 1
to_le_bytes_U256_Bench.json/main 75 acir_opcodes 75 acir_opcodes 1
udiv_BLS12_377Fq_Bench.json/main 83 acir_opcodes 83 acir_opcodes 1
udiv_BLS12_377Fr_Bench.json/main 59 acir_opcodes 59 acir_opcodes 1
udiv_BLS12_381Fq_Bench.json/main 83 acir_opcodes 83 acir_opcodes 1
udiv_BLS12_381Fr_Bench.json/main 59 acir_opcodes 59 acir_opcodes 1
udiv_BN254_Fq_Bench.json/main 59 acir_opcodes 59 acir_opcodes 1
udiv_U2048_Bench.json/main 629 acir_opcodes 629 acir_opcodes 1
udiv_U256_Bench.json/main 59 acir_opcodes 59 acir_opcodes 1
udiv_mod_BLS12_377Fq_Bench.json/main 87 acir_opcodes 87 acir_opcodes 1
udiv_mod_BLS12_377Fr_Bench.json/main 62 acir_opcodes 62 acir_opcodes 1
udiv_mod_BLS12_381Fq_Bench.json/main 87 acir_opcodes 87 acir_opcodes 1
udiv_mod_BLS12_381Fr_Bench.json/main 62 acir_opcodes 62 acir_opcodes 1
udiv_mod_BN254_Fq_Bench.json/main 62 acir_opcodes 62 acir_opcodes 1
udiv_mod_U2048_Bench.json/main 647 acir_opcodes 647 acir_opcodes 1
udiv_mod_U256_Bench.json/main 62 acir_opcodes 62 acir_opcodes 1
validate_in_field_BLS12_377Fq_Bench.json/main 17 acir_opcodes 17 acir_opcodes 1
validate_in_field_BLS12_377Fr_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
validate_in_field_BLS12_381Fq_Bench.json/main 17 acir_opcodes 17 acir_opcodes 1
validate_in_field_BLS12_381Fr_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
validate_in_field_BN254_Fq_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
validate_in_field_U2048_Bench.json/main 73 acir_opcodes 73 acir_opcodes 1
validate_in_field_U256_Bench.json/main 13 acir_opcodes 13 acir_opcodes 1
validate_in_range_BLS12_377Fq_Bench.json/main 4 acir_opcodes 4 acir_opcodes 1
validate_in_range_BLS12_377Fr_Bench.json/main 3 acir_opcodes 3 acir_opcodes 1
validate_in_range_BLS12_381Fq_Bench.json/main 4 acir_opcodes 4 acir_opcodes 1
validate_in_range_BLS12_381Fr_Bench.json/main 3 acir_opcodes 3 acir_opcodes 1
validate_in_range_BN254_Fq_Bench.json/main 3 acir_opcodes 3 acir_opcodes 1
validate_in_range_U2048_Bench.json/main 18 acir_opcodes 18 acir_opcodes 1
validate_in_range_U256_Bench.json/main 3 acir_opcodes 3 acir_opcodes 1

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Circuit Size

Benchmark suite Current: fc4eecf Previous: 9085dd6 Ratio
add_BLS12_377Fq_Bench.json/main 2896 circuit_size 2896 circuit_size 1
add_BLS12_377Fr_Bench.json/main 4238 circuit_size 4238 circuit_size 1
add_BLS12_381Fq_Bench.json/main 2916 circuit_size 2916 circuit_size 1
add_BLS12_381Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
add_BN254_Fq_Bench.json/main 2868 circuit_size 2868 circuit_size 1
add_U2048_Bench.json/main 3289 circuit_size 3289 circuit_size 1
add_U256_Bench.json/main 2873 circuit_size 2873 circuit_size 1
assert_is_not_equal_BLS12_377Fq_Bench.json/main 2818 circuit_size 2818 circuit_size 1
assert_is_not_equal_BLS12_377Fr_Bench.json/main 2804 circuit_size 2804 circuit_size 1
assert_is_not_equal_BLS12_381Fq_Bench.json/main 2818 circuit_size 2818 circuit_size 1
assert_is_not_equal_BLS12_381Fr_Bench.json/main 2804 circuit_size 2804 circuit_size 1
assert_is_not_equal_BN254_Fq_Bench.json/main 2804 circuit_size 2804 circuit_size 1
assert_is_not_equal_U2048_Bench.json/main 3018 circuit_size 3018 circuit_size 1
assert_is_not_equal_U256_Bench.json/main 2804 circuit_size 2804 circuit_size 1
batch_invert_10_elements_BLS12_377Fq_Bench.json/main 3316 circuit_size 3316 circuit_size 1
batch_invert_10_elements_BLS12_377Fr_Bench.json/main 3176 circuit_size 3176 circuit_size 1
batch_invert_10_elements_BLS12_381Fq_Bench.json/main 3316 circuit_size 3316 circuit_size 1
batch_invert_10_elements_BLS12_381Fr_Bench.json/main 3176 circuit_size 3176 circuit_size 1
batch_invert_10_elements_BN254_Fq_Bench.json/main 3176 circuit_size 3176 circuit_size 1
batch_invert_10_elements_U2048_Bench.json/main 5276 circuit_size 5276 circuit_size 1
batch_invert_10_elements_U256_Bench.json/main 3176 circuit_size 3176 circuit_size 1
cmp_BLS12_377Fq_Bench.json/main 2878 circuit_size 2878 circuit_size 1
cmp_BLS12_377Fr_Bench.json/main 2848 circuit_size 2848 circuit_size 1
cmp_BLS12_381Fq_Bench.json/main 2878 circuit_size 2878 circuit_size 1
cmp_BLS12_381Fr_Bench.json/main 2848 circuit_size 2848 circuit_size 1
cmp_BN254_Fq_Bench.json/main 2848 circuit_size 2848 circuit_size 1
cmp_U2048_Bench.json/main 3292 circuit_size 3292 circuit_size 1
cmp_U256_Bench.json/main 2848 circuit_size 2848 circuit_size 1
derive_from_seed_13_elements_BLS12_377Fq_Bench.json/main 6617 circuit_size 6617 circuit_size 1
derive_from_seed_13_elements_BLS12_377Fr_Bench.json/main 6877 circuit_size 6877 circuit_size 1
derive_from_seed_13_elements_BLS12_381Fq_Bench.json/main 7931 circuit_size 7931 circuit_size 1
derive_from_seed_13_elements_BLS12_381Fr_Bench.json/main 5530 circuit_size 5530 circuit_size 1
derive_from_seed_13_elements_BN254_Fq_Bench.json/main 5506 circuit_size 5506 circuit_size 1
derive_from_seed_13_elements_U2048_Bench.json/main 20463 circuit_size 20463 circuit_size 1
derive_from_seed_13_elements_U256_Bench.json/main 5591 circuit_size 5591 circuit_size 1
div_BLS12_377Fq_Bench.json/main 3082 circuit_size 3082 circuit_size 1
div_BLS12_377Fr_Bench.json/main 2946 circuit_size 2946 circuit_size 1
div_BLS12_381Fq_Bench.json/main 4362 circuit_size 4362 circuit_size 1
div_BLS12_381Fr_Bench.json/main 2962 circuit_size 2962 circuit_size 1
div_BN254_Fq_Bench.json/main 2951 circuit_size 2951 circuit_size 1
div_U2048_Bench.json/main 2991 circuit_size 2991 circuit_size 1
div_U256_Bench.json/main 2797 circuit_size 2797 circuit_size 1
eq_BLS12_377Fq_Bench.json/main 2919 circuit_size 2919 circuit_size 1
eq_BLS12_377Fr_Bench.json/main 4255 circuit_size 4255 circuit_size 1
eq_BLS12_381Fq_Bench.json/main 2939 circuit_size 2939 circuit_size 1
eq_BLS12_381Fr_Bench.json/main 2891 circuit_size 2891 circuit_size 1
eq_BN254_Fq_Bench.json/main 2885 circuit_size 2885 circuit_size 1
eq_U2048_Bench.json/main 3346 circuit_size 3346 circuit_size 1
eq_U256_Bench.json/main 2885 circuit_size 2885 circuit_size 1
evaluate_quadratic_expression_12_elements_BLS12_377Fq_Bench.json/main 8877 circuit_size 8877 circuit_size 1
evaluate_quadratic_expression_12_elements_BLS12_377Fr_Bench.json/main 6862 circuit_size 6862 circuit_size 1
evaluate_quadratic_expression_12_elements_BLS12_381Fq_Bench.json/main 10157 circuit_size 10157 circuit_size 1
evaluate_quadratic_expression_12_elements_BLS12_381Fr_Bench.json/main 6878 circuit_size 6878 circuit_size 1
evaluate_quadratic_expression_12_elements_BN254_Fq_Bench.json/main 6867 circuit_size 6867 circuit_size 1
evaluate_quadratic_expression_12_elements_U2048_Bench.json/main 68639 circuit_size 68639 circuit_size 1
evaluate_quadratic_expression_12_elements_U256_Bench.json/main 6942 circuit_size 6942 circuit_size 1
evaluate_quadratic_expression_3_elements_BLS12_377Fq_Bench.json/main 4558 circuit_size 4558 circuit_size 1
evaluate_quadratic_expression_3_elements_BLS12_377Fr_Bench.json/main 3948 circuit_size 3948 circuit_size 1
evaluate_quadratic_expression_3_elements_BLS12_381Fq_Bench.json/main 5838 circuit_size 5838 circuit_size 1
evaluate_quadratic_expression_3_elements_BLS12_381Fr_Bench.json/main 3964 circuit_size 3964 circuit_size 1
evaluate_quadratic_expression_3_elements_BN254_Fq_Bench.json/main 3953 circuit_size 3953 circuit_size 1
evaluate_quadratic_expression_3_elements_U2048_Bench.json/main 20094 circuit_size 20094 circuit_size 1
evaluate_quadratic_expression_3_elements_U256_Bench.json/main 4028 circuit_size 4028 circuit_size 1
from_be_bytes_BLS12_377Fq_Bench.json/main 2905 circuit_size 2905 circuit_size 1
from_be_bytes_BLS12_377Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
from_be_bytes_BLS12_381Fq_Bench.json/main 2905 circuit_size 2905 circuit_size 1
from_be_bytes_BLS12_381Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
from_be_bytes_BN254_Fq_Bench.json/main 2874 circuit_size 2874 circuit_size 1
from_be_bytes_U2048_Bench.json/main 3328 circuit_size 3328 circuit_size 1
from_be_bytes_U256_Bench.json/main 2875 circuit_size 2875 circuit_size 1
from_field_BLS12_377Fq_Bench.json/main 2855 circuit_size 2855 circuit_size 1
from_field_BLS12_377Fr_Bench.json/main 4203 circuit_size 4203 circuit_size 1
from_field_BLS12_381Fq_Bench.json/main 2875 circuit_size 2875 circuit_size 1
from_field_BLS12_381Fr_Bench.json/main 2840 circuit_size 2840 circuit_size 1
from_field_BN254_Fq_Bench.json/main 2834 circuit_size 2834 circuit_size 1
from_field_U2048_Bench.json/main 3141 circuit_size 3141 circuit_size 1
from_field_U256_Bench.json/main 2840 circuit_size 2840 circuit_size 1
from_le_bytes_BLS12_377Fq_Bench.json/main 2905 circuit_size 2905 circuit_size 1
from_le_bytes_BLS12_377Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
from_le_bytes_BLS12_381Fq_Bench.json/main 2905 circuit_size 2905 circuit_size 1
from_le_bytes_BLS12_381Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
from_le_bytes_BN254_Fq_Bench.json/main 2874 circuit_size 2874 circuit_size 1
from_le_bytes_U2048_Bench.json/main 3328 circuit_size 3328 circuit_size 1
from_le_bytes_U256_Bench.json/main 2875 circuit_size 2875 circuit_size 1
is_zero_BLS12_377Fq_Bench.json/main 2793 circuit_size 2793 circuit_size 1
is_zero_BLS12_377Fr_Bench.json/main 2784 circuit_size 2784 circuit_size 1
is_zero_BLS12_381Fq_Bench.json/main 2793 circuit_size 2793 circuit_size 1
is_zero_BLS12_381Fr_Bench.json/main 2784 circuit_size 2784 circuit_size 1
is_zero_BN254_Fq_Bench.json/main 2784 circuit_size 2784 circuit_size 1
is_zero_U2048_Bench.json/main 2927 circuit_size 2927 circuit_size 1
is_zero_U256_Bench.json/main 2784 circuit_size 2784 circuit_size 1
mul_BLS12_377Fq_Bench.json/main 3082 circuit_size 3082 circuit_size 1
mul_BLS12_377Fr_Bench.json/main 2946 circuit_size 2946 circuit_size 1
mul_BLS12_381Fq_Bench.json/main 4362 circuit_size 4362 circuit_size 1
mul_BLS12_381Fr_Bench.json/main 2962 circuit_size 2962 circuit_size 1
mul_BN254_Fq_Bench.json/main 2951 circuit_size 2951 circuit_size 1
mul_U2048_Bench.json/main 4063 circuit_size 4063 circuit_size 1
mul_U256_Bench.json/main 3026 circuit_size 3026 circuit_size 1
neg_BLS12_377Fq_Bench.json/main 2955 circuit_size 2955 circuit_size 1
neg_BLS12_377Fr_Bench.json/main 4276 circuit_size 4276 circuit_size 1
neg_BLS12_381Fq_Bench.json/main 2975 circuit_size 2975 circuit_size 1
neg_BLS12_381Fr_Bench.json/main 2912 circuit_size 2912 circuit_size 1
neg_BN254_Fq_Bench.json/main 2906 circuit_size 2906 circuit_size 1
neg_U2048_Bench.json/main 3505 circuit_size 3505 circuit_size 1
neg_U256_Bench.json/main 2896 circuit_size 2896 circuit_size 1
pow_BLS12_377Fq_Bench.json/main 2838 circuit_size 2838 circuit_size 1
pow_BLS12_377Fr_Bench.json/main 2817 circuit_size 2817 circuit_size 1
pow_BLS12_381Fq_Bench.json/main 2838 circuit_size 2838 circuit_size 1
pow_BLS12_381Fr_Bench.json/main 2817 circuit_size 2817 circuit_size 1
pow_BN254_Fq_Bench.json/main 2817 circuit_size 2817 circuit_size 1
pow_U2048_Bench.json/main 3126 circuit_size 3126 circuit_size 1
pow_U256_Bench.json/main 2817 circuit_size 2817 circuit_size 1
sqrt_BLS12_377Fq_Bench.json/main 2814 circuit_size 2814 circuit_size 1
sqrt_BLS12_377Fr_Bench.json/main 2801 circuit_size 2801 circuit_size 1
sqrt_BLS12_381Fq_Bench.json/main 2814 circuit_size 2814 circuit_size 1
sqrt_BLS12_381Fr_Bench.json/main 2801 circuit_size 2801 circuit_size 1
sqrt_BN254_Fq_Bench.json/main 2801 circuit_size 2801 circuit_size 1
sqrt_U2048_Bench.json/main 3010 circuit_size 3010 circuit_size 1
sqrt_U256_Bench.json/main 2801 circuit_size 2801 circuit_size 1
sub_BLS12_377Fq_Bench.json/main 2896 circuit_size 2896 circuit_size 1
sub_BLS12_377Fr_Bench.json/main 4238 circuit_size 4238 circuit_size 1
sub_BLS12_381Fq_Bench.json/main 2916 circuit_size 2916 circuit_size 1
sub_BLS12_381Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
sub_BN254_Fq_Bench.json/main 2868 circuit_size 2868 circuit_size 1
sub_U2048_Bench.json/main 3289 circuit_size 3289 circuit_size 1
sub_U256_Bench.json/main 2873 circuit_size 2873 circuit_size 1
to_be_bytes_BLS12_377Fq_Bench.json/main 2905 circuit_size 2905 circuit_size 1
to_be_bytes_BLS12_377Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
to_be_bytes_BLS12_381Fq_Bench.json/main 2905 circuit_size 2905 circuit_size 1
to_be_bytes_BLS12_381Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
to_be_bytes_BN254_Fq_Bench.json/main 2874 circuit_size 2874 circuit_size 1
to_be_bytes_U2048_Bench.json/main 3328 circuit_size 3328 circuit_size 1
to_be_bytes_U256_Bench.json/main 2875 circuit_size 2875 circuit_size 1
to_field_BLS12_377Fq_Bench.json/main 2855 circuit_size 2855 circuit_size 1
to_field_BLS12_377Fr_Bench.json/main 4203 circuit_size 4203 circuit_size 1
to_field_BLS12_381Fq_Bench.json/main 2875 circuit_size 2875 circuit_size 1
to_field_BLS12_381Fr_Bench.json/main 2840 circuit_size 2840 circuit_size 1
to_field_BN254_Fq_Bench.json/main 2834 circuit_size 2834 circuit_size 1
to_field_U2048_Bench.json/main 3141 circuit_size 3141 circuit_size 1
to_field_U256_Bench.json/main 2840 circuit_size 2840 circuit_size 1
to_le_bytes_BLS12_377Fq_Bench.json/main 2905 circuit_size 2905 circuit_size 1
to_le_bytes_BLS12_377Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
to_le_bytes_BLS12_381Fq_Bench.json/main 2905 circuit_size 2905 circuit_size 1
to_le_bytes_BLS12_381Fr_Bench.json/main 2874 circuit_size 2874 circuit_size 1
to_le_bytes_BN254_Fq_Bench.json/main 2874 circuit_size 2874 circuit_size 1
to_le_bytes_U2048_Bench.json/main 3328 circuit_size 3328 circuit_size 1
to_le_bytes_U256_Bench.json/main 2875 circuit_size 2875 circuit_size 1
udiv_BLS12_377Fq_Bench.json/main 3150 circuit_size 3150 circuit_size 1
udiv_BLS12_377Fr_Bench.json/main 4362 circuit_size 4362 circuit_size 1
udiv_BLS12_381Fq_Bench.json/main 4450 circuit_size 4450 circuit_size 1
udiv_BLS12_381Fr_Bench.json/main 3014 circuit_size 3014 circuit_size 1
udiv_BN254_Fq_Bench.json/main 2997 circuit_size 2997 circuit_size 1
udiv_U2048_Bench.json/main 4441 circuit_size 4441 circuit_size 1
udiv_U256_Bench.json/main 3078 circuit_size 3078 circuit_size 1
udiv_mod_BLS12_377Fq_Bench.json/main 3150 circuit_size 3150 circuit_size 1
udiv_mod_BLS12_377Fr_Bench.json/main 4362 circuit_size 4362 circuit_size 1
udiv_mod_BLS12_381Fq_Bench.json/main 4450 circuit_size 4450 circuit_size 1
udiv_mod_BLS12_381Fr_Bench.json/main 3014 circuit_size 3014 circuit_size 1
udiv_mod_BN254_Fq_Bench.json/main 2997 circuit_size 2997 circuit_size 1
udiv_mod_U2048_Bench.json/main 4441 circuit_size 4441 circuit_size 1
udiv_mod_U256_Bench.json/main 3078 circuit_size 3078 circuit_size 1
validate_in_field_BLS12_377Fq_Bench.json/main 2860 circuit_size 2860 circuit_size 1
validate_in_field_BLS12_377Fr_Bench.json/main 4211 circuit_size 4211 circuit_size 1
validate_in_field_BLS12_381Fq_Bench.json/main 2880 circuit_size 2880 circuit_size 1
validate_in_field_BLS12_381Fr_Bench.json/main 2847 circuit_size 2847 circuit_size 1
validate_in_field_BN254_Fq_Bench.json/main 2841 circuit_size 2841 circuit_size 1
validate_in_field_U2048_Bench.json/main 3137 circuit_size 3137 circuit_size 1
validate_in_field_U256_Bench.json/main 2847 circuit_size 2847 circuit_size 1
validate_in_range_BLS12_377Fq_Bench.json/main 2821 circuit_size 2821 circuit_size 1
validate_in_range_BLS12_377Fr_Bench.json/main 4180 circuit_size 4180 circuit_size 1
validate_in_range_BLS12_381Fq_Bench.json/main 2841 circuit_size 2841 circuit_size 1
validate_in_range_BLS12_381Fr_Bench.json/main 2816 circuit_size 2816 circuit_size 1
validate_in_range_BN254_Fq_Bench.json/main 2810 circuit_size 2810 circuit_size 1
validate_in_range_U2048_Bench.json/main 2978 circuit_size 2978 circuit_size 1
validate_in_range_U256_Bench.json/main 2816 circuit_size 2816 circuit_size 1

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Brillig Bytecode Size

Benchmark suite Current: fc4eecf Previous: 9085dd6 Ratio
add_BLS12_377Fq_Bench 297 opcodes 297 opcodes 1
add_BLS12_377Fr_Bench 288 opcodes 288 opcodes 1
add_BLS12_381Fq_Bench 297 opcodes 297 opcodes 1
add_BLS12_381Fr_Bench 288 opcodes 288 opcodes 1
add_BN254_Fq_Bench 288 opcodes 288 opcodes 1
add_U2048_Bench 352 opcodes 352 opcodes 1
add_U256_Bench 286 opcodes 286 opcodes 1
assert_is_not_equal_BLS12_377Fq_Bench 160 opcodes 160 opcodes 1
assert_is_not_equal_BLS12_377Fr_Bench 155 opcodes 155 opcodes 1
assert_is_not_equal_BLS12_381Fq_Bench 160 opcodes 160 opcodes 1
assert_is_not_equal_BLS12_381Fr_Bench 155 opcodes 155 opcodes 1
assert_is_not_equal_BN254_Fq_Bench 155 opcodes 155 opcodes 1
assert_is_not_equal_U2048_Bench 214 opcodes 214 opcodes 1
assert_is_not_equal_U256_Bench 154 opcodes 154 opcodes 1
batch_invert_10_elements_BLS12_377Fq_Bench 4779 opcodes 6382 opcodes 0.75
batch_invert_10_elements_BLS12_377Fr_Bench 4695 opcodes 6220 opcodes 0.75
batch_invert_10_elements_BLS12_381Fq_Bench 4779 opcodes 6382 opcodes 0.75
batch_invert_10_elements_BLS12_381Fr_Bench 4695 opcodes 6220 opcodes 0.75
batch_invert_10_elements_BN254_Fq_Bench 4685 opcodes 6210 opcodes 0.75
batch_invert_10_elements_U2048_Bench 374 opcodes 374 opcodes 1
batch_invert_10_elements_U256_Bench 224 opcodes 224 opcodes 1
cmp_BLS12_377Fq_Bench 486 opcodes 486 opcodes 1
cmp_BLS12_377Fr_Bench 421 opcodes 421 opcodes 1
cmp_BLS12_381Fq_Bench 486 opcodes 486 opcodes 1
cmp_BLS12_381Fr_Bench 421 opcodes 421 opcodes 1
cmp_BN254_Fq_Bench 421 opcodes 421 opcodes 1
cmp_U2048_Bench 518 opcodes 518 opcodes 1
cmp_U256_Bench 421 opcodes 421 opcodes 1
derive_from_seed_13_elements_BLS12_377Fq_Bench 1966 opcodes 2285 opcodes 0.86
derive_from_seed_13_elements_BLS12_377Fr_Bench 1925 opcodes 2230 opcodes 0.86
derive_from_seed_13_elements_BLS12_381Fq_Bench 1966 opcodes 2285 opcodes 0.86
derive_from_seed_13_elements_BLS12_381Fr_Bench 1925 opcodes 2230 opcodes 0.86
derive_from_seed_13_elements_BN254_Fq_Bench 1923 opcodes 2228 opcodes 0.86
derive_from_seed_13_elements_U2048_Bench 2125 opcodes 2471 opcodes 0.86
derive_from_seed_13_elements_U256_Bench 1921 opcodes 2226 opcodes 0.86
div_BLS12_377Fq_Bench 2695 opcodes 3729 opcodes 0.72
div_BLS12_377Fr_Bench 2634 opcodes 3603 opcodes 0.73
div_BLS12_381Fq_Bench 2695 opcodes 3729 opcodes 0.72
div_BLS12_381Fr_Bench 2634 opcodes 3603 opcodes 0.73
div_BN254_Fq_Bench 2628 opcodes 3597 opcodes 0.73
div_U2048_Bench 98 opcodes 98 opcodes 1
div_U256_Bench 68 opcodes 68 opcodes 1
eq_BLS12_377Fq_Bench 400 opcodes 400 opcodes 1
eq_BLS12_377Fr_Bench 380 opcodes 380 opcodes 1
eq_BLS12_381Fq_Bench 400 opcodes 400 opcodes 1
eq_BLS12_381Fr_Bench 380 opcodes 380 opcodes 1
eq_BN254_Fq_Bench 380 opcodes 380 opcodes 1
eq_U2048_Bench 456 opcodes 456 opcodes 1
eq_U256_Bench 378 opcodes 378 opcodes 1
evaluate_quadratic_expression_12_elements_BLS12_377Fq_Bench 5076 opcodes 5470 opcodes 0.93
evaluate_quadratic_expression_12_elements_BLS12_377Fr_Bench 4944 opcodes 5303 opcodes 0.93
evaluate_quadratic_expression_12_elements_BLS12_381Fq_Bench 5076 opcodes 5470 opcodes 0.93
evaluate_quadratic_expression_12_elements_BLS12_381Fr_Bench 4944 opcodes 5303 opcodes 0.93
evaluate_quadratic_expression_12_elements_BN254_Fq_Bench 4942 opcodes 5301 opcodes 0.93
evaluate_quadratic_expression_12_elements_U2048_Bench 6334 opcodes 6745 opcodes 0.94
evaluate_quadratic_expression_12_elements_U256_Bench 4940 opcodes 5299 opcodes 0.93
evaluate_quadratic_expression_3_elements_BLS12_377Fq_Bench 3315 opcodes 3709 opcodes 0.89
evaluate_quadratic_expression_3_elements_BLS12_377Fr_Bench 3236 opcodes 3595 opcodes 0.90
evaluate_quadratic_expression_3_elements_BLS12_381Fq_Bench 3315 opcodes 3709 opcodes 0.89
evaluate_quadratic_expression_3_elements_BLS12_381Fr_Bench 3236 opcodes 3595 opcodes 0.90
evaluate_quadratic_expression_3_elements_BN254_Fq_Bench 3234 opcodes 3593 opcodes 0.90
evaluate_quadratic_expression_3_elements_U2048_Bench 3816 opcodes 4227 opcodes 0.90
evaluate_quadratic_expression_3_elements_U256_Bench 3232 opcodes 3591 opcodes 0.90
from_be_bytes_BLS12_377Fq_Bench 273 opcodes 273 opcodes 1
from_be_bytes_BLS12_377Fr_Bench 223 opcodes 223 opcodes 1
from_be_bytes_BLS12_381Fq_Bench 273 opcodes 273 opcodes 1
from_be_bytes_BLS12_381Fr_Bench 223 opcodes 223 opcodes 1
from_be_bytes_BN254_Fq_Bench 223 opcodes 223 opcodes 1
from_be_bytes_U2048_Bench 478 opcodes 478 opcodes 1
from_be_bytes_U256_Bench 255 opcodes 255 opcodes 1
from_field_BLS12_377Fq_Bench 82 opcodes 82 opcodes 1
from_field_BLS12_377Fr_Bench 79 opcodes 79 opcodes 1
from_field_BLS12_381Fq_Bench 82 opcodes 82 opcodes 1
from_field_BLS12_381Fr_Bench 79 opcodes 79 opcodes 1
from_field_BN254_Fq_Bench 79 opcodes 79 opcodes 1
from_field_U2048_Bench 110 opcodes 110 opcodes 1
from_field_U256_Bench 79 opcodes 79 opcodes 1
from_le_bytes_BLS12_377Fq_Bench 320 opcodes 320 opcodes 1
from_le_bytes_BLS12_377Fr_Bench 270 opcodes 270 opcodes 1
from_le_bytes_BLS12_381Fq_Bench 320 opcodes 320 opcodes 1
from_le_bytes_BLS12_381Fr_Bench 270 opcodes 270 opcodes 1
from_le_bytes_BN254_Fq_Bench 270 opcodes 270 opcodes 1
from_le_bytes_U2048_Bench 525 opcodes 525 opcodes 1
from_le_bytes_U256_Bench 302 opcodes 302 opcodes 1
is_zero_BLS12_377Fq_Bench 72 opcodes 72 opcodes 1
is_zero_BLS12_377Fr_Bench 63 opcodes 63 opcodes 1
is_zero_BLS12_381Fq_Bench 72 opcodes 72 opcodes 1
is_zero_BLS12_381Fr_Bench 63 opcodes 63 opcodes 1
is_zero_BN254_Fq_Bench 63 opcodes 63 opcodes 1
is_zero_U2048_Bench 86 opcodes 86 opcodes 1
is_zero_U256_Bench 63 opcodes 63 opcodes 1
mul_BLS12_377Fq_Bench 1013 opcodes 1406 opcodes 0.72
mul_BLS12_377Fr_Bench 986 opcodes 1345 opcodes 0.73
mul_BLS12_381Fq_Bench 1013 opcodes 1406 opcodes 0.72
mul_BLS12_381Fr_Bench 986 opcodes 1345 opcodes 0.73
mul_BN254_Fq_Bench 984 opcodes 1343 opcodes 0.73
mul_U2048_Bench 1169 opcodes 1579 opcodes 0.74
mul_U256_Bench 982 opcodes 1341 opcodes 0.73
neg_BLS12_377Fq_Bench 170 opcodes 170 opcodes 1
neg_BLS12_377Fr_Bench 164 opcodes 164 opcodes 1
neg_BLS12_381Fq_Bench 170 opcodes 170 opcodes 1
neg_BLS12_381Fr_Bench 164 opcodes 164 opcodes 1
neg_BN254_Fq_Bench 164 opcodes 164 opcodes 1
neg_U2048_Bench 210 opcodes 210 opcodes 1
neg_U256_Bench 162 opcodes 162 opcodes 1
pow_BLS12_377Fq_Bench 1779 opcodes 2416 opcodes 0.74
pow_BLS12_377Fr_Bench 1748 opcodes 2355 opcodes 0.74
pow_BLS12_381Fq_Bench 1779 opcodes 2416 opcodes 0.74
pow_BLS12_381Fr_Bench 1748 opcodes 2355 opcodes 0.74
pow_BN254_Fq_Bench 1744 opcodes 2351 opcodes 0.74
pow_U2048_Bench 2054 opcodes 2736 opcodes 0.75
pow_U256_Bench 1744 opcodes 2351 opcodes 0.74
sqrt_BLS12_377Fq_Bench 14309 opcodes 19814 opcodes 0.72
sqrt_BLS12_377Fr_Bench 14048 opcodes 19207 opcodes 0.73
sqrt_BLS12_381Fq_Bench 14309 opcodes 19814 opcodes 0.72
sqrt_BLS12_381Fr_Bench 14048 opcodes 19207 opcodes 0.73
sqrt_BN254_Fq_Bench 14016 opcodes 19175 opcodes 0.73
sqrt_U2048_Bench 15984 opcodes 21820 opcodes 0.73
sqrt_U256_Bench 14044 opcodes 19203 opcodes 0.73
sub_BLS12_377Fq_Bench 360 opcodes 360 opcodes 1
sub_BLS12_377Fr_Bench 349 opcodes 349 opcodes 1
sub_BLS12_381Fq_Bench 360 opcodes 360 opcodes 1
sub_BLS12_381Fr_Bench 349 opcodes 349 opcodes 1
sub_BN254_Fq_Bench 349 opcodes 349 opcodes 1
sub_U2048_Bench 416 opcodes 416 opcodes 1
sub_U256_Bench 347 opcodes 347 opcodes 1
to_be_bytes_BLS12_377Fq_Bench 215 opcodes 215 opcodes 1
to_be_bytes_BLS12_377Fr_Bench 205 opcodes 205 opcodes 1
to_be_bytes_BLS12_381Fq_Bench 215 opcodes 215 opcodes 1
to_be_bytes_BLS12_381Fr_Bench 205 opcodes 205 opcodes 1
to_be_bytes_BN254_Fq_Bench 205 opcodes 205 opcodes 1
to_be_bytes_U2048_Bench 221 opcodes 221 opcodes 1
to_be_bytes_U256_Bench 213 opcodes 213 opcodes 1
to_field_BLS12_377Fq_Bench 504 opcodes 504 opcodes 1
to_field_BLS12_377Fr_Bench 415 opcodes 415 opcodes 1
to_field_BLS12_381Fq_Bench 504 opcodes 504 opcodes 1
to_field_BLS12_381Fr_Bench 415 opcodes 415 opcodes 1
to_field_BN254_Fq_Bench 415 opcodes 415 opcodes 1
to_field_U2048_Bench 551 opcodes 551 opcodes 1
to_field_U256_Bench 415 opcodes 415 opcodes 1
to_le_bytes_BLS12_377Fq_Bench 260 opcodes 260 opcodes 1
to_le_bytes_BLS12_377Fr_Bench 250 opcodes 250 opcodes 1
to_le_bytes_BLS12_381Fq_Bench 260 opcodes 260 opcodes 1
to_le_bytes_BLS12_381Fr_Bench 250 opcodes 250 opcodes 1
to_le_bytes_BN254_Fq_Bench 250 opcodes 250 opcodes 1
to_le_bytes_U2048_Bench 266 opcodes 266 opcodes 1
to_le_bytes_U256_Bench 258 opcodes 258 opcodes 1
udiv_BLS12_377Fq_Bench 1735 opcodes 1735 opcodes 1
udiv_BLS12_377Fr_Bench 1721 opcodes 1721 opcodes 1
udiv_BLS12_381Fq_Bench 1735 opcodes 1735 opcodes 1
udiv_BLS12_381Fr_Bench 1721 opcodes 1721 opcodes 1
udiv_BN254_Fq_Bench 1721 opcodes 1721 opcodes 1
udiv_U2048_Bench 1796 opcodes 1796 opcodes 1
udiv_U256_Bench 1721 opcodes 1721 opcodes 1
udiv_mod_BLS12_377Fq_Bench 1747 opcodes 1747 opcodes 1
udiv_mod_BLS12_377Fr_Bench 1733 opcodes 1733 opcodes 1
udiv_mod_BLS12_381Fq_Bench 1747 opcodes 1747 opcodes 1
udiv_mod_BLS12_381Fr_Bench 1733 opcodes 1733 opcodes 1
udiv_mod_BN254_Fq_Bench 1733 opcodes 1733 opcodes 1
udiv_mod_U2048_Bench 1808 opcodes 1808 opcodes 1
udiv_mod_U256_Bench 1733 opcodes 1733 opcodes 1
validate_in_field_BLS12_377Fq_Bench 298 opcodes 298 opcodes 1
validate_in_field_BLS12_377Fr_Bench 200 opcodes 200 opcodes 1
validate_in_field_BLS12_381Fq_Bench 298 opcodes 298 opcodes 1
validate_in_field_BLS12_381Fr_Bench 200 opcodes 200 opcodes 1
validate_in_field_BN254_Fq_Bench 200 opcodes 200 opcodes 1
validate_in_field_U2048_Bench 361 opcodes 361 opcodes 1
validate_in_field_U256_Bench 199 opcodes 199 opcodes 1
validate_in_range_BLS12_377Fq_Bench 79 opcodes 79 opcodes 1
validate_in_range_BLS12_377Fr_Bench 76 opcodes 76 opcodes 1
validate_in_range_BLS12_381Fq_Bench 79 opcodes 79 opcodes 1
validate_in_range_BLS12_381Fr_Bench 76 opcodes 76 opcodes 1
validate_in_range_BN254_Fq_Bench 76 opcodes 76 opcodes 1
validate_in_range_U2048_Bench 93 opcodes 93 opcodes 1
validate_in_range_U256_Bench 76 opcodes 76 opcodes 1

This comment was automatically generated by workflow using github-action-benchmark.

@Sarkoxed Sarkoxed marked this pull request as ready for review November 10, 2025 19:26
@TomAFrench
Copy link
Member

That's a very nice reduction!

@TomAFrench TomAFrench changed the title chore(barrett reduction): clean up and optimize __barrett_reduction feat: clean up and optimize __barrett_reduction Nov 10, 2025
@TomAFrench TomAFrench requested a review from kashbrti November 11, 2025 19:12
Copy link
Contributor

@kashbrti kashbrti left a comment

Choose a reason for hiding this comment

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

LGTM correctness wise. I'm still wondering what's causing the 25% reduction of brillig opcodes in the benchmarks. is it because of the cleanups in the helper functions such as shr?

quotient_mul_modulus_normalized[i] = long_quotient_mul_modulus_normalized[i];
}
// long_quotient_mul_modulus can never exceed input value `x` so can fit into size-2 array
let long_quotient_mul_modulus: [u128; 2 * N] = __helper_mul(smaller_quotient, modulus);
Copy link
Contributor

Choose a reason for hiding this comment

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

this is so looks much cleaner. adding the __helper_mul payed off :D

@Sarkoxed
Copy link
Contributor Author

LGTM correctness wise. I'm still wondering what's causing the 25% reduction of brillig opcodes in the benchmarks. is it because of the cleanups in the helper functions such as shr?

I think it is mainly because I made it two subtractions at the end

@Sarkoxed Sarkoxed merged commit e163efa into main Nov 12, 2025
9 checks passed
@noirwhal noirwhal mentioned this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants