Skip to content

[ConstraintSystem] Guard all the performance hacks with a flag #82320

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

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 17, 2025

Package the flag into performanceHacksEnabled() method on
ConstraintSystem and start using it to wrap all of the hacks
in constraint generator and the solver.

Replace -disable-solver-shrink with -disable-constraint-solver-performance-hacks.

xedin added 2 commits June 17, 2025 13:52
It's folded into a more general "disable performance hacks" one.
Package the flag into `performanceHacksEnabled()` method on
`ConstraintSystem` and start using it to wrap all of the hacks
in constraint generator and the solver.
@xedin
Copy link
Contributor Author

xedin commented Jun 17, 2025

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jun 18, 2025

@swift-ci please test Windows platform

@xedin
Copy link
Contributor Author

xedin commented Jun 18, 2025

@swift-ci please test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Jun 18, 2025

@swift-ci please test Windows platform

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Jun 18, 2025

@swift-ci please test Windows platform

@xedin
Copy link
Contributor Author

xedin commented Jun 19, 2025

@swift-ci please test macOS platform

@xedin xedin merged commit 286f975 into swiftlang:main Jun 20, 2025
5 checks passed
Comment on lines 76 to +77
auto &ctx = getASTContext();
assert(ctx.TypeCheckerOpts.DisableConstraintSolverPerformanceHacks ||
!solverState->BestScore || CurrentScore <= *solverState->BestScore);
assert(!solverState->BestScore || CurrentScore <= *solverState->BestScore);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xedin i noticed during a recent rebase & build that the ctx var is now marked unused after this change. was the new performanceHacksEnabled() method intended to continue to be consulted in this assertion, or is it safe to delete the now-unused var?

Copy link
Contributor Author

@xedin xedin Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s safe to remove the context variable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants