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
Kernel sort polymorphism #17836
Kernel sort polymorphism #17836
Conversation
@coqbot bench |
🏁 Bench results:
INFO: failed to install coq-mathcomp-fingroup (dependency coq-mathcomp-ssreflect failed) 🐢 Top 25 slow downs┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SLOW DOWNS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 142.5400 149.3610 6.8210 4.79% 1190 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 24.1850 27.8100 3.6250 14.99% 618 coq-perennial/src/program_proof/simplepb/pb_applybackup_proof.v.html │ │ 20.0350 23.3340 3.2990 16.47% 269 coq-perennial/src/program_proof/memkv/memkv_coord_start_proof.v.html │ │ 45.7470 48.6590 2.9120 6.37% 1002 coq-perennial/src/program_proof/simplepb/pb_apply_proof.v.html │ │ 55.2240 58.0160 2.7920 5.06% 609 coq-bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html │ │ 31.4420 33.6270 2.1850 6.95% 577 coq-perennial/src/program_proof/simplepb/pb_becomeprimary_proof.v.html │ │ 36.8100 38.9830 2.1730 5.90% 522 coq-perennial/src/program_proof/txn/twophase_refinement_proof.v.html │ │ 21.5010 23.4300 1.9290 8.97% 420 coq-perennial/src/program_proof/simplepb/pb_setstate_proof.v.html │ │ 17.6830 19.5210 1.8380 10.39% 875 coq-perennial/src/program_proof/simple/setattr.v.html │ │ 31.3890 33.2110 1.8220 5.80% 839 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 20.4200 22.0290 1.6090 7.88% 808 coq-perennial/src/program_proof/wal/logger_proof.v.html │ │ 13.3070 14.7980 1.4910 11.20% 1230 coq-perennial/src/program_proof/simplepb/apps/eesm_proof.v.html │ │ 29.1140 30.6030 1.4890 5.11% 1449 coq-unimath/UniMath/CategoryTheory/EnrichedCats/Examples/KleisliEnriched.v.html │ │ 26.7830 28.2160 1.4330 5.35% 824 coq-perennial/src/program_proof/aof/proof.v.html │ │ 26.7170 28.0650 1.3480 5.05% 898 coq-perennial/src/program_proof/simplepb/admin_proof.v.html │ │ 24.5140 25.8170 1.3030 5.32% 667 coq-perennial/src/program_proof/simplepb/pb_roapply_proof.v.html │ │ 20.8470 22.1400 1.2930 6.20% 595 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 24.9620 26.2360 1.2740 5.10% 373 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 20.5940 21.8080 1.2140 5.89% 1357 coq-perennial/src/program_proof/wal/installer_proof.v.html │ │ 3.2700 4.4530 1.1830 36.18% 901 coq-perennial/src/goose_lang/interpreter/interpreter.v.html │ │ 5.5520 6.7240 1.1720 21.11% 1391 coq-perennial/src/program_proof/aof/proof.v.html │ │ 25.8330 26.9070 1.0740 4.16% 2293 coq-perennial/src/goose_lang/logical_reln_fund.v.html │ │ 6.6540 7.7170 1.0630 15.98% 281 coq-perennial/src/program_proof/memkv/memkv_shard_start_proof.v.html │ │ 9.9300 10.9900 1.0600 10.67% 343 coq-perennial/src/program_proof/simplepb/pb_getstate_proof.v.html │ │ 27.6300 28.6610 1.0310 3.73% 194 coq-vst/veric/expr_lemmas4.v.html │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 🐇 Top 25 speed ups┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SPEED UPS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 3.1790 2.3870 -0.7920 -24.91% 736 coq-stdlib/Reals/Cauchy/ConstructiveCauchyReals.v.html │ │ 9.4770 8.7480 -0.7290 -7.69% 192 coq-vst/veric/binop_lemmas5.v.html │ │ 7.2670 6.6680 -0.5990 -8.24% 1724 coq-perennial/src/program_proof/wal/recovery_proof.v.html │ │ 7.6620 7.2010 -0.4610 -6.02% 881 coq-vst/veric/binop_lemmas4.v.html │ │ 0.4110 0.0430 -0.3680 -89.54% 1004 coq-perennial/src/program_proof/grove_shared/urpc_proof.v.html │ │ 0.3990 0.0460 -0.3530 -88.47% 370 coq-perennial/src/program_proof/wal/circ_proof_crash.v.html │ │ 9.4270 9.0770 -0.3500 -3.71% 1020 coq-perennial/src/program_proof/grove_shared/urpc_proof.v.html │ │ 3.9440 3.6060 -0.3380 -8.57% 154 coq-vst/veric/binop_lemmas5.v.html │ │ 3.1400 2.8420 -0.2980 -9.49% 475 coq-vst/veric/binop_lemmas3.v.html │ │ 1.4400 1.1750 -0.2650 -18.40% 853 coq-stdlib/FSets/FMapAVL.v.html │ │ 3.3770 3.1130 -0.2640 -7.82% 163 coq-vst/veric/Clight_mapsto_memory_block.v.html │ │ 1.2780 1.0250 -0.2530 -19.80% 88 coq-engine-bench-lite/coq/PerformanceDemos/quadratic_reduction.v.html │ │ 1.8280 1.5780 -0.2500 -13.68% 937 coq-vst/veric/binop_lemmas2.v.html │ │ 1.2330 1.0220 -0.2110 -17.11% 200 coq-stdlib/Numbers/HexadecimalNat.v.html │ │ 3.9680 3.7580 -0.2100 -5.29% 8 coq-engine-bench-lite/coq/PerformanceDemos/repeated_conj.v.html │ │ 14.3580 14.1510 -0.2070 -1.44% 308 coq-perennial/src/Helpers/byte_explode.v.html │ │ 0.3280 0.1440 -0.1840 -56.10% 1037 coq-stdlib/Reals/Abstract/ConstructiveReals.v.html │ │ 0.5010 0.3200 -0.1810 -36.13% 1363 coq-stdlib/FSets/FMapAVL.v.html │ │ 2.1430 1.9640 -0.1790 -8.35% 209 coq-stdlib/setoid_ring/Ncring_tac.v.html │ │ 0.2820 0.1050 -0.1770 -62.77% 61 coq-perennial/src/program_proof/mvcc/index_proof.v.html │ │ 0.1870 0.0120 -0.1750 -93.58% 361 coq-unimath/UniMath/CategoryTheory/Monoidal/AlternativeDefinitions/EquivalenceWhiskeredNonCurriedMonoidalCategories.v.html │ │ 0.4540 0.2800 -0.1740 -38.33% 860 coq-stdlib/FSets/FMapAVL.v.html │ │ 0.3410 0.1710 -0.1700 -49.85% 498 coq-color/Term/Lambda/LCompClos.v.html │ │ 0.2560 0.0880 -0.1680 -65.62% 1097 coq-stdlib/Reals/Abstract/ConstructiveReals.v.html │ │ 0.1680 0.0040 -0.1640 -97.62% 90 coq-perennial/src/program_proof/txn/wrapper_init_proof.v.html │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ |
@coqbot bench |
@coqbot bench |
🏁 Bench results:
INFO: failed to install coq-mathcomp-fingroup (dependency coq-mathcomp-ssreflect failed) 🐢 Top 25 slow downs┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SLOW DOWNS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 141.8220 149.3840 7.5620 5.33% 1190 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 24.1860 27.6240 3.4380 14.21% 618 coq-perennial/src/program_proof/simplepb/pb_applybackup_proof.v.html │ │ 20.5560 23.2010 2.6450 12.87% 269 coq-perennial/src/program_proof/memkv/memkv_coord_start_proof.v.html │ │ 45.8200 47.9670 2.1470 4.69% 1002 coq-perennial/src/program_proof/simplepb/pb_apply_proof.v.html │ │ 31.2790 33.1460 1.8670 5.97% 839 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 21.4470 23.2140 1.7670 8.24% 420 coq-perennial/src/program_proof/simplepb/pb_setstate_proof.v.html │ │ 17.5540 19.3110 1.7570 10.01% 875 coq-perennial/src/program_proof/simple/setattr.v.html │ │ 55.8200 57.4480 1.6280 2.92% 609 coq-bedrock2/bedrock2/src/bedrock2Examples/lightbulb.v.html │ │ 13.1980 14.7650 1.5670 11.87% 1230 coq-perennial/src/program_proof/simplepb/apps/eesm_proof.v.html │ │ 46.3600 47.8860 1.5260 3.29% 558 coq-bedrock2/bedrock2/src/bedrock2Examples/insertionsort.v.html │ │ 20.5190 21.9530 1.4340 6.99% 1357 coq-perennial/src/program_proof/wal/installer_proof.v.html │ │ 31.4150 32.8240 1.4090 4.49% 577 coq-perennial/src/program_proof/simplepb/pb_becomeprimary_proof.v.html │ │ 24.4020 25.7630 1.3610 5.58% 667 coq-perennial/src/program_proof/simplepb/pb_roapply_proof.v.html │ │ 37.1160 38.4300 1.3140 3.54% 522 coq-perennial/src/program_proof/txn/twophase_refinement_proof.v.html │ │ 20.8390 22.1280 1.2890 6.19% 595 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 27.0090 28.2260 1.2170 4.51% 824 coq-perennial/src/program_proof/aof/proof.v.html │ │ 6.7040 7.8950 1.1910 17.77% 281 coq-perennial/src/program_proof/memkv/memkv_shard_start_proof.v.html │ │ 26.9390 28.1030 1.1640 4.32% 898 coq-perennial/src/program_proof/simplepb/admin_proof.v.html │ │ 24.9730 26.1030 1.1300 4.52% 373 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ │ 8.5530 9.6710 1.1180 13.07% 1508 coq-perennial/src/program_proof/wal/recovery_proof.v.html │ │ 3.3790 4.4130 1.0340 30.60% 901 coq-perennial/src/goose_lang/interpreter/interpreter.v.html │ │ 20.4380 21.4660 1.0280 5.03% 808 coq-perennial/src/program_proof/wal/logger_proof.v.html │ │ 33.4440 34.4700 1.0260 3.07% 97 coq-vst/veric/binop_lemmas5.v.html │ │ 8.4150 9.4400 1.0250 12.18% 350 coq-perennial/src/program_proof/simple/read.v.html │ │ 18.2700 19.2910 1.0210 5.59% 1286 coq-unimath/UniMath/CategoryTheory/GrothendieckConstruction/IsPullback.v.html │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 🐇 Top 25 speed ups┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SPEED UPS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 131.1530 129.9870 -1.1660 -0.89% 999 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 131.3630 130.3830 -0.9800 -0.75% 968 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 63.3250 62.4090 -0.9160 -1.45% 139 coq-fiat-parsers/src/Parsers/Refinement/SharpenedJSON.v.html │ │ 41.9980 41.1510 -0.8470 -2.02% 224 coq-performance-tests-lite/PerformanceExperiments/rewrite_lift_lets_map.v.html │ │ 7.2810 6.6620 -0.6190 -8.50% 1724 coq-perennial/src/program_proof/wal/recovery_proof.v.html │ │ 7.7800 7.2170 -0.5630 -7.24% 881 coq-vst/veric/binop_lemmas4.v.html │ │ 21.6410 21.1910 -0.4500 -2.08% 1495 coq-unimath/UniMath/CategoryTheory/EnrichedCats/Examples/UnivalentKleisliEnriched.v.html │ │ 1.2570 0.8890 -0.3680 -29.28% 382 coq-stdlib/setoid_ring/Ncring_polynom.v.html │ │ 4.1750 3.8280 -0.3470 -8.31% 125 coq-fiat-parsers/src/Parsers/Refinement/SharpenedJSON.v.html │ │ 4.7660 4.4250 -0.3410 -7.15% 102 coq-engine-bench-lite/coq/PerformanceDemos/rewrite_strat_repeated_app.v.html │ │ 16.2280 15.9220 -0.3060 -1.89% 31 coq-engine-bench-lite/coq/PerformanceDemos/pattern.v.html │ │ 1.4250 1.1240 -0.3010 -21.12% 853 coq-stdlib/FSets/FMapAVL.v.html │ │ 2.5050 2.2050 -0.3000 -11.98% 1383 coq-perennial/src/program_proof/aof/proof.v.html │ │ 0.5740 0.2780 -0.2960 -51.57% 301 coq-stdlib/Reals/Abstract/ConstructiveLimits.v.html │ │ 0.4550 0.1640 -0.2910 -63.96% 925 coq-perennial/src/program_proof/grove_shared/urpc_proof.v.html │ │ 1.2910 1.0060 -0.2850 -22.08% 88 coq-engine-bench-lite/coq/PerformanceDemos/quadratic_reduction.v.html │ │ 0.6980 0.4190 -0.2790 -39.97% 870 coq-stdlib/MSets/MSetRBT.v.html │ │ 3.9820 3.7130 -0.2690 -6.76% 8 coq-engine-bench-lite/coq/PerformanceDemos/repeated_conj.v.html │ │ 4.3700 4.1160 -0.2540 -5.81% 128 coq-fiat-parsers/src/Parsers/Refinement/SharpenedJSON.v.html │ │ 33.2040 32.9560 -0.2480 -0.75% 1730 coq-perennial/src/program_proof/simplepb/simplelog/proof.v.html │ │ 1.8670 1.6270 -0.2400 -12.85% 937 coq-vst/veric/binop_lemmas2.v.html │ │ 0.7620 0.5230 -0.2390 -31.36% 2052 coq-stdlib/FSets/FMapFacts.v.html │ │ 1.4610 1.2320 -0.2290 -15.67% 372 coq-stdlib/setoid_ring/Ncring_polynom.v.html │ │ 9.2670 9.0440 -0.2230 -2.41% 1020 coq-perennial/src/program_proof/grove_shared/urpc_proof.v.html │ │ 0.7640 0.5420 -0.2220 -29.06% 422 coq-stdlib/MSets/MSetList.v.html │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ |
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
0cf909b
to
f456cbd
Compare
Sort polymorphic cumulativity could be guarded behind a flag like polymorphic indicative cumulativity, and the flag could emit a warning that this setting may result in broken extraction (though it's not clear to me what would break), right? Then we should be able to replace template poly with sort poly without risking extraction any more than we already do. |
f456cbd
to
8a072b5
Compare
The job library:ci-fiat_crypto_legacy has failed in allow failure mode |
Let's merge, this has waited long enough. @coqbot merge now |
@ppedrot: Please take care of the following overlays:
|
Adapt to coq/coq#17836 (sort poly)
Adapt to coq/coq#17836 (sort poly)
Adapt to coq/coq#17836 (sort poly)
Adapt to coq/coq#17836 (sort poly)
Adapt to coq/coq#17836 (sort poly)
Adapt to coq/coq#17836 (sort poly)
Adapt to coq/coq#17836 (sort poly)
Adapt to coq/coq#17836 (sort poly)
val pr_with_global_universes : ?binders:universe_binders -> Level.t -> Pp.t | ||
type full_name_list = lname list * lname list | ||
|
||
val pr_level_with_global_universes : ?binders:universe_binders -> Level.t -> Pp.t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 57 to 58 in 1e74738
val pr : t -> Pp.t | |
[@@deprecated "Use [UnivNames.pr_with_global_universes] instead if possible, otherwise [raw_pr]."] |
The name change was not reflected there
Adapt to coq/coq#17836 (sort poly)
Depends:
Binder syntax is
Definition foo@{sort_vars | univ_vars | univ_constraints} := ...
, if there is only one|
it means no sort variables (ie backwards compatible syntax).Instance syntax is
foo@{sort_vars | univ_vars}
.Sort polymorphic declarations need universe polymorphism to be on.
All non-named sort variables get collapsed, so sort poly is always explicit (although note that Unset Strict Universe Declaration works for qvars too, so
Definition foo := Type@{s | u}
is sort poly).Inductives with sort poly output in a future PR (notably this means mind_relevance is constant)
There is no variance for sort variables, so eg with (once sort poly inductives fully work)
Inductive prod@{s | u v |} (A:Type@{s | u}) (B@{s | v}) : Type@{s | max(u,v)} := pair : A -> B -> prod A B.
prod@{Prop | Set Set} True True
andprod@{Type | Set Set} True True
are not convertible.Not clear what the consequences are either way, I think we need them to be non convertible if we want to use the explicit instanciation to avoid extraction issues but it may prevent replacing template poly with sort poly.
It should be easier to add variance later if we want it than removing it if we don't want it so let's start without it.
TODO:
QVar q = QVar q'
it will tryq := q'
, ifq
is named it will fail, the failure is incorrect ifq'
is anonymous such thatq' := q
would have been possible)Nice to have but maybe for another PR:
Type@{q1|Set}
andType@{q2|Set}
)Overlays: