Skip to content
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

swap::regroup fails on complicated reorderings #12

Open
tangentstorm opened this issue Feb 17, 2025 · 1 comment
Open

swap::regroup fails on complicated reorderings #12

tangentstorm opened this issue Feb 17, 2025 · 1 comment

Comments

@tangentstorm
Copy link
Owner

The plan_regroup function makes a plan for moving variables into place.

The "plan" is just a hashmap of variables that need to be moved, and the position into which they should go. Unfortunately, it is not a very good plan.

The problem is this algorithm was designed for the simple needs of the swap solver: moving a set of variables up to the top. But now that we have reorder_by_force, which can generate a completely new ordering, it's quite possible to request orderings that the current algorithm can't solve for.

Basically, this algorithm needs to be reworked. In the meantime, it's still possible to achieve any ordering you want, simply by iteratively bringing the variables you want to the top. Start by passing [{everything else},{z}] to reorder, then `[{everything else},{y},{z}], until you have all your variables in individual hash sets.

I hope to fix this soon. I'm mostly putting this here in case anyone runs into the problem before it's fixed.

@tangentstorm
Copy link
Owner Author

There's a grok chat here with a working animation of the algorithm we want.
https://grok.com/chat/92f54565-20c3-4bfa-bd47-69f5765129fa

Image

@tangentstorm tangentstorm added this to bex Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant