-
Notifications
You must be signed in to change notification settings - Fork 701
Inline redflags logic in CClosure. #21353
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
Open
rlepigre
wants to merge
1
commit into
rocq-prover:master
Choose a base branch
from
rlepigre:cclosure-redflags
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
+103
−34
Conversation
This file contains hidden or 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
Contributor
|
@coqbot run full ci |
Contributor
|
@coqbot bench |
90c541c to
e79aeb4
Compare
Contributor
Author
|
The initial version is a performance regression, probably due to the costly translation function. Rebasing on #21352, to see what happens if we just expose the implementation details of the bitfield-represented flags. |
Contributor
Author
|
@coqbot bench |
Contributor
|
🏁 Bench results: 🐢 Top 25 slow downs┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SLOW DOWNS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 173 178 4.6918 2.71% 233 coq-fiat-crypto-with-bedrock/rupicola/bedrock2/deps/riscv-coq/src/riscv/Proofs/DecodeByExtension.v.html │ │ 49.2 52.0 2.8083 5.71% 376 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 24.1 26.6 2.5689 10.68% 550 coq-bedrock2/bedrock2/src/bedrock2Examples/insertionsort.v.html │ │ 24.1 26.7 2.5635 10.63% 550 coq-fiat-crypto-with-bedrock/rupicola/bedrock2/bedrock2/src/bedrock2Examples/insertionsort.v.html │ │ 63.3 65.4 2.1090 3.33% 608 coq-bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html │ │ 34.775 36.761 1.9860 5.71% 147 coq-vst/veric/expr_lemmas4.v.html │ │ 33.942 35.751 1.8090 5.33% 194 coq-vst/veric/expr_lemmas4.v.html │ │ 26.6 28.3 1.7431 6.55% 374 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 26.6 28.3 1.6961 6.36% 375 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 64.0 65.7 1.6947 2.65% 608 coq-fiat-crypto-with-bedrock/rupicola/bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html │ │ 21.1 22.3 1.2649 6.01% 338 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 1.34 2.57 1.2319 92.02% 549 coq-fiat-crypto-with-bedrock/src/Bedrock/P256/Jacobian.v.html │ │ 15.358 16.578 1.2200 7.94% 1223 coq-vst/floyd/Component.v.html │ │ 15.363 16.531 1.1680 7.60% 1209 coq-vst/floyd/Component.v.html │ │ 16.5 17.7 1.1143 6.74% 905 coq-unimath/UniMath/ModelCategories/Generated/LNWFSCocomplete.v.html │ │ 12.1 13.1 1.0101 8.33% 97 coq-unimath/UniMath/CategoryTheory/Hyperdoctrines/HValuedSets.v.html │ │ 15.392 16.398 1.0060 6.54% 1515 coq-vst/floyd/VSU.v.html │ │ 82.2 83.1 0.8496 1.03% 48 coq-fiat-crypto-with-bedrock/src/Curves/Weierstrass/AffineProofs.v.html │ │ 2.47 3.27 0.7972 32.29% 34 coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/ArithWithCasts.v.html │ │ 10.602 11.389 0.7870 7.42% 985 coq-vst/floyd/closed_lemmas.v.html │ │ 21.8 22.6 0.7862 3.61% 49 coq-fiat-crypto-with-bedrock/src/Curves/Weierstrass/AffineProofs.v.html │ │ 7.444 8.086 0.6420 8.62% 1206 coq-vst/floyd/Component.v.html │ │ 7.497 8.108 0.6110 8.15% 1506 coq-vst/floyd/Component.v.html │ │ 7.481 8.083 0.6020 8.05% 1208 coq-vst/floyd/Component.v.html │ │ 7.477 8.074 0.5970 7.98% 1221 coq-vst/floyd/Component.v.html │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 🐇 Top 25 speed ups┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SPEED UPS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 205 201 -4.3093 -2.10% 8 coq-neural-net-interp-computed-lite/theories/MaxOfTwoNumbersSimpler/Computed/AllLogits.v.html │ │ 6.69 5.20 -1.4834 -22.18% 130 coq-category-theory/Functor/Strong/Product.v.html │ │ 30.9 29.8 -1.0432 -3.38% 148 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 18.9 17.9 -0.9560 -5.07% 32 coq-performance-tests-lite/src/pattern.v.html │ │ 33.8 32.9 -0.9022 -2.67% 960 coq-fiat-crypto-with-bedrock/src/Bedrock/Secp256k1/JoyeLadder.v.html │ │ 30.5 29.6 -0.8971 -2.94% 166 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 30.6 29.7 -0.8475 -2.77% 139 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 31.7 30.9 -0.8448 -2.66% 121 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 30.6 29.8 -0.8412 -2.75% 157 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 30.4 29.6 -0.8168 -2.69% 198 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 30.6 29.8 -0.7625 -2.49% 214 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 30.5 29.8 -0.7202 -2.36% 960 coq-fiat-crypto-with-bedrock/src/Bedrock/Secp256k1/JoyeLadder.v.html │ │ 30.6 29.9 -0.6717 -2.20% 180 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 1.64 0.973 -0.6672 -40.68% 813 rocq-stdlib/theories/MSets/MSetRBT.v.html │ │ 3.96 3.29 -0.6642 -16.78% 557 coq-fiat-crypto-with-bedrock/src/Bedrock/P256/Jacobian.v.html │ │ 18.7 18.1 -0.6565 -3.51% 31 coq-engine-bench-lite/coq/PerformanceDemos/pattern.v.html │ │ 0.580 0.00717 -0.5730 -98.76% 145 coq-mathcomp-analysis/theories/ftc.v.html │ │ 0.528 0.00993 -0.5181 -98.12% 219 coq-mathcomp-analysis/theories/lebesgue_integral_theory/lebesgue_integral_monotone_convergence.v.html │ │ 0.520 0.00748 -0.5125 -98.56% 217 coq-mathcomp-analysis/theories/derive.v.html │ │ 0.511 0.000103 -0.5105 -99.98% 221 coq-mathcomp-analysis/theories/ess_sup_inf.v.html │ │ 0.514 0.00578 -0.5082 -98.88% 159 coq-mathcomp-analysis/theories/lebesgue_integral_theory/measurable_fun_approximation.v.html │ │ 0.538 0.0316 -0.5060 -94.13% 188 coq-mathcomp-analysis/theories/lebesgue_integral_theory/lebesgue_integral_under.v.html │ │ 30.1 29.6 -0.5031 -1.67% 671 coq-fiat-crypto-with-bedrock/src/Bedrock/Secp256k1/JoyeLadder.v.html │ │ 0.495 0.00176 -0.4932 -99.64% 271 coq-mathcomp-analysis/theories/sequences.v.html │ │ 0.492 0.000732 -0.4912 -99.85% 89 coq-mathcomp-analysis/theories/lebesgue_integral_theory/lebesgue_Rintegral.v.html │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ |
Contributor
|
🏁 Bench results: 🐢 Top 25 slow downs┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SLOW DOWNS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 93.5 95.5 1.9480 2.08% 999 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 94.0 95.3 1.2218 1.30% 968 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 63.6 64.7 1.0902 1.71% 608 coq-bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html │ │ 26.6 27.6 1.0042 3.78% 374 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 26.7 27.6 0.9642 3.61% 375 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 21.5 22.4 0.8873 4.12% 651 rocq-stdlib/theories/Zmod/ZmodBase.v.html │ │ 40.4 41.2 0.8491 2.10% 1423 coq-fiat-crypto-with-bedrock/rupicola/bedrock2/compiler/src/compiler/FlatToRiscvFunctions.v.html │ │ 1.00 1.69 0.6924 69.17% 813 rocq-stdlib/theories/MSets/MSetRBT.v.html │ │ 64.0 64.6 0.6181 0.97% 716 coq-fiat-crypto-with-bedrock/src/Bedrock/Secp256k1/JacobianCoZ.v.html │ │ 0.00357 0.577 0.5739 16093.41% 142 coq-mathcomp-analysis/theories/ftc.v.html │ │ 1.91 2.48 0.5718 29.91% 32 coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/NBE.v.html │ │ 24.0 24.5 0.5317 2.21% 550 coq-bedrock2/bedrock2/src/bedrock2Examples/insertionsort.v.html │ │ 0.00423 0.517 0.5129 12133.55% 152 coq-mathcomp-analysis/theories/lebesgue_integral_theory/measurable_fun_approximation.v.html │ │ 0.00910 0.522 0.5125 5633.57% 215 coq-mathcomp-analysis/theories/derive.v.html │ │ 0.00314 0.515 0.5116 16267.98% 218 coq-mathcomp-analysis/theories/ess_sup_inf.v.html │ │ 0.0108 0.502 0.4911 4555.12% 187 coq-mathcomp-analysis/theories/lebesgue_integral_theory/lebesgue_integral_under.v.html │ │ 0.00535 0.496 0.4907 9166.22% 113 coq-mathcomp-analysis/theories/derive.v.html │ │ 0.00443 0.493 0.4885 11024.01% 54 coq-mathcomp-analysis/theories/lebesgue_integral_theory/lebesgue_integral_monotone_convergence.v.html │ │ 0.000876 0.488 0.4874 55636.99% 89 coq-mathcomp-analysis/theories/lebesgue_integral_theory/lebesgue_Rintegral.v.html │ │ 0.00391 0.489 0.4852 12425.45% 175 coq-mathcomp-analysis/theories/lebesgue_integral_theory/lebesgue_integral_definition.v.html │ │ 0.000670 0.454 0.4538 67728.81% 660 rocq-mathcomp-character/character/mxrepresentation.v.html │ │ 0.00195 0.437 0.4353 22358.40% 146 rocq-mathcomp-algebra/algebra/spectral.v.html │ │ 3.65 4.08 0.4331 11.87% 1190 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 10.514 10.916 0.4020 3.82% 985 coq-vst/floyd/closed_lemmas.v.html │ │ 0.00925 0.393 0.3834 4143.40% 248 rocq-mathcomp-field/field/algebraics_fundamentals.v.html │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 🐇 Top 25 speed ups┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SPEED UPS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 65.2 62.4 -2.7026 -4.15% 608 coq-fiat-crypto-with-bedrock/rupicola/bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html │ │ 174 172 -2.3136 -1.33% 233 coq-fiat-crypto-with-bedrock/rupicola/bedrock2/deps/riscv-coq/src/riscv/Proofs/DecodeByExtension.v.html │ │ 6.86 5.19 -1.6717 -24.35% 130 coq-category-theory/Functor/Strong/Product.v.html │ │ 203 202 -1.3862 -0.68% 8 coq-neural-net-interp-computed-lite/theories/MaxOfTwoNumbersSimpler/Computed/AllLogits.v.html │ │ 82.8 81.8 -1.0400 -1.26% 48 coq-fiat-crypto-with-bedrock/src/Curves/Weierstrass/AffineProofs.v.html │ │ 33.6 32.6 -1.0103 -3.01% 960 coq-fiat-crypto-with-bedrock/src/Bedrock/Secp256k1/JoyeLadder.v.html │ │ 30.4 29.4 -0.9325 -3.07% 960 coq-fiat-crypto-with-bedrock/src/Bedrock/Secp256k1/JoyeLadder.v.html │ │ 18.6 17.7 -0.9294 -4.99% 31 coq-engine-bench-lite/coq/PerformanceDemos/pattern.v.html │ │ 93.4 92.6 -0.8494 -0.91% 20 coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/NBE.v.html │ │ 3.02 2.27 -0.7484 -24.76% 607 rocq-stdlib/theories/Zmod/ZmodBase.v.html │ │ 42.7 41.9 -0.7212 -1.69% 50 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 43.3 42.6 -0.6755 -1.56% 50 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 30.7 30.0 -0.6630 -2.16% 198 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 18.7 18.1 -0.6228 -3.33% 32 coq-performance-tests-lite/src/pattern.v.html │ │ 48.1 47.5 -0.6071 -1.26% 260 coq-fiat-crypto-with-bedrock/src/Bedrock/P256/Jacobian.v.html │ │ 30.8 30.2 -0.5904 -1.92% 166 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 30.8 30.2 -0.5893 -1.91% 214 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 0.582 0.00728 -0.5749 -98.75% 145 coq-mathcomp-analysis/theories/ftc.v.html │ │ 30.9 30.4 -0.5621 -1.82% 148 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 30.8 30.2 -0.5263 -1.71% 157 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ │ 0.516 0.000100 -0.5159 -99.98% 221 coq-mathcomp-analysis/theories/ess_sup_inf.v.html │ │ 0.521 0.00727 -0.5137 -98.60% 217 coq-mathcomp-analysis/theories/derive.v.html │ │ 0.513 0.00586 -0.5076 -98.86% 159 coq-mathcomp-analysis/theories/lebesgue_integral_theory/measurable_fun_approximation.v.html │ │ 0.534 0.0305 -0.5038 -94.28% 188 coq-mathcomp-analysis/theories/lebesgue_integral_theory/lebesgue_integral_under.v.html │ │ 31.8 31.3 -0.5024 -1.58% 121 coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ |
e79aeb4 to
2ad8607
Compare
rlepigre
commented
Nov 26, 2025
Member
|
@coqbot run full ci |
2ad8607 to
49c37f4
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
needs: full CI
The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI.
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.
This is another experiment that @Janno and I ran in #17839, which improved performance quite a bit. This is orthogonal to #21352, and makes it so that reduction flag queries on the hot paths of
CClosureare inlined.