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

chore(LSP): several improvements for enums and enum variants #7179

Merged
merged 10 commits into from
Jan 24, 2025

Conversation

asterite
Copy link
Collaborator

Description

Problem

Part of #988

Summary

Now enum variants show up as they do in Rust Analyzer.

Completion:

image

Signature help:

image

Hover:

image

Additional Context

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

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 bot commented Jan 24, 2025

Changes to Brillig bytecode sizes

Generated at commit: ad3be4585dbc0b445e3193e8ae61a9eeb22e8844, compared to commit: f89b3db1b850cf71cc03dc800e3ff13c931bc816

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
pedersen_commitment_inliner_min +75 ❌ +46.58%
sha2_byte_inliner_max +575 ❌ +27.34%
sha2_byte_inliner_zero +555 ❌ +25.12%
array_dynamic_blackbox_input_inliner_max +168 ❌ +20.05%
simple_shield_inliner_zero +92 ❌ +12.78%
simple_shield_inliner_min +78 ❌ +9.06%
pedersen_check_inliner_zero +37 ❌ +7.41%
brillig_pedersen_inliner_zero +37 ❌ +7.41%
slice_regex_inliner_max -174 ✅ -7.73%
simple_radix_inliner_min -13 ✅ -14.61%
to_bytes_integration_inliner_min -45 ✅ -20.18%

Full diff report 👇
Program Brillig opcodes (+/-) %
pedersen_commitment_inliner_min 236 (+75) +46.58%
sha2_byte_inliner_max 2,678 (+575) +27.34%
sha2_byte_inliner_zero 2,764 (+555) +25.12%
array_dynamic_blackbox_input_inliner_max 1,006 (+168) +20.05%
simple_shield_inliner_zero 812 (+92) +12.78%
simple_shield_inliner_min 939 (+78) +9.06%
pedersen_check_inliner_zero 536 (+37) +7.41%
brillig_pedersen_inliner_zero 536 (+37) +7.41%
pedersen_check_inliner_min 594 (+37) +6.64%
brillig_pedersen_inliner_min 594 (+37) +6.64%
regression_6674_3_inliner_max 461 (+3) +0.66%
strings_inliner_max 928 (+6) +0.65%
sha256_var_size_regression_inliner_max 1,664 (+1) +0.06%
sha256_regression_inliner_max 6,687 (+4) +0.06%
sha256_var_padding_regression_inliner_max 4,906 (+2) +0.04%
slices_inliner_max 2,113 (-2) -0.09%
slices_inliner_zero 2,091 (-2) -0.10%
sha256_regression_inliner_min 5,281 (-6) -0.11%
bigint_inliner_max 2,089 (-3) -0.14%
u128_inliner_zero 1,986 (-3) -0.15%
keccak256_inliner_zero 1,967 (-3) -0.15%
sha256_brillig_performance_regression_inliner_zero 1,670 (-3) -0.18%
keccak256_inliner_min 1,665 (-3) -0.18%
sha256_var_padding_regression_inliner_min 3,232 (-6) -0.19%
uhashmap_inliner_min 8,338 (-18) -0.22%
slices_inliner_min 2,517 (-6) -0.24%
hashmap_inliner_max 19,605 (-58) -0.29%
bigint_inliner_zero 1,864 (-6) -0.32%
hashmap_inliner_min 9,771 (-33) -0.34%
sha2_byte_inliner_min 2,986 (-12) -0.40%
fold_numeric_generic_poseidon_inliner_max 726 (-3) -0.41%
no_predicates_numeric_generic_poseidon_inliner_max 726 (-3) -0.41%
conditional_1_inliner_min 1,418 (-6) -0.42%
sha256_inliner_min 1,408 (-6) -0.42%
bigint_inliner_min 1,979 (-9) -0.45%
array_dynamic_blackbox_input_inliner_min 1,275 (-6) -0.47%
fold_numeric_generic_poseidon_inliner_min 632 (-3) -0.47%
no_predicates_numeric_generic_poseidon_inliner_min 632 (-3) -0.47%
sha256_var_size_regression_inliner_min 1,239 (-6) -0.48%
sha256_brillig_performance_regression_inliner_min 1,838 (-9) -0.49%
ecdsa_secp256k1_inliner_min 1,213 (-6) -0.49%
array_dynamic_nested_blackbox_input_inliner_min 1,200 (-6) -0.50%
no_predicates_numeric_generic_poseidon_inliner_zero 571 (-3) -0.52%
fold_numeric_generic_poseidon_inliner_zero 571 (-3) -0.52%
conditional_regression_short_circuit_inliner_min 1,119 (-6) -0.53%
regression_4449_inliner_min 1,066 (-6) -0.56%
6_inliner_min 1,018 (-6) -0.59%
sha256_var_witness_const_regression_inliner_min 984 (-6) -0.61%
slice_coercion_inliner_min 486 (-3) -0.61%
uhashmap_inliner_zero 7,417 (-51) -0.68%
u128_inliner_min 2,279 (-16) -0.70%
poseidon_bn254_hash_width_3_inliner_min 4,985 (-37) -0.74%
poseidon_bn254_hash_inliner_min 4,985 (-37) -0.74%
fold_2_to_17_inliner_min 399 (-3) -0.75%
regression_5252_inliner_min 3,542 (-28) -0.78%
ram_blowup_regression_inliner_min 1,130 (-9) -0.79%
poseidonsponge_x5_254_inliner_min 3,129 (-25) -0.79%
poseidon2_inliner_min 374 (-3) -0.80%
bench_2_to_17_inliner_min 367 (-3) -0.81%
array_to_slice_inliner_min 995 (-9) -0.90%
poseidon2_inliner_max 322 (-3) -0.92%
bench_2_to_17_inliner_max 315 (-3) -0.94%
regression_6674_2_inliner_min 303 (-3) -0.98%
regression_6674_1_inliner_min 296 (-3) -1.00%
poseidon2_inliner_zero 295 (-3) -1.01%
bench_2_to_17_inliner_zero 287 (-3) -1.03%
brillig_cow_regression_inliner_min 2,317 (-25) -1.07%
regression_inliner_min 1,110 (-12) -1.07%
fold_2_to_17_inliner_max 552 (-6) -1.08%
regression_6674_3_inliner_zero 467 (-6) -1.27%
to_be_bytes_inliner_min 225 (-3) -1.32%
hash_to_field_inliner_min 213 (-3) -1.39%
fold_2_to_17_inliner_zero 396 (-6) -1.49%
derive_inliner_min 584 (-9) -1.52%
7_function_inliner_min 635 (-13) -2.01%
regression_7128_inliner_min 146 (-3) -2.01%
merkle_insert_inliner_min 481 (-13) -2.63%
array_len_inliner_min 108 (-3) -2.70%
slice_regex_inliner_min 2,055 (-63) -2.97%
slice_regex_inliner_zero 1,600 (-57) -3.44%
regression_6674_3_inliner_min 837 (-30) -3.46%
uhashmap_inliner_max 12,121 (-437) -3.48%
to_bits_inliner_min 194 (-7) -3.48%
to_le_bytes_inliner_min 161 (-6) -3.59%
to_bytes_consistent_inliner_min 78 (-3) -3.70%
to_bytes_consistent_inliner_zero 78 (-3) -3.70%
slice_regex_inliner_max 2,076 (-174) -7.73%
simple_radix_inliner_min 76 (-13) -14.61%
to_bytes_integration_inliner_min 178 (-45) -20.18%

Copy link
Contributor

github-actions bot commented Jan 24, 2025

Changes to number of Brillig opcodes executed

Generated at commit: ad3be4585dbc0b445e3193e8ae61a9eeb22e8844, compared to commit: f89b3db1b850cf71cc03dc800e3ff13c931bc816

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
pedersen_commitment_inliner_min +116 ❌ +57.14%
brillig_pedersen_inliner_zero +103 ❌ +13.75%
pedersen_check_inliner_zero +103 ❌ +13.75%
brillig_pedersen_inliner_min +103 ❌ +11.05%
pedersen_check_inliner_min +103 ❌ +11.05%
simple_shield_inliner_zero +224 ❌ +8.98%
simple_shield_inliner_min +206 ❌ +7.99%
simple_radix_inliner_min -17 ✅ -19.32%
to_bits_inliner_min -160 ✅ -21.74%
to_bytes_integration_inliner_min -1,852 ✅ -43.67%

Full diff report 👇
Program Brillig opcodes (+/-) %
pedersen_commitment_inliner_min 319 (+116) +57.14%
brillig_pedersen_inliner_zero 852 (+103) +13.75%
pedersen_check_inliner_zero 852 (+103) +13.75%
brillig_pedersen_inliner_min 1,035 (+103) +11.05%
pedersen_check_inliner_min 1,035 (+103) +11.05%
simple_shield_inliner_zero 2,718 (+224) +8.98%
simple_shield_inliner_min 2,785 (+206) +7.99%
sha2_byte_inliner_max 44,559 (+627) +1.43%
array_dynamic_blackbox_input_inliner_max 17,473 (+244) +1.42%
strings_inliner_max 1,722 (+6) +0.35%
regression_6674_3_inliner_max 1,358 (+3) +0.22%
sha2_byte_inliner_zero 72,373 (+45) +0.06%
sha256_var_size_regression_inliner_max 15,504 (+1) +0.01%
sha256_regression_inliner_max 111,644 (+4) +0.00%
sha256_var_padding_regression_inliner_max 196,666 (+2) +0.00%
bench_2_to_17_inliner_min 712,412 (-3) -0.00%
fold_2_to_17_inliner_min 1,355,051 (-6) -0.00%
fold_2_to_17_inliner_zero 1,317,616 (-6) -0.00%
bench_2_to_17_inliner_zero 612,716 (-3) -0.00%
bench_2_to_17_inliner_max 570,233 (-3) -0.00%
fold_2_to_17_inliner_max 1,056,623 (-6) -0.00%
u128_inliner_zero 44,448 (-6) -0.01%
hashmap_inliner_max 48,267 (-20) -0.04%
sha2_byte_inliner_min 89,381 (-54) -0.06%
sha256_var_padding_regression_inliner_min 267,094 (-162) -0.06%
slices_inliner_max 3,257 (-2) -0.06%
fold_numeric_generic_poseidon_inliner_max 4,767 (-3) -0.06%
no_predicates_numeric_generic_poseidon_inliner_max 4,767 (-3) -0.06%
sha256_brillig_performance_regression_inliner_zero 26,424 (-24) -0.09%
ram_blowup_regression_inliner_min 817,990 (-795) -0.10%
brillig_cow_regression_inliner_min 543,441 (-551) -0.10%
sha256_regression_inliner_min 157,332 (-162) -0.10%
fold_numeric_generic_poseidon_inliner_min 5,786 (-6) -0.10%
no_predicates_numeric_generic_poseidon_inliner_min 5,786 (-6) -0.10%
fold_numeric_generic_poseidon_inliner_zero 5,713 (-6) -0.10%
no_predicates_numeric_generic_poseidon_inliner_zero 5,713 (-6) -0.10%
slices_inliner_zero 3,659 (-5) -0.14%
to_be_bytes_inliner_min 2,125 (-3) -0.14%
u128_inliner_min 52,143 (-74) -0.14%
keccak256_inliner_min 32,022 (-48) -0.15%
keccak256_inliner_zero 31,641 (-48) -0.15%
sha256_brillig_performance_regression_inliner_min 26,800 (-51) -0.19%
regression_inliner_min 3,057 (-6) -0.20%
slices_inliner_min 4,269 (-9) -0.21%
array_dynamic_blackbox_input_inliner_min 22,308 (-54) -0.24%
sha256_var_size_regression_inliner_min 22,086 (-54) -0.24%
regression_7128_inliner_min 1,216 (-3) -0.25%
to_le_bytes_inliner_min 1,122 (-3) -0.27%
uhashmap_inliner_min 196,618 (-543) -0.28%
regression_6674_2_inliner_min 1,048 (-3) -0.29%
regression_6674_1_inliner_min 1,042 (-3) -0.29%
uhashmap_inliner_zero 174,599 (-534) -0.30%
hash_to_field_inliner_min 965 (-3) -0.31%
ecdsa_secp256k1_inliner_min 8,165 (-27) -0.33%
poseidon2_inliner_min 869 (-3) -0.34%
hashmap_inliner_min 90,205 (-336) -0.37%
array_to_slice_inliner_min 2,238 (-9) -0.40%
poseidon2_inliner_zero 726 (-3) -0.41%
regression_6674_3_inliner_zero 1,364 (-6) -0.44%
poseidon2_inliner_max 674 (-3) -0.44%
conditional_1_inliner_min 5,954 (-27) -0.45%
hashmap_inliner_zero 74,878 (-350) -0.47%
array_dynamic_nested_blackbox_input_inliner_min 4,921 (-27) -0.55%
conditional_regression_short_circuit_inliner_min 8,701 (-54) -0.62%
6_inliner_min 8,595 (-54) -0.62%
slice_coercion_inliner_min 469 (-3) -0.64%
7_function_inliner_min 2,605 (-17) -0.65%
uhashmap_inliner_max 136,213 (-892) -0.65%
sha256_inliner_min 16,448 (-108) -0.65%
sha256_var_witness_const_regression_inliner_min 7,704 (-54) -0.70%
regression_4449_inliner_min 266,453 (-1,890) -0.70%
to_bytes_consistent_inliner_min 659 (-6) -0.90%
to_bytes_consistent_inliner_zero 659 (-6) -0.90%
regression_5252_inliner_min 1,021,038 (-10,230) -0.99%
merkle_insert_inliner_min 3,388 (-34) -0.99%
poseidonsponge_x5_254_inliner_min 204,273 (-2,052) -0.99%
slice_regex_inliner_min 8,490 (-90) -1.05%
poseidon_bn254_hash_inliner_min 183,702 (-2,013) -1.08%
poseidon_bn254_hash_width_3_inliner_min 183,702 (-2,013) -1.08%
array_len_inliner_min 203 (-3) -1.46%
derive_inliner_min 606 (-9) -1.46%
regression_6674_3_inliner_min 1,976 (-30) -1.50%
slice_regex_inliner_zero 3,862 (-84) -2.13%
slice_regex_inliner_max 3,103 (-81) -2.54%
simple_radix_inliner_min 71 (-17) -19.32%
to_bits_inliner_min 576 (-160) -21.74%
to_bytes_integration_inliner_min 2,389 (-1,852) -43.67%

Copy link
Contributor

github-actions bot commented Jan 24, 2025

Changes to circuit sizes

Generated at commit: ad3be4585dbc0b445e3193e8ae61a9eeb22e8844, compared to commit: f89b3db1b850cf71cc03dc800e3ff13c931bc816

🧾 Summary (10% most significant diffs)

Program ACIR opcodes (+/-) % Circuit size (+/-) %
bench_poseidon_hash_100 +5,800 ❌ +18.24% -52,200 ✅ -56.24%
to_bytes_integration -903 ✅ -75.76% -904 ✅ -66.72%

Full diff report 👇
Program ACIR opcodes (+/-) % Circuit size (+/-) %
sha256_var_size_regression 10,196 (+4) +0.04% 62,971 (+8) +0.01%
bench_eddsa_poseidon 16,439 (-1,656) -9.15% 19,585 (-2,359) -10.75%
regression_5252 32,862 (+7,068) +27.40% 44,465 (-32,262) -42.05%
poseidonsponge_x5_254 1,040 (+248) +31.31% 1,255 (-1,132) -47.42%
poseidon_bn254_hash 892 (+182) +25.63% 1,037 (-1,088) -51.20%
poseidon_bn254_hash_width_3 892 (+182) +25.63% 1,037 (-1,088) -51.20%
bench_poseidon_hash 376 (+58) +18.24% 422 (-522) -55.30%
bench_poseidon_hash_30 11,280 (+1,740) +18.24% 12,196 (-15,660) -56.22%
bench_poseidon_hash_100 37,600 (+5,800) +18.24% 40,616 (-52,200) -56.24%
to_bytes_integration 289 (-903) -75.76% 451 (-904) -66.72%

@asterite asterite changed the base branch from jf/more-enum-work to jf/enum-fixes January 24, 2025 15:16
@jfecher
Copy link
Contributor

jfecher commented Jan 24, 2025

I wonder what all the bytecode size changes are from? Faulty CI?

Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

Thanks!

@jfecher jfecher merged commit 44c3b5f into jf/enum-fixes Jan 24, 2025
87 checks passed
@jfecher jfecher deleted the ab/lsp-enum-fixes branch January 24, 2025 15:22
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