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

Symmetry reduction for rust facing API #84

Open
ArhanChaudhary opened this issue Jan 6, 2025 · 4 comments
Open

Symmetry reduction for rust facing API #84

ArhanChaudhary opened this issue Jan 6, 2025 · 4 comments
Labels

Comments

@ArhanChaudhary
Copy link

I noticed that the rust facing implementation of twsearch seemingly doesn't perform symmetry reduction for search, in the pruning table population and idf implementation. The C++ side of twsearch seems to perform these optimizations in calcsymm.cpp, though, besides the light introduction from docs/architecture.md, I have no idea how it works. Are there any plans for implementing optimizations regarding symmetry and rotations? If not, I can attempt to rudimentarily port it myself, but my cube theory knowledge is admittedly relatively minimal.

@rokicki
Copy link
Collaborator

rokicki commented Jan 6, 2025 via email

@lgarron
Copy link
Member

lgarron commented Jan 6, 2025

Yeah, this would definitely be great to have at some point.

We have the SearchOptimizations trait that this can plug into when once need this for an implement (probably 4x4x4), although it could be directly implemented into individual coordinates when the math allows.

@ArhanChaudhary
Copy link
Author

I think the first step to getting it into the Rust code would be to figure out how to distinguish "moves" from "rotations". Right now the C++ code does it based on the move name, but an alternate approach is to do it based on the pieces moved. I'd be happy to answer specific questions or add text to the architecture document if you can point out where things are insufficiently clear.

On Sun, Jan 5, 2025 at 8:12 PM Arhan Chaudhary @.> wrote: I noticed that the rust facing implementation of twsearch seemingly doesn't perform symmetry reduction for search, in the pruning table population

and idf implementation . The C++ side of twsearch seems to perform these optimizations in calcsymm.cpp, though, besides the light introduction from docs/architecture.md, I have no idea how it works. Are there any plans for implementing optimizations regarding symmetry and rotations? If not, I can attempt to rudimentarily port it myself, but my cube theory knowledge is admittedly relatively minimal. — Reply to this email directly, view it on GitHub <#84>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOLS4HHIY23PG7IFH6GUL2JH7ERAVCNFSM6AAAAABUU2V2CWVHI2DSMVQWIX3LMV43ASLTON2WKOZSG43DSNZXHAYDIOA . You are receiving this because you are subscribed to this thread.Message ID: @.>
-- - https://cube20.org/ http://cube20.org/ - https://golly.sf.net/ http://golly.sf.net/ - https://alpha.twizzle.net/ / -

I spent the day brushing up on cube theory. I can certainly try my hand at porting symmetry reduction from C++ to Rust after I implement puzzlegeometry in cubing.rs as that is more important to get working for my use case. We will ideally want to support group inversion pruning in the Rust port as well (if not already in twsearch) for another 2x factor in pruning table size. I have a few questions:

I was wondering if you could elaborate more on this idea, from docs/architectures.md:

We only compute the value of the first
permutation element of the first set for each symmetry element. We
take the least resulting value, and identify only those symmetry
elements that give us that value. If there is only one symmetry element
left, we know precisely which full conjugation to perform, and we
do that one and return.

I'm not sure what "first set" refers to, and even after rereading, this section is difficult to comprehend. Maybe an example could help me understand.

I noticed in your original cube20 paper that a novel set cover solution to be described in a later publication was able to reduce the number of cosets to be checked 2.5x, but I wasn't able to find this publication or details of how it worked online. Is this only applicable to coset solvers? If not, twsearch would greatly benefit from such a number.

Lastly, I poked around the codebase some more and realized that gensymm from calcsymm.cpp is never actually called anywhere. If not in that file, which part of twsearch performs the relevant symmetry reductions?

Thanks!

@rokicki
Copy link
Collaborator

rokicki commented Jan 7, 2025 via email

@lgarron lgarron added the rust label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants