-
Notifications
You must be signed in to change notification settings - Fork 694
Actually rely on the environment to compute canonical data. #21075
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
base: master
Are you sure you want to change the base?
Actually rely on the environment to compute canonical data. #21075
Conversation
@coqbot bench |
🏁 Bench results:
INFO: failed to install 🐢 Top 25 slow downs┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SLOW DOWNS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 9.79 10.6 0.7733 7.90% 673 coq-rewriter/src/Rewriter/Rewriter/Wf.v.html │ │ 32.112 32.822 0.7100 2.21% 97 coq-vst/veric/binop_lemmas5.v.html │ │ 40.889 41.596 0.7070 1.73% 834 coq-vst/veric/binop_lemmas4.v.html │ │ 21.1 21.8 0.6839 3.24% 651 rocq-stdlib/theories/Zmod/ZmodBase.v.html │ │ 4.89 5.50 0.6117 12.51% 1576 coq-rewriter/src/Rewriter/Language/UnderLetsProofs.v.html │ │ 22.9 23.5 0.6025 2.63% 79 coq-rewriter/src/Rewriter/Rewriter/Examples/PerfTesting/SieveOfEratosthenes.v.html │ │ 2.86 3.45 0.5922 20.69% 597 coq-verdi-raft/theories/RaftProofs/AllEntriesLogProof.v.html │ │ 0.259 0.845 0.5859 226.30% 12 rocq-stdlib/theories/MSets/MSets.v.html │ │ 7.32 7.79 0.4619 6.31% 356 coq-rewriter/src/Rewriter/Rewriter/Wf.v.html │ │ 9.06 9.52 0.4601 5.08% 434 coq-mathcomp-odd-order/theories/PFsection12.v.html │ │ 1.46 1.89 0.4305 29.54% 1209 coq-rewriter/src/Rewriter/Rewriter/InterpProofs.v.html │ │ 1.11 1.50 0.3932 35.55% 1142 rocq-stdlib/theories/FSets/FMapAVL.v.html │ │ 3.62 4.01 0.3892 10.74% 1190 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 5.86 6.24 0.3747 6.39% 819 coq-rewriter/src/Rewriter/Rewriter/InterpProofs.v.html │ │ 0.917 1.29 0.3708 40.46% 215 rocq-stdlib/theories/setoid_ring/Ncring_tac.v.html │ │ 1.90 2.27 0.3690 19.43% 427 coq-verdi-raft/theories/RaftProofs/AllEntriesLogProof.v.html │ │ 8.60 8.97 0.3672 4.27% 1393 coq-rewriter/src/Rewriter/Language/UnderLetsProofs.v.html │ │ 1.85 2.21 0.3650 19.76% 647 coq-verdi-raft/theories/RaftProofs/AllEntriesLogProof.v.html │ │ 48.7 49.0 0.3635 0.75% 376 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 18.9 19.3 0.3597 1.90% 481 coq-verdi-raft/theories/RaftProofs/EndToEndLinearizability.v.html │ │ 0.433 0.790 0.3562 82.17% 200 rocq-stdlib/theories/Numbers/HexadecimalNat.v.html │ │ 7.40 7.75 0.3506 4.74% 3379 rocq-metarocq-safechecker/safechecker/theories/PCUICSafeConversion.v.html │ │ 0.913 1.26 0.3436 37.63% 813 rocq-stdlib/theories/MSets/MSetRBT.v.html │ │ 5.62 5.95 0.3305 5.88% 628 coq-bedrock2/bedrock2/src/bedrock2Examples/LAN9250.v.html │ │ 1.51 1.81 0.3048 20.18% 449 coq-verdi-raft/theories/RaftProofs/AllEntriesLogProof.v.html │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 🐇 Top 25 speed ups┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SPEED UPS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 200 198 -1.6380 -0.82% 8 coq-neural-net-interp-computed-lite/theories/MaxOfTwoNumbersSimpler/Computed/AllLogits.v.html │ │ 62.9 62.2 -0.7491 -1.19% 608 coq-bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html │ │ 23.6 23.0 -0.5433 -2.30% 12 coq-fourcolor/theories/proof/job554to562.v.html │ │ 39.2 38.7 -0.4869 -1.24% 236 coq-rewriter/src/Rewriter/Rewriter/Examples/PerfTesting/LiftLetsMap.v.html │ │ 36.6 36.2 -0.4827 -1.32% 139 coq-fiat-parsers/src/Parsers/Refinement/SharpenedJSON.v.html │ │ 2.89 2.44 -0.4583 -15.84% 607 rocq-stdlib/theories/Zmod/ZmodBase.v.html │ │ 31.0 30.6 -0.4463 -1.44% 12 coq-fourcolor/theories/proof/job254to270.v.html │ │ 2.74 2.33 -0.4109 -15.00% 240 coq-category-theory/Construction/Comma/Adjunction.v.html │ │ 25.1 24.7 -0.3776 -1.51% 12 coq-fourcolor/theories/proof/job291to294.v.html │ │ 29.0 28.7 -0.3638 -1.25% 12 coq-fourcolor/theories/proof/job589to610.v.html │ │ 1.426 1.074 -0.3520 -24.68% 937 coq-vst/veric/binop_lemmas2.v.html │ │ 25.0 24.7 -0.3436 -1.37% 12 coq-fourcolor/theories/proof/job299to302.v.html │ │ 24.0 23.7 -0.3411 -1.42% 12 coq-fourcolor/theories/proof/job486to489.v.html │ │ 30.0 29.6 -0.3386 -1.13% 12 coq-fourcolor/theories/proof/job165to189.v.html │ │ 25.5 25.1 -0.3339 -1.31% 12 coq-fourcolor/theories/proof/job499to502.v.html │ │ 25.2 24.9 -0.3092 -1.23% 12 coq-fourcolor/theories/proof/job223to226.v.html │ │ 21.4 21.1 -0.3021 -1.41% 12 coq-fourcolor/theories/proof/job542to545.v.html │ │ 24.4 24.1 -0.2996 -1.23% 12 coq-fourcolor/theories/proof/job319to322.v.html │ │ 0.480 0.181 -0.2992 -62.36% 374 rocq-stdlib/theories/Sorting/SetoidList.v.html │ │ 2.73 2.45 -0.2755 -10.09% 1001 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 19.5 19.2 -0.2707 -1.39% 12 coq-fourcolor/theories/proof/job507to510.v.html │ │ 24.7 24.4 -0.2609 -1.06% 12 coq-fourcolor/theories/proof/job503to506.v.html │ │ 25.6 25.4 -0.2552 -1.00% 12 coq-fourcolor/theories/proof/job466to485.v.html │ │ 19.9 19.6 -0.2492 -1.25% 12 coq-fourcolor/theories/proof/job546to549.v.html │ │ 20.4 20.2 -0.2479 -1.21% 12 coq-fourcolor/theories/proof/job283to286.v.html │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ |
We first check for label equality, which is fast, before trying to normalize then name. The kernel guarantees that aliased names have the same label, so this is sound.
1ba74c7
to
07afb68
Compare
@coqbot run full ci |
@coqbot bench |
🏁 Bench results:
INFO: failed to install 🐢 Top 25 slow downs┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SLOW DOWNS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 95.9 98.9 2.9225 3.05% 999 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 96.1 98.8 2.7585 2.87% 968 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 62.9 64.5 1.5947 2.53% 608 coq-bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html │ │ 5.22 6.57 1.3434 25.73% 130 coq-category-theory/Functor/Strong/Product.v.html │ │ 198 199 1.2533 0.63% 8 coq-neural-net-interp-computed-lite/theories/MaxOfTwoNumbersSimpler/Computed/AllLogits.v.html │ │ 23.6 24.4 0.7883 3.34% 12 coq-fourcolor/theories/proof/job486to489.v.html │ │ 23.2 24.0 0.7729 3.33% 12 coq-fourcolor/theories/proof/job295to298.v.html │ │ 22.5 23.3 0.7601 3.37% 79 coq-rewriter/src/Rewriter/Rewriter/Examples/PerfTesting/SieveOfEratosthenes.v.html │ │ 17.7 18.4 0.7000 3.95% 31 coq-engine-bench-lite/coq/PerformanceDemos/pattern.v.html │ │ 47.7 48.4 0.6915 1.45% 376 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 8.93 9.62 0.6888 7.71% 434 coq-mathcomp-odd-order/theories/PFsection12.v.html │ │ 40.718 41.388 0.6700 1.65% 834 coq-vst/veric/binop_lemmas4.v.html │ │ 31.422 32.068 0.6460 2.06% 97 coq-vst/veric/binop_lemmas5.v.html │ │ 3.68 4.31 0.6238 16.94% 1190 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 2.23 2.86 0.6220 27.85% 607 rocq-stdlib/theories/Zmod/ZmodBase.v.html │ │ 24.2 24.8 0.5943 2.46% 12 coq-fourcolor/theories/proof/job503to506.v.html │ │ 19.1 19.7 0.5718 2.99% 12 coq-fourcolor/theories/proof/job490to494.v.html │ │ 23.1 23.6 0.5367 2.32% 12 coq-fourcolor/theories/proof/job554to562.v.html │ │ 18.3 18.7 0.4269 2.33% 12 coq-fourcolor/theories/proof/job207to214.v.html │ │ 26.3 26.7 0.4216 1.60% 12 coq-fourcolor/theories/proof/job531to534.v.html │ │ 22.9 23.3 0.3906 1.70% 12 coq-fourcolor/theories/proof/job495to498.v.html │ │ 1.17 1.56 0.3871 33.10% 1252 rocq-metarocq-erasure/erasure/theories/ErasureFunction.v.html │ │ 27.0 27.4 0.3664 1.36% 12 coq-fourcolor/theories/proof/job287to290.v.html │ │ 12.1 12.5 0.3625 2.99% 930 coq-unimath/UniMath/CategoryTheory/Hyperdoctrines/PartialEqRels/ExponentialEqs.v.html │ │ 21.0 21.3 0.3408 1.62% 479 rocq-metarocq-erasure/erasure/theories/EWcbvEvalCstrsAsBlocksFixLambdaInd.v.html │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 🐇 Top 25 speed ups┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SPEED UPS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 0.988 0.269 -0.7195 -72.79% 12 rocq-stdlib/theories/MSets/MSets.v.html │ │ 21.5 21.1 -0.4750 -2.21% 651 rocq-stdlib/theories/Zmod/ZmodBase.v.html │ │ 34.637 34.206 -0.4310 -1.24% 147 coq-vst/veric/expr_lemmas4.v.html │ │ 0.545 0.123 -0.4227 -77.49% 1177 rocq-stdlib/theories/Reals/Abstract/ConstructiveReals.v.html │ │ 2.68 2.32 -0.3621 -13.50% 240 coq-category-theory/Construction/Comma/Adjunction.v.html │ │ 0.525 0.172 -0.3534 -67.26% 374 rocq-stdlib/theories/Sorting/SetoidList.v.html │ │ 0.934 0.601 -0.3334 -35.69% 170 rocq-stdlib/theories/Numbers/HexadecimalNat.v.html │ │ 1.82 1.49 -0.3297 -18.13% 313 rocq-stdlib/theories/Strings/Byte.v.html │ │ 1.46 1.13 -0.3296 -22.52% 1142 rocq-stdlib/theories/FSets/FMapAVL.v.html │ │ 1.4 1.084 -0.3160 -22.57% 937 coq-vst/veric/binop_lemmas2.v.html │ │ 38.5 38.1 -0.3095 -0.80% 224 coq-performance-tests-lite/PerformanceExperiments/rewrite_lift_lets_map.v.html │ │ 3.991 3.76 -0.2310 -5.79% 241 coq-vst/floyd/subsume_funspec.v.html │ │ 19.6 19.3 -0.2289 -1.17% 481 coq-verdi-raft/theories/RaftProofs/EndToEndLinearizability.v.html │ │ 29.7 29.4 -0.2258 -0.76% 12 coq-fourcolor/theories/proof/job165to189.v.html │ │ 0.229 0.00767 -0.2216 -96.65% 111 coq-mathcomp-odd-order/theories/BGsection6.v.html │ │ 0.222 0.000797 -0.2214 -99.64% 714 rocq-metarocq-erasure/erasure/theories/EReorderCstrs.v.html │ │ 0.219 0.00343 -0.2155 -98.43% 77 rocq-metarocq-erasure/erasure/theories/EReorderCstrs.v.html │ │ 0.220 0.00418 -0.2154 -98.10% 79 coq-mathcomp-odd-order/theories/BGsection9.v.html │ │ 0.536 0.321 -0.2152 -40.13% 634 rocq-stdlib/theories/setoid_ring/Field_theory.v.html │ │ 0.210 0.00374 -0.2058 -98.21% 228 rocq-metarocq-erasure/erasure/theories/Typed/TypeAnnotations.v.html │ │ 0.220 0.0207 -0.1993 -90.57% 123 rocq-metarocq-erasure/erasure/theories/EDeps.v.html │ │ 0.201 0.00221 -0.1987 -98.90% 349 rocq-metarocq-erasure/erasure/theories/Typed/OptimizeCorrectness.v.html │ │ 0.216 0.0181 -0.1981 -91.61% 101 rocq-metarocq-safechecker/safechecker/theories/PCUICTypeChecker.v.html │ │ 0.197 0.000550 -0.1969 -99.72% 136 rocq-metarocq-safechecker/safechecker/theories/PCUICSafeChecker.v.html │ │ 0.416 0.219 -0.1968 -47.31% 411 rocq-metarocq-erasure/erasure/theories/Typed/Erasure.v.html │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ |
There is some observable slowdown, but to some extent it's unavoidable since we now have to stuff in the environment. I don't think I have immediate plans to remove the canonical part of names but maybe it's something we have to consider if we want to pursue in this direction. What do people think about the severity of the slowdown? |
Adding some assertions shows that we're playing fast and loose with canonical names, but let's try at least this variant to assess the overall breakage / performance impact.