Skip to content

[Merged by Bors] - fix: don't resynthesize type class arguments in fun_prop#15842

Closed
lecopivo wants to merge 6 commits intomasterfrom
lecopivo/fun_prop_tc_args
Closed

[Merged by Bors] - fix: don't resynthesize type class arguments in fun_prop#15842
lecopivo wants to merge 6 commits intomasterfrom
lecopivo/fun_prop_tc_args

Conversation

@lecopivo
Copy link
Copy Markdown
Collaborator

@lecopivo lecopivo commented Aug 15, 2024

fun_prop was resynthesizing type class arguments the same way as simp used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from fun_prop too.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 15, 2024

PR summary 08cc6a21bf

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ Dif_Con
+ Dif_apply
+ Dif_applyDep
+ Dif_comp
+ Dif_const
+ Dif_id
+ Dif_pi
+ f4
+ f4_dif

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.

@grunweg grunweg added the t-meta Tactics, attributes or user commands label Aug 15, 2024
@grunweg grunweg changed the title fun_prop should not resynthesize type class arguments fix: don't resynthesize type class arguments in fun_prop Aug 15, 2024
@j-loreaux
Copy link
Copy Markdown
Contributor

!bench

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Here are the benchmark results for commit 34538ab.
There were significant changes against commit 3e38319:

  Benchmark                                              Metric         Change
  ============================================================================
- ~Mathlib.Analysis.FunctionalSpaces.SobolevInequality   instructions    16.8%

@j-loreaux
Copy link
Copy Markdown
Contributor

I don't understand at all why this would make anything slower. I will note that the places using fun_prop the most (continuous functional calculus files) did get marginally faster.

@lecopivo
Copy link
Copy Markdown
Collaborator Author

I also find it baffling. My wild guess is that type classes are cached anyway so resynthesizing them is not such a big deal. However, you might end up with instances that are defeq but not trivially so type checking takes longer.

But I do not know what the "instructions" metric is.

@ghost ghost added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 17, 2024
@j-loreaux
Copy link
Copy Markdown
Contributor

Instructions are the best proxy we have for "amount of computation done independent of hardware"

@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Aug 17, 2024
@lecopivo
Copy link
Copy Markdown
Collaborator Author

Do we want to merge this? Is the 16% increase on that one file a blocker? Should that be investigated?

@j-loreaux
Copy link
Copy Markdown
Contributor

I'm not entirely sure about this. It does speed things up a bit in the continuous functional calculus portion of the library, where we use fun_prop heavily, but I don't have a good understanding of the slowdown in the Sobolev file.

maintainer merge

@github-actions
Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by j-loreaux.

@github-actions github-actions bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Aug 29, 2024
@mattrobball
Copy link
Copy Markdown
Contributor

Overall instructions are basically flat. So from that perspective this is fine. I think the slowdown you see is exactly as @lecopivo surmised (and as core would probably chastise us for). But if this works where it needs to right now, I think it is ok to run with and evaluate as we go.

bors merge

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Aug 29, 2024
mathlib-bors bot pushed a commit that referenced this pull request Aug 29, 2024
`fun_prop` was resynthesizing type class arguments the same way as  `simp` used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from `fun_prop` too.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 29, 2024

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request Aug 29, 2024
`fun_prop` was resynthesizing type class arguments the same way as  `simp` used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from `fun_prop` too.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 29, 2024

Build failed (retrying...):

mathlib-bors bot pushed a commit that referenced this pull request Aug 29, 2024
`fun_prop` was resynthesizing type class arguments the same way as  `simp` used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from `fun_prop` too.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 29, 2024

Build failed:

@sgouezel
Copy link
Copy Markdown
Contributor

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Aug 30, 2024
`fun_prop` was resynthesizing type class arguments the same way as  `simp` used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from `fun_prop` too.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 30, 2024

Build failed (retrying...):

@sgouezel
Copy link
Copy Markdown
Contributor

bors r-
Can you merge master, fix the lint, and then send it back to bors?
bors d+

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 30, 2024

✌️ lecopivo can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 30, 2024

Canceled.

@github-actions github-actions bot added the delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). label Aug 30, 2024
@lecopivo
Copy link
Copy Markdown
Collaborator Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Aug 31, 2024
`fun_prop` was resynthesizing type class arguments the same way as  `simp` used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from `fun_prop` too.
@mathlib-bors
Copy link
Copy Markdown
Contributor

mathlib-bors bot commented Aug 31, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title fix: don't resynthesize type class arguments in fun_prop [Merged by Bors] - fix: don't resynthesize type class arguments in fun_prop Aug 31, 2024
@mathlib-bors mathlib-bors bot closed this Aug 31, 2024
@mathlib-bors mathlib-bors bot deleted the lecopivo/fun_prop_tc_args branch August 31, 2024 21:46
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
`fun_prop` was resynthesizing type class arguments the same way as  `simp` used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from `fun_prop` too.
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 9, 2024
`fun_prop` was resynthesizing type class arguments the same way as  `simp` used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from `fun_prop` too.
bjoernkjoshanssen pushed a commit that referenced this pull request Sep 12, 2024
`fun_prop` was resynthesizing type class arguments the same way as  `simp` used to do. It seems to cause just troubles and seemingly no benefit so let's remove it from `fun_prop` too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants