Keep track of which variables are section variables and use this info to fix bugs#21987
Conversation
b3a9eeb to
38aca30
Compare
38aca30 to
7551c70
Compare
|
hott failure is because they workaround #18858 by explcitly clearing |
|
@coqbot ci minimize ci-stdlib |
|
🏁 Bench results: INFO: failed to install rocq-mathcomp-group-representation (dependency rocq-mathcomp-field failed) 🐢 Top 25 slow downs┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SLOW DOWNS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 200 202 2.4482 1.23% 8 coq-neural-net-interp-computed-lite/theories/MaxOfTwoNumbersSimpler/Computed/AllLogits.v.html │ │ 17.5 18.3 0.7390 4.22% 31 coq-engine-bench-lite/coq/PerformanceDemos/pattern.v.html │ │ 0.930 1.64 0.7097 76.28% 572 rocq-stdlib/theories/MSets/MSetAVL.v.html │ │ 48.6 49.2 0.6097 1.25% 376 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 36.8 37.3 0.5113 1.39% 139 coq-fiat-parsers/src/Parsers/Refinement/SharpenedJSON.v.html │ │ 18.2 18.6 0.3905 2.14% 481 coq-verdi-raft/theories/RaftProofs/EndToEndLinearizability.v.html │ │ 0.192 0.546 0.3546 184.91% 592 rocq-stdlib/theories/MSets/MSetAVL.v.html │ │ 38.1 38.5 0.3497 0.92% 224 coq-performance-tests-lite/PerformanceExperiments/rewrite_lift_lets_map.v.html │ │ 38.8 39.1 0.3479 0.90% 236 coq-rewriter/src/Rewriter/Rewriter/Examples/PerfTesting/LiftLetsMap.v.html │ │ 25.3 25.7 0.3285 1.30% 13 coq-fourcolor/theories/proof/job618to622.v.html │ │ 0.807 1.13 0.3271 40.54% 200 rocq-stdlib/theories/Numbers/HexadecimalNat.v.html │ │ 9.44 9.74 0.3074 3.26% 87 coq-engine-bench-lite/coq/PerformanceDemos/quadratic_reduction.v.html │ │ 21.1 21.4 0.3007 1.43% 13 coq-fourcolor/theories/proof/job219to222.v.html │ │ 0.278 0.577 0.2988 107.31% 163 rocq-stdlib/theories/Numbers/HexadecimalPos.v.html │ │ 26.4 26.7 0.2965 1.12% 375 coq-unimath/UniMath/ModelCategories/Generated/LNWFSMonoidalStructure.v.html │ │ 0.196 0.478 0.2820 143.57% 1187 rocq-stdlib/theories/Strings/Byte.v.html │ │ 25.7 26.0 0.2421 0.94% 13 coq-fourcolor/theories/proof/job499to502.v.html │ │ 0.238 0.477 0.2394 100.68% 13 rocq-stdlib/theories/micromega/ZCoeff.v.html │ │ 0.220 0.456 0.2368 107.84% 1982 rocq-stdlib/theories/FSets/FMapFacts.v.html │ │ 3.38 3.62 0.2357 6.97% 492 rocq-stdlib/theories/Reals/Cauchy/ConstructiveCauchyRealsMult.v.html │ │ 0.00563 0.239 0.2330 4137.55% 380 coq-fourcolor/theories/proof/dedekind.v.html │ │ 0.00551 0.237 0.2317 4207.90% 402 coq-fourcolor/theories/proof/finitize.v.html │ │ 0.386 0.616 0.2300 59.58% 19 rocq-stdlib/theories/ZArith/Zcompare.v.html │ │ 17.4 17.6 0.2285 1.31% 13 coq-fourcolor/theories/proof/job550to553.v.html │ │ 0.0231 0.247 0.2235 967.85% 341 coq-fourcolor/theories/proof/discretize.v.html │ └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ 🐇 Top 25 speed ups┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ TOP 25 SPEED UPS │ │ │ │ OLD NEW DIFF %DIFF Ln FILE │ ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 90.7 89.4 -1.2399 -1.37% 968 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 90.2 89.2 -1.0445 -1.16% 999 coq-performance-tests-lite/src/fiat_crypto_via_setoid_rewrite_standalone.v.html │ │ 0.756 0.291 -0.4650 -61.54% 484 rocq-stdlib/theories/Numbers/HexadecimalFacts.v.html │ │ 1.34 0.887 -0.4557 -33.94% 702 rocq-stdlib/theories/Numbers/HexadecimalFacts.v.html │ │ 0.692 0.292 -0.4006 -57.87% 374 rocq-stdlib/theories/Sorting/SetoidList.v.html │ │ 25.5 25.1 -0.3816 -1.50% 13 coq-fourcolor/theories/proof/job279to282.v.html │ │ 7.63 7.29 -0.3427 -4.49% 602 coq-unimath/UniMath/CategoryTheory/EnrichedCats/Limits/Examples/StructureEnrichedLimits.v.html │ │ 0.901 0.563 -0.3384 -37.55% 816 rocq-stdlib/theories/MSets/MSetRBT.v.html │ │ 26.8 26.5 -0.3143 -1.17% 13 coq-fourcolor/theories/proof/job399to438.v.html │ │ 16.8 16.5 -0.2962 -1.77% 13 coq-fourcolor/theories/proof/job235to238.v.html │ │ 0.652 0.357 -0.2947 -45.21% 11 rocq-stdlib/theories/ZArith/Zpow_alt.v.html │ │ 20.2 19.9 -0.2929 -1.45% 79 coq-rewriter/src/Rewriter/Rewriter/Examples/PerfTesting/SieveOfEratosthenes.v.html │ │ 0.598 0.316 -0.2822 -47.19% 14 rocq-stdlib/theories/extraction/ExtrOcamlZBigInt.v.html │ │ 0.698 0.421 -0.2768 -39.69% 1604 rocq-stdlib/theories/micromega/Tauto.v.html │ │ 7.22 6.96 -0.2604 -3.61% 604 coq-unimath/UniMath/CategoryTheory/EnrichedCats/Colimits/Examples/StructureEnrichedColimits.v.html │ │ 26.9 26.7 -0.2570 -0.95% 13 coq-fourcolor/theories/proof/job190to206.v.html │ │ 26.0 25.7 -0.2554 -0.98% 13 coq-fourcolor/theories/proof/job466to485.v.html │ │ 0.236 0.000953 -0.2348 -99.60% 376 coq-fourcolor/theories/proof/dedekind.v.html │ │ 21.0 20.8 -0.2332 -1.11% 13 coq-fourcolor/theories/proof/job307to310.v.html │ │ 0.544 0.312 -0.2320 -42.61% 13 rocq-stdlib/theories/ZArith/Zmin.v.html │ │ 0.238 0.00781 -0.2302 -96.72% 400 coq-fourcolor/theories/proof/finitize.v.html │ │ 0.258 0.0295 -0.2288 -88.57% 543 coq-fourcolor/theories/proof/dedekind.v.html │ │ 18.3 18.1 -0.2272 -1.24% 13 coq-fourcolor/theories/proof/job271to278.v.html │ │ 0.508 0.282 -0.2257 -44.41% 16 rocq-stdlib/theories/micromega/EnvRing.v.html │ │ 0.220 0.00147 -0.2190 -99.33% 287 coq-fourcolor/theories/proof/approx.v.html │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ |
|
https://github.com/math-comp/odd-order/blob/6afa795b9018c64ab5c7cd2f9b3c9ab5dd45d93f/theories/PFsection3.v#L1119 minimized: Require Import ssreflect.
Axiom f : True -> False -> nat.
Tactic Notation "uexact" constr(IH) := apply: id IH; exact I.
Goal True -> nat.
Proof.
intros x.
uexact x.
@gares any ideas? |
|
I think that it is possible that some SSR code does not substitute ltac variables correctly. |
|
Can be turned into a bug on master #22057 |
|
Rocq call: seems like the right direction |
|
I've updated the elpi overlay. |
This lets us detect if a variable is some unrelated variable which got renamed to the name of a previously cleared section variable. It's also cheaper than conversion but that's not really the point of this patch. Fix rocq-prover#11487
This is accessible through Ltac2 Std.clear which doesn't check the ids before sending to Tactics.clear, and through ltac1 by abusing bound values eg `Ltac foo := match goal with H : _ |- _ => clear H; clear H end`
Termops.is_section_variable is deprecated and a new API Termops.is_section_variable' is added because their types are the same but they need different env arguments so changing in place would be too footgunny. ssr still uses the old "is it in global env" because IDK what it is doing. Fix rocq-prover#18858
when this invariant is broken secvar checking produces another assert failure later
gares
left a comment
There was a problem hiding this comment.
Looks good.
I'd rename the new API as suggested
| let cl = Evd.evar_concl evi in | ||
| let relevance = Evd.evar_relevance evi in | ||
| let ans = | ||
| (* Why can this get called with an unknown id? *) |
There was a problem hiding this comment.
because some new evars may be pruned already wrt that id
|
@coqbot merge now |
|
@gares: Please take care of the following overlays:
|
Named declarations now contain an extra field
status = SecVar | ProofVar. SecVar means it is a section variable.To work this requires the invariant that if a variable is marked SecVar in an evar's context then that evar is always instantiated with that section variable.
Fix #18858
Fix #12304
Fix #11487
Fix #6773
Overlays (.v):
Overlays (.v, not backwards compatible)
Overlays (.ml):
Overlays not needed now that clear warns instead of error on unbound variable: