-
Notifications
You must be signed in to change notification settings - Fork 11
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
Feature Request: Limit prefix of solutions/generators #98
Comments
Are you looking for this in the C++ implementation or the Rust implementation? The Rust implementation supports this, although it's not hooked up as a commandline argument yet. |
So you mean by "banned prefix", is supported in the Rust implementation? I'm using it for some heavy search, so C++ version (which has multi-threading support) would be preferred. |
Okay, on the C++ codebase.
First, the symmetry reduction is only in the pruning table construction.
Yes, it is
possible to recognize symmetry in an incoming position and reduce the search
space based on that, but twsearch does not presently do that. Adding this
likely
would be pretty easy (as the main functionality could be adapted directly
from
what happens with the pruning table). If it's that important to you let's
talk and
maybe we can get it done.
On limiting prefixes, that's also probably not too bad, except it's kind of
ugly
(do you limit prefixes of a single move? How do you manage the obvious
interaction with the canonical sequence generation?) Generally I just
generate
a bunch of sequences and filter out the ones I don't like but I understand
that
may not be as efficient as you want.
If you can motivate me with use cases, perhaps we can get some of this in
there. Or pull requests are always happily accepted. I think you might be
surprised how easy that first feature you want might end up being.
…On Wed, Jan 22, 2025 at 9:05 PM coldsun0630 ***@***.***> wrote:
So you mean by "banning prefix", is supported in the Rust implementation?
I'm using it for some heavy search, so C++ version (which has
multi-threading support) would be preferred.
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS2TOLLBHD67J7AHC3D2MB2BTAVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBYHA3DIOJRHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
My main interest is only in saving computation time. I wouldn't care about the "limiting prefixes" thing, if symmetry reduction is actually a viable option and way more straightforward to be implemented. I should mention that I am at a very beginner level in programming. I would like to, but I'm afraid to say that making any contribution to a project like this seems very difficult for me now. / I managed to find a 21 move solution for 1 case (it doesn't necessarily mean that 21 move is optimal, due to cube rotations):
I have tried for a ≤20 movers searching (depth ≤19 with "scramble+U", in fact) and couldn't get any solutions, for 2 cases (again, it yet doesn't mean an optimal solution is at least 21 movers, due to cube rotations):
And few minutes ago, a depth 20 search (for ≤21 movers) just completed and still no output, for 1 case (〃):
A depth 21 search on my processor is roughly estimated at 9 days, and I need to check all 12 possible cube rotations to prove its optimality, per case. |
Awesome and interesting work! Can I ask what FTO definition you are
using? If you're not
using one that is symmetry reduced, consider that.
Also, you might want to use one that fixes a corner; that will solve your
problem with cube
rotations.
What kind of machine are you using? How much RAM, how many threads?
…-tom
On Thu, Jan 23, 2025 at 3:48 PM coldsun0630 ***@***.***> wrote:
My main interest is only in saving computation time. I wouldn't care about
the "limiting prefixes" thing, if symmetry reduction is actually a viable
option and way more straightforward to be implemented.
I should mention that I am at a very beginner level in programming. I
would like to, but I'm afraid to say that making any contribution to a
project like this seems very difficult for me now.
/
In FTO, I'm looking for optimal solutions of 4 cases.
I managed to find a 21 move solution for 1 case (it doesn't necessarily
mean that 21 move is optimal, due to cube rotations):
Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' R B R' B' BR' U' BR
U B R B' R' U' BR' U BR B L B' L' BL' U' BL U L B L' B' U' BL' U BL L R L'
R' F' U' F U R L R' L' U' F' U F
//*pure* superswap of triangles + superflip of corners
Solution: U F' BR' U B' D R D' B R' F' BR' U D' L B' L' D F' B BR'
//*pseudo* superswap of triangles + superflip of corners
//(+ failed to find any ≤21 movers for the *pure* one.)
I have tried for a ≤20 movers searching (depth ≤19 with "scramble+U", in
fact) and couldn't get any solutions, for 2 cases (again, it yet doesn't
mean an optimal solution is at least 21 movers, due to cube rotations):
Scramble: U D' F' B U D' L' BR F' B L' BR R' BL F' B R' BL R B R' B' BR'
U' BR U B R B' R' U' BR' U BR B L B' L' BL' U' BL U L B L' B' U' BL' U BL L
R L' R' F' U' F U R L R' L' U' F' U F
//*pure* superswap of edges + superflip of corners
Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' U D' F' B U D' L'
BR F' B L' BR R' BL F' B R' BL R B R' B' BR' U' BR U B R B' R' U' BR' U BR
B L B' L' BL' U' BL U L B L' B' U' BL' U BL L R L' R' F' U' F U R L R' L'
U' F' U F
//*pure* superswap of triangles + superswap of edges + superflip of
corners
And few minutes ago, a depth 20 search (for ≤21 movers) just completed and
still no output, for 1 case (〃):
Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' U D' F' B U D' L'
BR F' B L' BR R' BL F' B R' BL
//*pure* superswap of triangles + superswap of edges
Log:
Solving FTO-superswap_triangles+superswap_edges+U
Depth 20 in 61420.3 lookups 5147769629523 rate 83.8122
A depth 21 search on my processor is roughly estimated at 9 days, and I
need to check all 12 possible cube rotations to prove its optimality, per
case.
I would just like to know if any of those cases can lead to raise the
current lower bound of FTO, and that's all for now.
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS66HC5Q4FN2LCO7PUT2MF5V7AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJRGI2DINBSGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm not sure you're using symmetry. If you want to use symmetry on the FTO
you can generate an
appropriate tws file by:
git clone https://github.com/cubing/cubing.js
bun ./cubing.js/src/bin/puzzle-geometry-bin.ts --ksolve --rotations
--optimize FTO > ftosymm.tws
(yep, you don't even need to build anything if you have bun.)
Using this tws file your searches should be significantly faster because
the pruning tables will be reduced
by symmetry and thus pack more oomph into the same space. (The nodes per
second will go down a bit
but the deeper pruning table will more than make up for that.)
If you want to factor out cube rotations, then specify a move set that
doesn't include (for instance) the
bottom corner. Something like this:
bun ./cubing.js/src/bin/puzzle-geometry-bin.ts --ksolve --rotations
--optimize --moves F,U,L,R,f,u,l,r FTO > ftosymm2.tws
By specifying this move set, you are fixing a single corner. Of course all
solutions (and inputs) will be restricted
to these moves, so you'll have to "undo" the move mapping. With this, the
symmetry will be reduced from 24 to
4, so the speed won't be as fast as the symmetrical one above, but it will
still be faster than the one with no
symmetry.
If you want to have all the face moves available for input, but restrict to
the above move set for solving, you can
use:
bun ./cubing.js/src/bin/puzzle-geometry-bin.ts --ksolve --rotations
--optimize --moves F,U,L,R,f,u,l,r,D,BL,BR,B FTO > ftosymm3.tws
With this your input sequences can use all the moves, and as long as they
maintain the place of that corner that
the first eight don't move, you can solve them with just the first eight
moves, so you'll have to run your tws searches
giving the move list F,U,L,R,f,u,l,r, so you are doing a fixed-corner (and
thus, end-position-independent) solve.
Note that I don't yet have code that "unravels" a solution using
F,U,L,R,f,u,l,r into one that just uses face moves.
If this is a blocker we can write some pretty easily.
…-tom
On Thu, Jan 23, 2025 at 10:50 PM Tomas Rokicki ***@***.***> wrote:
Awesome and interesting work! Can I ask what FTO definition you are
using? If you're not
using one that is symmetry reduced, consider that.
Also, you might want to use one that fixes a corner; that will solve your
problem with cube
rotations.
What kind of machine are you using? How much RAM, how many threads?
-tom
On Thu, Jan 23, 2025 at 3:48 PM coldsun0630 ***@***.***>
wrote:
> My main interest is only in saving computation time. I wouldn't care
> about the "limiting prefixes" thing, if symmetry reduction is actually a
> viable option and way more straightforward to be implemented.
>
> I should mention that I am at a very beginner level in programming. I
> would like to, but I'm afraid to say that making any contribution to a
> project like this seems very difficult for me now.
>
> /
> In FTO, I'm looking for optimal solutions of 4 cases.
>
> I managed to find a 21 move solution for 1 case (it doesn't necessarily
> mean that 21 move is optimal, due to cube rotations):
>
> Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' R B R' B' BR' U'
> BR U B R B' R' U' BR' U BR B L B' L' BL' U' BL U L B L' B' U' BL' U BL L R
> L' R' F' U' F U R L R' L' U' F' U F
> //*pure* superswap of triangles + superflip of corners
>
> Solution: U F' BR' U B' D R D' B R' F' BR' U D' L B' L' D F' B BR'
> //*pseudo* superswap of triangles + superflip of corners
> //(+ failed to find any ≤21 movers for the *pure* one.)
>
> I have tried for a ≤20 movers searching (depth ≤19 with "scramble+U", in
> fact) and couldn't get any solutions, for 2 cases (again, it yet doesn't
> mean an optimal solution is at least 21 movers, due to cube rotations):
>
> Scramble: U D' F' B U D' L' BR F' B L' BR R' BL F' B R' BL R B R' B' BR'
> U' BR U B R B' R' U' BR' U BR B L B' L' BL' U' BL U L B L' B' U' BL' U BL L
> R L' R' F' U' F U R L R' L' U' F' U F
> //*pure* superswap of edges + superflip of corners
>
> Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' U D' F' B U D' L'
> BR F' B L' BR R' BL F' B R' BL R B R' B' BR' U' BR U B R B' R' U' BR' U BR
> B L B' L' BL' U' BL U L B L' B' U' BL' U BL L R L' R' F' U' F U R L R' L'
> U' F' U F
> //*pure* superswap of triangles + superswap of edges + superflip of
> corners
>
> And few minutes ago, a depth 20 search (for ≤21 movers) just completed
> and still no output, for 1 case (〃):
>
> Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' U D' F' B U D' L'
> BR F' B L' BR R' BL F' B R' BL
> //*pure* superswap of triangles + superswap of edges
>
> Log:
> Solving FTO-superswap_triangles+superswap_edges+U
> Depth 20 in 61420.3 lookups 5147769629523 rate 83.8122
>
> A depth 21 search on my processor is roughly estimated at 9 days, and I
> need to check all 12 possible cube rotations to prove its optimality, per
> case.
> I would just like to know if any of those cases can lead to raise the
> current lower bound of FTO, and that's all for now.
>
> —
> Reply to this email directly, view it on GitHub
> <#98 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAMOLS66HC5Q4FN2LCO7PUT2MF5V7AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJRGI2DINBSGM>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
--
- https://cube20.org/ <http://cube20.org/> - https://golly.sf.net/
<http://golly.sf.net/> - https://alpha.twizzle.net/
/ -
|
Finally, note that the speed of twsearch is roughly the product of the
amount of memory you let it use and
the amount of cycles you give it. If you're serious about exploring these
puzzles getting a machine with
significant RAM is highly recommended.
…-tom
On Fri, Jan 24, 2025 at 10:24 AM Tomas Rokicki ***@***.***> wrote:
I'm not sure you're using symmetry. If you want to use symmetry on the
FTO you can generate an
appropriate tws file by:
git clone https://github.com/cubing/cubing.js
bun ./cubing.js/src/bin/puzzle-geometry-bin.ts --ksolve --rotations
--optimize FTO > ftosymm.tws
(yep, you don't even need to build anything if you have bun.)
Using this tws file your searches should be significantly faster because
the pruning tables will be reduced
by symmetry and thus pack more oomph into the same space. (The nodes per
second will go down a bit
but the deeper pruning table will more than make up for that.)
If you want to factor out cube rotations, then specify a move set that
doesn't include (for instance) the
bottom corner. Something like this:
bun ./cubing.js/src/bin/puzzle-geometry-bin.ts --ksolve --rotations
--optimize --moves F,U,L,R,f,u,l,r FTO > ftosymm2.tws
By specifying this move set, you are fixing a single corner. Of course
all solutions (and inputs) will be restricted
to these moves, so you'll have to "undo" the move mapping. With this, the
symmetry will be reduced from 24 to
4, so the speed won't be as fast as the symmetrical one above, but it will
still be faster than the one with no
symmetry.
If you want to have all the face moves available for input, but restrict
to the above move set for solving, you can
use:
bun ./cubing.js/src/bin/puzzle-geometry-bin.ts --ksolve --rotations
--optimize --moves F,U,L,R,f,u,l,r,D,BL,BR,B FTO > ftosymm3.tws
With this your input sequences can use all the moves, and as long as they
maintain the place of that corner that
the first eight don't move, you can solve them with just the first eight
moves, so you'll have to run your tws searches
giving the move list F,U,L,R,f,u,l,r, so you are doing a fixed-corner (and
thus, end-position-independent) solve.
Note that I don't yet have code that "unravels" a solution using
F,U,L,R,f,u,l,r into one that just uses face moves.
If this is a blocker we can write some pretty easily.
-tom
On Thu, Jan 23, 2025 at 10:50 PM Tomas Rokicki ***@***.***> wrote:
> Awesome and interesting work! Can I ask what FTO definition you are
> using? If you're not
> using one that is symmetry reduced, consider that.
>
> Also, you might want to use one that fixes a corner; that will solve your
> problem with cube
> rotations.
>
> What kind of machine are you using? How much RAM, how many threads?
>
> -tom
>
> On Thu, Jan 23, 2025 at 3:48 PM coldsun0630 ***@***.***>
> wrote:
>
>> My main interest is only in saving computation time. I wouldn't care
>> about the "limiting prefixes" thing, if symmetry reduction is actually a
>> viable option and way more straightforward to be implemented.
>>
>> I should mention that I am at a very beginner level in programming. I
>> would like to, but I'm afraid to say that making any contribution to a
>> project like this seems very difficult for me now.
>>
>> /
>> In FTO, I'm looking for optimal solutions of 4 cases.
>>
>> I managed to find a 21 move solution for 1 case (it doesn't necessarily
>> mean that 21 move is optimal, due to cube rotations):
>>
>> Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' R B R' B' BR' U'
>> BR U B R B' R' U' BR' U BR B L B' L' BL' U' BL U L B L' B' U' BL' U BL L R
>> L' R' F' U' F U R L R' L' U' F' U F
>> //*pure* superswap of triangles + superflip of corners
>>
>> Solution: U F' BR' U B' D R D' B R' F' BR' U D' L B' L' D F' B BR'
>> //*pseudo* superswap of triangles + superflip of corners
>> //(+ failed to find any ≤21 movers for the *pure* one.)
>>
>> I have tried for a ≤20 movers searching (depth ≤19 with "scramble+U", in
>> fact) and couldn't get any solutions, for 2 cases (again, it yet doesn't
>> mean an optimal solution is at least 21 movers, due to cube rotations):
>>
>> Scramble: U D' F' B U D' L' BR F' B L' BR R' BL F' B R' BL R B R' B' BR'
>> U' BR U B R B' R' U' BR' U BR B L B' L' BL' U' BL U L B L' B' U' BL' U BL L
>> R L' R' F' U' F U R L R' L' U' F' U F
>> //*pure* superswap of edges + superflip of corners
>>
>> Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' U D' F' B U D' L'
>> BR F' B L' BR R' BL F' B R' BL R B R' B' BR' U' BR U B R B' R' U' BR' U BR
>> B L B' L' BL' U' BL U L B L' B' U' BL' U BL L R L' R' F' U' F U R L R' L'
>> U' F' U F
>> //*pure* superswap of triangles + superswap of edges + superflip of
>> corners
>>
>> And few minutes ago, a depth 20 search (for ≤21 movers) just completed
>> and still no output, for 1 case (〃):
>>
>> Scramble: U F BL' U F BL' U F R BL' L B' R L B' R L B' U D' F' B U D' L'
>> BR F' B L' BR R' BL F' B R' BL
>> //*pure* superswap of triangles + superswap of edges
>>
>> Log:
>> Solving FTO-superswap_triangles+superswap_edges+U
>> Depth 20 in 61420.3 lookups 5147769629523 rate 83.8122
>>
>> A depth 21 search on my processor is roughly estimated at 9 days, and I
>> need to check all 12 possible cube rotations to prove its optimality, per
>> case.
>> I would just like to know if any of those cases can lead to raise the
>> current lower bound of FTO, and that's all for now.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#98 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AAMOLS66HC5Q4FN2LCO7PUT2MF5V7AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJRGI2DINBSGM>
>> .
>> You are receiving this because you commented.Message ID:
>> ***@***.***>
>>
>
>
> --
> - https://cube20.org/ <http://cube20.org/> - https://golly.sf.net/
> <http://golly.sf.net/> - https://alpha.twizzle.net/
> / -
>
--
- https://cube20.org/ <http://cube20.org/> - https://golly.sf.net/
<http://golly.sf.net/> - https://alpha.twizzle.net/
/ -
|
Sorry for late response. I was writing a script for translating algorithms to UF corner be fixed. Now scrambles for all 4 cases are reduced to <BR, BL, B, D, br, bl, b, d> (which is not essential to be done), and any outputs should be able to be reduced into single-layer turns, later.
Yes, I had forgotten that obvious fact. I could fix one of any pieces that has a unique permutation. Thanks for reminding that and giving me a hint.
Here's the definition file I use:
Do you mean by 'symmetry' ignoring the permutation of centers on the same face? If so, then I may using the correct one.
Not really important thing, but doesn't it actually reduce from 12 to 2? Since the corners of FTO have only two possible orientations. (The other 2 of 4 orientations are not reachable with those regular turns.)
I've just checked my hardware info through my terminal:
i5-12600K has 16 threads(P6+E4), and I was running twsearch with '-M 16384 -t 12' options (which threads are allocated to all the performance cores, ...probably). If the conversation is going slightly off-topic from the issue, and if this isn't the best place to discuss such things, I could try reaching out to you via email, or Discord. (I'm also in the FTO server.) |
Here's the definition file I use:
https://pastebin.com/j3d8tPfU
Interesting! Okay, Did you make this by hand, or by modifying an existing
tws?
In any case, I did give you instructions on how to make a new FTO tws file
using cubing.js.
If you want to use slice moves too you can specify them with 2U (for
instance) instead of Us.
(Of course you can rename them after you generate the .tws file). I don't
need to remind you
then to specify your move set carefully to twsearch or else your branching
factor may be . . .
too high.
Do you mean by 'symmetry' ignoring the permutation of centers on the same
face? If so, then I may using the correct one.
No, symmetry in the pruning table. The positions generated by the
scrambles U, and B, and D,
etc., are all related by conjugation by a rotation; twsearch knows how to
take advantage of that
to pack more data into a given pruning table size. So here are some Fill
lines using normal FTO
without symmetry:
Filling depth 0 val 0 saw 1 (1) in 0.000432014 rate 0.00231474
Filling depth 1 val 0 saw 16 (16) in 0.000370979 rate 0.0431291
Filling depth 2 val 0 saw 208 (208) in 0.00211191 rate 0.098489
Filling depth 3 val 0 saw 2688 (2688) in 0.0172551 rate 0.15578
Filling depth 4 val 0 saw 34752 (34752) in 0.0449569 rate 0.773007
Filling depth 5 val 0 saw 448332 (449280) in 0.464716 rate 0.966784
Filling depth 6 val 0 saw 5771801 (5808384) in 1.80464 rate 3.21858
If I use an FTO definition that specifies all the rotations, they look like
this:
Filling depth 0 val 0 saw 1 (1) in 0.000432014 rate 0.00231474
Filling depth 1 val 0 saw 2 (16) in 0.000287056 rate 0.0557383
Filling depth 2 val 0 saw 11 (208) in 0.000653028 rate 0.318516
Filling depth 3 val 0 saw 112 (2688) in 0.00423503 rate 0.634706
Filling depth 4 val 0 saw 1450 (4656) in 0.00651217 rate 0.71497
Filling depth 5 val 0 saw 18682 (23424) in 0.0311749 rate 0.751374
Filling depth 6 val 0 saw 240531 (242640) in 0.285421 rate 0.850113
Filling depth 7 val 0 saw 3091524 (3132864) in 1.94398 rate 1.61157
Note how at depth 6, I see only about one in 24 of the positions; this means
I can initialize the pruning table more quickly, and I can put deeper values
in the same size pruning table.
Even fixing a corner (which reduces symmetry) I see this:
Filling depth 0 val 0 saw 1 (1) in 0.000453234 rate 0.00220637
Filling depth 1 val 0 saw 4 (16) in 0.000295877 rate 0.0540764
Filling depth 2 val 0 saw 52 (208) in 0.000822067 rate 0.253021
Filling depth 3 val 0 saw 672 (2688) in 0.00744295 rate 0.361147
Filling depth 4 val 0 saw 8688 (8688) in 0.019742 rate 0.440077
Filling depth 5 val 0 saw 112084 (112320) in 0.139182 rate 0.807
Filling depth 6 val 0 saw 1443079 (1452096) in 1.19206 rate 1.21814
Filling depth 7 val 0 saw 18544118 (18772992) in 2.14878 rate 8.73657
Now we only see a 4x reduction, but that's still substantial.
Not really important thing, but doesn't it actually reduce *from 12 to 2*?
Since the corners of FTO have only two possible orientations. (The other 2
of 4 orientations are not reachable with those *regular turns*.)
It's actually 4. The total state space is reduced by 2, but the symmetry
reduction is still
a factor of 4, because the symmetry of the moves is still 4-way. (It would
be 8-way if
I supported mirroring, but I haven't figured out how to do that yet in
twsearch.)
My physical memory is 64GB(32GB*2), and I literally just noticed my Ubuntu
only recognizes 32GB of memory. (Maybe because I'm running Linux through
microsoft-standard-WSL2. I think I need to troubleshoot this now, or just
install Ubuntu directly.)
Ahh, Linux through WLS! If you truly want your machine to be a Linux
machine, dispense with
Windows (best thing I've done in my life is dispensing with Windows).
Otherwise, don't run WLS
and just use native Windows to run twsearch, and specify (say) 50GB on a
64GB machine if you
are willing to use your machine mostly for twsearch.
If the conversation is going slightly off-topic from the issue, and if
this isn't the best place to discuss such things, I could try reaching out
to you via email, or Discord. (I'm also in the FTO server.)
Happy to do either but I'm also happy to have the conversation in an issue
so other folks might
profit from it. Let me know if you want us to move it.
|
Following your instruction, I have generated 'ftosymm.tws' and opened it with notepad, and I can't figure out which part makes it symmetric and let the prune table be more efficient. It does seem to me, to have no differences with the FTO.tws file I'm already using. Also, I can see some random rotation names like "Move D_BR_R_Fv", and it seems to be not easy to know which one is which. (If those rotations does matter with recognizing symmetries, does adding definitions of rotations to the .tws file (the one I was using) do the same trick? If so, how does it let twsearch know that those moves are actually one of rotations, not turns?) Also, instead of generating "ftosymm2.tws" or "ftosymm3.tws", I think I could just do "--moves U,F,R,L,u,f,r,l" on twsearch. Does it make any difference, from generating and using a .tws file which only contains U,F,R,L,u,f,r,l moves?
I'm afraid I don't quite understand it. Does it mean that I can do something like this? (I couldn't find any documentations for puzzle-geometry-bin.ts):
I see. So you mean twsearch (or its prune table) can handle rotations like U vs. D, but not mirrors like U vs. U'? Then, may not clean as reducing on the prune table level, but the 'scramble+U trick (=limiting solutions to those starting with a U move)' will still work though, I guess?
I just downloaded the MFTO.tws file on the FTO Discord server, then analyzed and redefined it for FTO while adding some other moves, all by hand. |
On Sat, Jan 25, 2025 at 10:08 PM coldsun0630 ***@***.***> wrote:
I can see some random rotation names like "Move D_BR_R_Fv", and it seems to be not easy to know
Rotations are moves that end in "v" or are one of "x", "y", or "z" (and
possibly "T"). These "moves" are not
added to the list of available moves, but instead are used to create a
rotational symmetry group, and
conjugations of this group are used to find equivalence class
representatives that are used during pruning
table generation and search.
The D_BR_R_Fv move is one that is a rotation around the axis through the
corner at the intersection of the
D, BR, R, and F faces.
You could indeed add them yourself if you want, but puzzle geometry likes
to do it.
Also, instead of generating "ftosymm2.tws" or "ftosymm3.tws", I think I
could just do "--moves U,F,R,L,u,f,r,l" on twsearch. Does it make any
difference, from generating and using a .tws file which only contains
U,F,R,L,u,f,r,l moves?
The twsearch program needs rotations to build its symmetry group. As long
as you have them, and the
move sets you define are preserved, things will work fine. But without the
rotations twsearch will
not do the symmetry reduction (although if you just use U F R L u f r l on
the command line to twsearch
it will indeed solve with a fixed corner, since none of those moves modify
one of the corners.)
bun ./cubing.js/src/bin/puzzle-geometry-bin.ts --ksolve --rotations
--optimize --moves U,F,BR,BL,L,R,B,D,u,f,br,bl,l,r,b,d,2U,2F,2L,2R FTO >
ftosymm4.tws
Yes.
twsearch (or its prune table) can handle rotations like U vs. D, but not
mirrors like U vs. U'? Then, may not *clean* as reducing on the prune
table level, but the 'scramble+U trick (=limiting solutions to those
starting with a U move)' will still work though, I guess?
Yes.
I just downloaded the MFTO.tws file on the FTO Discord server, then
analyzed and redefined it for FTO while adding some other moves, all by
hand.
If you find any of these techniques useful, you might share them with the
discord.
…
|
Okay so umm... To summarize, if I add "Moves" for rotations to the .tws file, twsearch tries to search conjugations by those defined "Moves", and will notice symmetries like According to my understandings:
Then, I need to do: A. Get contained the rotation "Moves" (Uv, Fv, ...) in the .tws file, to get advantage of symmetry reduction in the pruning table. A.1. Limiting subgroup of moves (to single/double layer turns) in twsearch should not prevent from reducing symmetries, since rotation moves are already contained in the .tws file. B. Limit those "Moves" with "--moves U,F,R,L,B,D,BR,BL" or "--moves U,F,R,L,u,f,r,l" to not waste computation time, by avoiding the repetitive interactions with other defined moves like `Uv, Fv, Rv, ... (=rotations)". I feel like I’m getting a bit closer to understanding how the things work. Please correct me if I'm wrong. Thank you. |
On Sun, Jan 26, 2025 at 7:28 AM coldsun0630 ***@***.***> wrote:
1.
The 3x3x3.tws which already built in the twsearch won't reduce for
symmetries, because the x, y, z moves are not defined(contained) in the
file.
Correct.
1.
When '--moves' option is not applied, twsearch may contain the
rotation "Moves" to its output, which implies the pruning table still does
interact with those rotation "Moves".
For example, if I give Uv' (or its equivalent position) as
ScrambleAlg, then it will output Uv as an optimal solution, and Rv Bv
Uv' as second optimal, instead of treating it as a solved state or
outputting solutions like F' D' U B BL' D' U R BR' D' U L F' D' U B as
an optimal.
No, twsearch never considers rotations as "moves" when searching.
A.1. Limiting subgroup of moves (to single/double layer turns) in twsearch
should not prevent from reducing symmetries, since rotation moves are
already contained in the .tws file.
There is one caveat here; the symmetry group chosen is the subset of
symmetry that preserves
the set of moves. So if you have rotations that permit all 24 symmetries,
but then you choose only
the "U" move, you'll only get 4-way symmetry; if you choose two adjacent
moves, then you'll only
get 2-way symmetry, and so on.
B. Limit those "Moves" with "--moves U,F,R,L,B,D,BR,BL" or "--moves
U,F,R,L,u,f,r,l" to not waste computation time, by avoiding the repetitive
interactions with other defined moves like `Uv, Fv, Rv, ... (=rotations)".
Yes, but we're really just excluding moves that move a bottom corner here.
There is one other thing that I had forgotten. When solving a position
that itself has symmetry,
twsearch does already and automatically reduce the search by the symmetry
of that position.
This means, for instance, that giving -c or --alloptimal will only list
sequences that are unique
wrt that symmetry.
This needs to be documented; having --alloptimal not actually give all
optimal sequences might be
surprising.
I feel like I’m getting a bit closer to understanding how the things work.
… Please correct me if I'm wrong. Thank you.
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS5TYRR2OEBWQGJO7XD2MT5LHAVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJUGQ3DSNJSHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
One last. How does twsearch know and automatically classify which 'Move' is a rotation or not, when all are just labelled as 'Move' in the file? The 'symmetry reduction' (i.e., searching through all conjugations by each 'Move' and checking if they're equivalent)? |
Howdy!
It's rather ad-hoc, and we may do this better in the future, but at the
moment a rotation is distinguished from a move
because either it is one or more uppercase letters or underscore, and ends
in "v",
or it is one of "x", "y", or "z" (see isrotation() in parsemoves.cpp).
There's some really ugly code in there that permits x2 and x' and y2 and y'
and the like; that's a bit surprising to me
and I'll have to see why that was necessary (because it's not consistent
against the 'v' moves, among other things).
…-tom
On Tue, Jan 28, 2025 at 9:36 AM coldsun0630 ***@***.***> wrote:
No, twsearch never considers rotations as "moves" when searching.
One last. How does twsearch know and automatically classify which 'Move'
is a rotation or not, when all are just labelled as 'Move' in the file? By
the 'symmetry reduction' (i.e., searching through all conjugations by each
'Move' and checking if they're equivalent)?
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS4OOQXPBQZJHVTJSWD2M652XAVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJZGY2TMNBXGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I see. |
I'm using a fully symmetry-reduced definition file and running these 4 scrambles thru to see what I can find for them. I've been trying to improve the lowerbound for God's number on FTO. |
Good to hear that! Are you using consumer product? Are you running all 4 instances in parallel? I'm currently on with 50GB of RAM. If your processor is, say, a 9950X, then it'd be at least 2.4x faster than my 12600K (yeah, slow as snail for these kind of work). |
Don't stop yours. It takes me like 8 hours per if I was searching for one solution. But I'm searchng for all optimal solutions.
I'm not running all of them in parallel. I'm using a C++ wrapper around twsearch and my own definition file. It basically accomplishes a lot of the optimizations listed above. |
One thing to keep in mind, if finding all optimal solutions: if you are
using symmetry
reduction too that solution count will be decreased by the symmetry (we
only find one
element of each symmetry class) . . . so don't forget to conjugate those
solutions by
your rotations!
…On Fri, Jan 31, 2025 at 10:59 PM DougCube ***@***.***> wrote:
Don't stop yours. It takes me like 8 hours per if I was searching for one
solution. But I'm searchng for all optimal solutions.
So far this is what I have for the first scramble, and it confirms 21 is
the optimal length for it:
U F L BL' D' F B BR U' F L BR D' BL' B BR U BR U BL BR [21]
U F' BR' U B' D R D' B R' F' BR' D' U L B' L' D B F' BR' [21]
U F' BR' D U B' R B D' R' F' BR' D' U L B' L' D B F' BR' [21]
U BL B BR' D' BL R F U' BL F B D' BR' R F U F U BR F [21]
U BL' F' U D R' L R D' L' BL' F' D' U B R' B' D R BL' F' [21]
U BL' F' U R' D L D' R L' BL' F' D' U B R' B' D R BL' F' [21]
U BR R F' D' L BR BL U' BR BL R D' F' L BL U BL U F BL [21]
U BR' BL' D U L' B L D' B' BR' BL' U D' R L' R' D BR' L BL' [21]
U BR' BL' U L' D B D' L B' BR' BL' U D' R L' R' D BR' L BL' [21]
...
I'm not running all of them in parallel. I'm using a C++ wrapper around
twsearch and my own definition file. It basically accomplishes a lot of the
optimizations listed above.
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLSZ5SC6RQXOIRL2GVG32NRWD5AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRYHAYTONRZGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Nice! Are you linking to twsearch or invoking it through a process
mechanism?
I'm guessing your wrapper manages the remapping from the corner-fixed moves
to the non-corner-fixed moves.
...
Some similar programs (vcube) have the ability to create and maintain the
pruning table in shared memory, so you
can stop, cancel, restart, etc. runs against it (and the table stays around
until you say so). That might be a useful
thing to do in situations where you are focusing on a single puzzle like
this . . .
...
…-tom
On Fri, Jan 31, 2025 at 10:59 PM DougCube ***@***.***> wrote:
Don't stop yours. It takes me like 8 hours per if I was searching for one
solution. But I'm searchng for all optimal solutions.
So far this is what I have for the first scramble, and it confirms 21 is
the optimal length for it:
U F L BL' D' F B BR U' F L BR D' BL' B BR U BR U BL BR [21]
U F' BR' U B' D R D' B R' F' BR' D' U L B' L' D B F' BR' [21]
U F' BR' D U B' R B D' R' F' BR' D' U L B' L' D B F' BR' [21]
U BL B BR' D' BL R F U' BL F B D' BR' R F U F U BR F [21]
U BL' F' U D R' L R D' L' BL' F' D' U B R' B' D R BL' F' [21]
U BL' F' U R' D L D' R L' BL' F' D' U B R' B' D R BL' F' [21]
U BR R F' D' L BR BL U' BR BL R D' F' L BL U BL U F BL [21]
U BR' BL' D U L' B L D' B' BR' BL' U D' R L' R' D BR' L BL' [21]
U BR' BL' U L' D B D' L B' BR' BL' U D' R L' R' D BR' L BL' [21]
...
I'm not running all of them in parallel. I'm using a C++ wrapper around
twsearch and my own definition file. It basically accomplishes a lot of the
optimizations listed above.
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLSZ5SC6RQXOIRL2GVG32NRWD5AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRYHAYTONRZGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Okay. I'm currently looking into 'superswap of triangles + superswap of edges (+d move)' case (the 4th one). Searching the 21th depth on my machine is estimated at <2days. Let's see what comes out. |
I'll move on to other scrambles. |
Any progress or blockers on this effort? -tom
…On Mon, Feb 3, 2025 at 7:12 PM coldsun0630 ***@***.***> wrote:
Scramble:
U F BL' U F BL' U F R BL' L B' R L B' R L B' U D' F' B U D' L' BR F' B L' BR R' BL F' B R' BL
// superswap of triangles + superswap of edges
Solutions:
U F U' B' BR' D' L' D' R L' R BR U' R D' BR F R' F' BL U F L [23]
U F L D' BL U' L F D R U B' R L F BR L F U B U R F' [23]
...
I'll move on to other scrambles.
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS4LOAR5DVRDY56XW3D2OAVZTAVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZSG4ZDEMZZGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I have found two 23-movers and three 22-movers so far. For some less-symmetrical cases, the time is estimated at 13d [Depth 22] / 167d [Depth 23] on my machine. I actually think there is some chance that a 24-mover case will exist, but knowing it and picking it up is just a whole different story. (The equivalences of center pieces makes the prediction harder.) |
That's awesome! I'm happy to (attempt to) replicate specific results (such
as the
24 mover) on my big machine (256GB RAM, 16 cores) if that would be helpful.
…On Fri, Feb 21, 2025 at 11:23 PM coldsun0630 ***@***.***> wrote:
I have found two 23-movers and three 22-movers so far.
I have also found a 24-length solution for a pure cycle case(=centers are
unique) which is suspected to be optimal.
I'm currently running the program for other seemingly-hard cases (≥21
moves).
For some less-symmetrical cases, the time is estimated at 13d [Depth 22] /
167d [Depth 23] on my machine.
I expect it will take quite a long time to go through all the cases.
I actually think there is some chance that a 24-mover case will exist, but
knowing it and picking it up is just a whole different story. (The
equivalences of center pieces makes the prediction harder.)
Whether or not the lower bound gets updated, I'll disclose the result to
the community (and ping you so you'll get noticed) after the attempt has
been completed.
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS5CSUR3ZM4KX5RWKIT2RAQW7AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWGA3TANRTHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: coldsun0630]*coldsun0630* left a comment (cubing/twsearch#98)
<#98 (comment)>
I have found two 23-movers and three 22-movers so far.
I have also found a 24-length solution for a pure cycle case(=centers are
unique) which is suspected to be optimal.
I'm currently running the program for other seemingly-hard cases (≥21
moves).
For some less-symmetrical cases, the time is estimated at 13d [Depth 22] /
167d [Depth 23] on my machine.
I expect it will take quite a long time to go through all the cases.
I actually think there is some chance that a 24-mover case will exist, but
knowing it and picking it up is just a whole different story. (The
equivalences of center pieces makes the prediction harder.)
Whether or not the lower bound gets updated, I'll disclose the result to
the community (and ping you so you'll get noticed) after the attempt has
been completed.
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS5CSUR3ZM4KX5RWKIT2RAQW7AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWGA3TANRTHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Glad to hear that. Thanks, I'll consider to do so if I find a good 24-mover candidate worth your biggg machine. :) |
I had stopped running mine because it kept crashing my machine. :( |
It should not be crashing your machine. I would guess you set the memory
usage too high and other things wanted the memory. If you can give me
specifics (machine ram, os, twsearch options) I can help diagnose.
- https://cube20.org/ <http://cube20.org/> - https://golly.sf.net/
<http://golly.sf.net/> - https://alpha.twizzle.net/
/ -
…On Sun, Feb 23, 2025 at 8:54 AM DougCube ***@***.***> wrote:
I had stopped running mine because it kept crashing my machine. :(
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS2A3NFF6IEN7FGXKNT2RH4K3AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWHE4DKNBYG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: DougCube]*DougCube* left a comment (cubing/twsearch#98)
<#98 (comment)>
I had stopped running mine because it kept crashing my machine. :(
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS2A3NFF6IEN7FGXKNT2RH4K3AVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWHE4DKNBYG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I was running on a machine with 128 GB of RAM, but it was running is WSL2 inside Windows 10 Pro, which I didn't know at the time defaults to limiting to half of the physical memory. I have since changed it to 96GB. I was also running other stuff on the machine. And I was unnecesarily using '--alloptimal' on a highly symmetric scramble. I also forgot to 'tee' the result into a file and lost all work when it crashed. :( |
Yeah okay clearly not twsearch’s fault then.
WLS is great but to get the most out of a machine you want to run twsearch
native. It should compile for windows fine.
- https://cube20.org/ <http://cube20.org/> - https://golly.sf.net/
<http://golly.sf.net/> - https://alpha.twizzle.net/
/ -
…On Sun, Feb 23, 2025 at 12:23 PM DougCube ***@***.***> wrote:
I was running on a machine with 128 GB of RAM, but it was running is WSL2
inside Windows 10 Pro, which I didn't know at the time defaults to limiting
to half of the physical memory. I have since changed it to 96GB. I was also
running other stuff on the machine. And I was unnecesarily using
'--alloptimal' on a highly symmetric scramble.
I also forgot to 'tee' the result into a file and lost all work when it
crashed. :(
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS4KV53GP22G2WCOXBT2RIU4XAVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZXGA4TKOJSGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: DougCube]*DougCube* left a comment (cubing/twsearch#98)
<#98 (comment)>
I was running on a machine with 128 GB of RAM, but it was running is WSL2
inside Windows 10 Pro, which I didn't know at the time defaults to limiting
to half of the physical memory. I have since changed it to 96GB. I was also
running other stuff on the machine. And I was unnecesarily using
'--alloptimal' on a highly symmetric scramble.
I also forgot to 'tee' the result into a file and lost all work when it
crashed. :(
—
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMOLS4KV53GP22G2WCOXBT2RIU4XAVCNFSM6AAAAABVT52R7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZXGA4TKOJSGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Mine is also WSL2 with Windows 10 Pro (currently) and no crash over days of execution. I set the twsearch to use 14 (of 16) threads & 48 (of 64GB) of RAM. Here's my exact command line of the twsearch, which is on execution now: / You need to turn off Windows Update before doing everything though. (Yes, I also had lost all work once too.) |
It would be good if there's a feature that can limit prefix(a sequence of moves) of generators/solutions. Here's a simple example (let's just say the only possible moves are 1QTM of 3x3x3):
//
It'd be also useful for reducing computation time for some symmetrical cases. Let's take the 'superflip' case as an example. You know that the very first move of any possible solutions are symmetrical to U move. To reduce those 12 symmetries into one, we can do something like this:
Then we can get the final solution:
Of course, this trick works with or without "Banned prefix", but the time will be reduced even more if that feature was available (by 11/12 in the example).
//
I suggested this because it seemed like the 'symmetry reduction' feature didn't work on my console. The computation time of "a symmetrical case" and "a symmetrical case + U" were the same per each depth in the same condition. I think it's not implemented yet?
The text was updated successfully, but these errors were encountered: