• Welcome to the Speedsolving.com, home of the web's largest puzzle community!
    You are currently viewing our forum as a guest which gives you limited access to join discussions and access our other features.

    Registration is fast, simple and absolutely free so please, join our community of 40,000+ people from around the world today!

    If you are already a member, simply login to hide this message and begin participating in the community!

HARCS (JARCS Replacement) - Cube Solver

mDiPalma

Member
Joined
Jul 12, 2011
Messages
1,534
Thanks for that.

I have one quick question - is there a way to get it so I can choose which block to generate? eg. complete EOline and then choose which 2x2x1 block is generated?

If you want to solve eoline and then check which of the squares is most efficient, you can use this code for your custom.txt:
Code:
step eoline
movegroup 1
prunedepth 4
searchdepth 4
epmask 0x00000000f0f0
eomask 0xffffffffffff
cpmask 0x00000000
comask 0x00000000
cnmask 0xfff

step fl
movegroup 5
prunedepth 4
searchdepth 4
epmask 0x0000000ff0ff
eomask 0xffffffffffff
cpmask 0x0000000f
comask 0x0000000f
cnmask 0xfff

step bl
movegroup 5
prunedepth 4
searchdepth 4
epmask 0x0000f000f0ff
eomask 0xffffffffffff
cpmask 0x0000f000
comask 0x0000f000
cnmask 0xfff

step fr
movegroup 5
prunedepth 4
searchdepth 4
epmask 0x000000f0fff0
eomask 0xffffffffffff
cpmask 0x000000f0
comask 0x000000f0
cnmask 0xfff

step br
movegroup 5
prunedepth 4
searchdepth 4
epmask 0x00000f00fff0
eomask 0xffffffffffff
cpmask 0x00000f00
comask 0x00000f00
cnmask 0xfff

Here is how you would run it and what the result would look like:

harcseolsq.png



Is that what you're asking? There is no way to make HARCS pick the shortest of these. There is just too much freedom to account for. You'll have to do that yourself.
 
Last edited:

CubingGenius

Member
Joined
Jul 3, 2016
Messages
238
If you want to solve eoline and then check which of the squares is most efficient, you can use this code for your custom.txt:
Code:
step eoline
movegroup 1
prunedepth 4
searchdepth 4
epmask 0x00000000f0f0
eomask 0xffffffffffff
cpmask 0x00000000
comask 0x00000000
cnmask 0xfff

step fl
movegroup 5
prunedepth 4
searchdepth 4
epmask 0x0000000ff0ff
eomask 0xffffffffffff
cpmask 0x0000000f
comask 0x0000000f
cnmask 0xfff

step bl
movegroup 5
prunedepth 4
searchdepth 4
epmask 0x0000f000f0ff
eomask 0xffffffffffff
cpmask 0x0000f000
comask 0x0000f000
cnmask 0xfff

step fr
movegroup 5
prunedepth 4
searchdepth 4
epmask 0x000000f0fff0
eomask 0xffffffffffff
cpmask 0x000000f0
comask 0x000000f0
cnmask 0xfff

step br
movegroup 5
prunedepth 4
searchdepth 4
epmask 0x00000f00fff0
eomask 0xffffffffffff
cpmask 0x00000f00
comask 0x00000f00
cnmask 0xfff

Here is how you would run it and what the result would look like:

harcseolsq.png



Is that what you're asking? There is no way to make HARCS pick the shortest of these. There is just too much freedom to account for. You'll have to do that yourself.

Yes, this was what I was trying to do. Thank you for showing me how to do it. :)

I tried to create something that works like this: (my solution wasn't that efficient, I just tried to make something quickly to show you.)

Scramble: L2 B' U2 B' L2 F' L2 R2 F R2 B2 D R' F U B D' R U2 F2 R'

EOline: F' R' U' D' B L D
BL block: R' U' L U2 L U L2
FL pair + DR edge: D R U R' D' R2
Last two pairs: R U' R2 U' R U' R U2 R' U2 R U2 R'
LL: (This won't be part of the program) U R U' R' U2 L R U' R' U L' U'

I tried to make it with this:

Code:
step eoline
movegroup 1
prunedepth 5
searchdepth 5
epmask 0x00000000f0f0
eomask 0xffffffffffff
cpmask 0x00000000
comask 0x00000000
cnmask 0xfff

step BLblock
movegroup 5
prunedepth 9
searchdepth 9
epmask 0x0000f000f0ff
eomask 0xffffffffffff
cpmask 0x0000f000
comask 0x0000f000
cnmask 0xfff

step FLpair+DRedge
movegroup 5
prunedepth 9
searchdepth 9
epmask 0x0000f00fffff
eomask 0xffffffffffff
cpmask 0x0000f00f
comask 0x0000f00f
cnmask 0xfff

step last2pairs
movegroup 4
prunedepth 11
searchdepth 11
epmask 0x0000ffffffff
eomask 0xffffffffffff
cpmask 0x0000ffff
comask 0x0000ffff
cnmask 0xfff

all eoline BLblock FLpair+DRedge last2pairs

But when I typed "custom" on the program it stopped loading at FLpair+DRedge and the program terminated when I tried to load it. Do you know what the problem would be?

Once again, thanks so much for this! :)
 

mDiPalma

Member
Joined
Jul 12, 2011
Messages
1,534
I tried to create something that works like this: (my solution wasn't that efficient, I just tried to make something quickly to show you.)

I think the problem is your depths are too deep. The sum of your prunedepth and searchdepth need to be at least the upper bound of your step. They don't both need to be so high.

Here is an example of your exact code working with lower depths. Put as low numbers as you can in these.

weirdzz.png
 
Last edited:

CubingGenius

Member
Joined
Jul 3, 2016
Messages
238
I think the problem is your depths are too deep. The sum of your prunedepth and searchdepth need to be at least the upper bound of your step. They don't both need to be so high.

Here is an example of your exact code working with lower depths. Put as low numbers as you can in these.

weirdzz.png

Thanks. I put the numbers lower and it works now.

Just wondering, what does prunedepth and searchdepth mean? I read the readme text but I'm still unsure what they do.
 

mDiPalma

Member
Joined
Jul 12, 2011
Messages
1,534
Thanks. I put the numbers lower and it works now.

Just wondering, what does prunedepth and searchdepth mean? I read the readme text but I'm still unsure what they do.

There are 2 main ways for a basic searching approach like this to work. Say we need to find a solution to a particular cross that we know will take no more than 6 moves. We can either...

a) Take a solved cross and do every possible combination of 6 moves to it. Store all this information in a table (the first column being every possible 0 to 6 move sequence ["U R B2 L' D F" etc], and the second column being the corresponding state of the cross edges [where each of the 4 edges are]). Then, when we want to solve the cross on a given scramble, just look in the second column for the state that exactly matches our scramble. Thus, the inverse of the corresponding entry in the first column would be the move sequence to solve the cross.

or

b) Go through every single possible 0 to 6 move sequence on the scrambled cross state, until it's solved. Print out the sequence that solves the cross.

Option a (what I call "pruning") is expensive for memory. When you have a very large movegroup like <UDRLFBMr> and want to tabulate results for a depth of 8-9 moves, it will take a lot of RAM to store all this info. However, this data is extremely fast to access.

Option b (what I call "searching") is expensive computationally. When you want to look to deep depths of 10+ moves, it can take a while. However, this hardly takes any memory to execute.

The compromise is to do a little bit of both and meet in the middle. Basically, when you type the name of a method (or "custom") HARCS prunes (creates and stores a table in RAM) for each step up to the value of "prunedepth" that is prescribed. Then, at runtime, when you try to find a solution for a certain step, HARCS will apply all the move sequences up to depth "searchdepth" and check each time if this cubestate appears in the pruning tables.

When it finds a match, the solution [option b] + inverse[option a] is output as the solution to the desired step.

That's why prunedepth+searchdepth must be >= upper bound for each step.

Does that make more sense?
 
Last edited:

CubingGenius

Member
Joined
Jul 3, 2016
Messages
238
There are 2 main ways for a basic searching approach like this to work. Say we need to find a solution to a particular cross that we know will take no more than 6 moves. We can either...

a) Take a solved cross and do every possible combination of 6 moves to it. Store all this information in a table (the first column being every possible 0 to 6 move sequence ["U R B2 L' D F" etc], and the second column being the corresponding state of the cross edges [where each of the 4 edges are]). Then, when we want to solve the cross on a given scramble, just look in the second column for the state that exactly matches our scramble. Thus, the inverse of the corresponding entry in the first column would be the move sequence to solve the cross.

or

b) Go through every single possible 0 to 6 move sequence on the scrambled cross state, until it's solved. Print out the sequence that solves the cross.

Option a (what I call "pruning") is expensive for memory. When you have a very large movegroup like <UDRLFBMr> and want to tabulate results for a depth of 8-9 moves, it will take a lot of RAM to store all this info. However, this data is extremely fast to access.

Option b (what I call "searching") is expensive computationally. When you want to look to deep depths of 10+ moves, it can take a while. However, this hardly takes any memory to execute.

The compromise is to do a little bit of both and meet in the middle. Basically, when you type the name of a method (or "custom") HARCS prunes (creates and stores a table in RAM) for each step up to the value of "prunedepth" that is prescribed. Then, at runtime, when you try to find a solution for a certain step, HARCS will apply all the move sequences up to depth "searchdepth" and check each time if this cubestate appears in the pruning tables.

When it finds a match, the solution [option b] + inverse[option a] is output as the solution to the desired step.

That's why prunedepth+searchdepth must be >= upper bound for each step.

Does that make more sense?

Thank you. That explains it very well. That would also make sense why it was having loading issues when I loaded the program with the higher number values.

I also wanted to thank you for all the things you taught me to do with the program today. I'm very appreciative of all the time you spent explaining to me. :)
 

sqAree

Member
Joined
Jun 10, 2015
Messages
858
Location
Berlin
WCA
2015JAEH01
YouTube
Visit Channel
Is it possible that the solutions are inefficient by some in between AUFs? For example when we define CP solved as the state where all corners are at their correct spot and oriented correctly, it might AUF (or something similar) at the end of the CP step and the next step might begin with <U>.
 

CubingGenius

Member
Joined
Jul 3, 2016
Messages
238
Is it possible that the solutions are inefficient by some in between AUFs? For example when we define CP solved as the state where all corners are at their correct spot and oriented correctly, it might AUF (or something similar) at the end of the CP step and the next step might begin with <U>.

That I know of, you can't do that. However, you can simply cancel into the next alg yourself though. I don't think what you described is possible with the current way it works.
 

sqAree

Member
Joined
Jun 10, 2015
Messages
858
Location
Berlin
WCA
2015JAEH01
YouTube
Visit Channel
That I know of, you can't do that. However, you can simply cancel into the next alg yourself though. I don't think what you described is possible with the current way it works.

But what if the next step also has an optimal solution starting with something non-<U> and the program doesn't see it?
I think it would be a logical step to include a feature that allows to define cubestates relative to face adjustments (it's also the way those methods are used by humans anyway).

Another question, for which turn metric are the solutions optimized? Can we customize that?
 

CubingGenius

Member
Joined
Jul 3, 2016
Messages
238
But what if the next step also has an optimal solution starting with something non-<U> and the program doesn't see it?
I think it would be a logical step to include a feature that allows to define cubestates relative to face adjustments (it's also the way those methods are used by humans anyway).

Another question, for which turn metric are the solutions optimized? Can we customize that?

I know what you mean. Unfortunately the program is not able to do this task that I know of.

I believe it is HTM. I'm pretty sure at the moment you can't change that.
 

mDiPalma

Member
Joined
Jul 12, 2011
Messages
1,534
Is it possible that the solutions are inefficient by some in between AUFs? For example when we define CP solved as the state where all corners are at their correct spot and oriented correctly, it might AUF (or something similar) at the end of the CP step and the next step might begin with <U>.

You are correct. The built-in Roux method CMLL step actually accounts for this. I will try to figure out a way to give custom methods the same ability for the next version.

Another question, for which turn metric are the solutions optimized? Can we customize that?

The steps are optimized for their prescribed movegroup. If you you ZZ/Petrus/some custom method with only <UDRLFB>, then the solution will be htm. If you use Roux/some custom method with M moves, the solution will be optimized in stm (keep in mind that only the prescribed moves are considered, and the built-in Roux method doesn't consider S or E moves at all).

I'm also looking into a way to allow users to prescribe movegroups directly ("<MSE>" or "<FRU>") for custom methods, which I believe would give users better control over their methods.
 

sqAree

Member
Joined
Jun 10, 2015
Messages
858
Location
Berlin
WCA
2015JAEH01
YouTube
Visit Channel
Thank you, that was exactly the feature I had on my mind!

There is something more about metrics though, for example when SSC is generally measured in ATM (which I don't agree with in the first place, but there could be a reason to consider a method in ATM) and step 2 uses <DRU> the induced metric can't understand.
Allowing the customized movegroups to be made not only of moves but also of move sequences would solve this problem and moreover allows for even more flexibility for custom methods. For example one could make a Roux step 4b+c with <U,M2,M'U2M,M'U2M',MU2M',MU2M> even closer to human solving.
 

JohnnyReggae

Member
Joined
Jan 21, 2015
Messages
557
Location
Cape Town, South Africa
WCA
2015BOSW01
I'm unsure what I may be doing wrong, but I am getting nothing generated....

HARCS>> cfop

Loading cross, Loading xcross, Ready.

HARCS>> apply R2 D' R2 B2 U' L2 D2 F2 U' B2 U' B' D R' B F' R U' F2 R2 D'

sequence applied

HARCS>> style DF DR DB DL #

orientations set to: DF DR DB DL

HARCS>> number 3

max count set to: 3

HARCS>> xcross

DF:

1. z2 (0)

2. z2 U' (1)

3. z2 U2 (1)


DR:

4. z2 y' (0)

5. z2 y' U' (1)

6. z2 y' U2 (1)


DB:

7. x2 (0)

8. x2 U' (1)

9. x2 U2 (1)


DL:

10. z2 y (0)

11. z2 y U' (1)

12. z2 y U2 (1)

HARCS>>
 

CubingGenius

Member
Joined
Jul 3, 2016
Messages
238
I'm unsure what I may be doing wrong, but I am getting nothing generated....

HARCS>> cfop

Loading cross, Loading xcross, Ready.

HARCS>> apply R2 D' R2 B2 U' L2 D2 F2 U' B2 U' B' D R' B F' R U' F2 R2 D' #

sequence applied

HARCS>> style DF DR DB DL #

orientations set to: DF DR DB DL

HARCS>> number 3

max count set to: 3

HARCS>> xcross

DF:

1. z2 (0)

2. z2 U' (1)

3. z2 U2 (1)


DR:

4. z2 y' (0)

5. z2 y' U' (1)

6. z2 y' U2 (1)


DB:

7. x2 (0)

8. x2 U' (1)

9. x2 U2 (1)


DL:

10. z2 y (0)

11. z2 y U' (1)

12. z2 y U2 (1)

HARCS>>

You need to add a hash when you put in the scramble in this format: apply [scramble] #
 

Đỗ Viên

Member
Joined
Dec 18, 2016
Messages
7
Does it have mistakes ???
step fb
movegroup 2
prunedepth 4
searchdepth 4
epmask 0x0000f0f000f
eomask 0x0000f0f000f
cpmask 0x0000f00f
comask 0x0000f00f
cnmask 0xfff

step sb
movegroup 3
prunedepth 8
searchdepth 8
epmask 0x0000ffff0f0f
eomask 0x0000ffff0f0f
cpmask 0x0000ffff
comask 0x0000ffff
cnmask 0xfff

step cmll
movegroup 2
prunedepth 5
searchdepth 5
epmask 0x0000ffff0f0f
eomask 0x0000ffff0f0f
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step eo
movegroup 7
prunedepth 4
searchdepth 4
epmask 0x0000ffff0f0f
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step ulur
movegroup 7
prunedepth 4
searchdepth 4
epmask 0x0f0fffff0f0f
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step l4e
movegroup 7
prunedepth 4
searchdepth 4
epmask 0xffffffffffff
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff
all fb sb cmll eo ulur l4e
 
Last edited:

mDiPalma

Member
Joined
Jul 12, 2011
Messages
1,534
Does it have mistakes ???
step fb
movegroup 2
prunedepth 4
searchdepth 4
epmask 0x0000f0f000f
eomask 0x0000f0f000f
cpmask 0x0000f00f
comask 0x0000f00f
cnmask 0xfff

step sb
movegroup 3
prunedepth 8
searchdepth 8
epmask 0x0000ffff0f0f
eomask 0x0000ffff0f0f
cpmask 0x0000ffff
comask 0x0000ffff
cnmask 0xfff

step cmll
movegroup 2
prunedepth 5
searchdepth 5
epmask 0x0000ffff0f0f
eomask 0x0000ffff0f0f
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step eo
movegroup 7
prunedepth 4
searchdepth 4
epmask 0x0000ffff0f0f
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step ulur
movegroup 7
prunedepth 4
searchdepth 4
epmask 0x0f0fffff0f0f
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step l4e
movegroup 7
prunedepth 4
searchdepth 4
epmask 0xffffffffffff
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff
all fb sb cmll eo ulur l4e

I think there are a few mistakes, assuming you are trying to program the Roux Method.

For "fb", you need to have 12 digits in epmask and eomask (not 11)

Also I recommend setting cnmask to 0x0f0 (only the left/right centers in place).

I would also adjust some of your depths/movegroups to help the program prune faster.

This is also not an efficient program to generate algorithms, so "CMLL" seems out of place (the built in Roux function has a preset group of CMLL algs and can be used, in place of this). I would also change the movegroup to <RUD> or <RULD> , etc.

Finally, because LSE does not really solve any pieces until the very end, centers included, it's not really suitable for HARCS to solve in segments like this.

Nonetheless, HARCS is a merciful God:

step fb
movegroup 2
prunedepth 4
searchdepth 4
epmask 0x0000f00f000f
eomask 0x0000f00f000f
cpmask 0x0000f00f
comask 0x0000f00f
cnmask 0x0f0

step sb
movegroup 3
prunedepth 6
searchdepth 7
epmask 0x0000ffff0f0f
eomask 0x0000f00f0f0f
cpmask 0x0000ffff
comask 0x0000ffff
cnmask 0x0f0

step cmll
movegroup 4
prunedepth 8
searchdepth 8
epmask 0x0000ffff0f0f
eomask 0x0000ffff0f0f
cpmask 0xffffffff
comask 0xffffffff
cnmask 0x0f0

step eo
movegroup 7
prunedepth 4
searchdepth 4
epmask 0x0000ffff0f0f
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step ulur
movegroup 7
prunedepth 4
searchdepth 4
epmask 0x0f0fffff0f0f
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step l4e
movegroup 7
prunedepth 4
searchdepth 4
epmask 0xffffffffffff
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff
all fb sb cmll eo ulur l4e

rouxez.png



This is a good exercise in learning the syntax, but I highly recommend using the built-in functionality for Roux to generate solutions (there are optimizations under-the-hood that make it faster and more accurate).
 
Last edited:

Đỗ Viên

Member
Joined
Dec 18, 2016
Messages
7
Thanks you :)
I think there are a few mistakes, assuming you are trying to program the Roux Method.

For "fb", you need to have 12 digits in epmask and eomask (not 11)

Also I recommend setting cnmask to 0x0f0 (only the left/right centers in place).

I would also adjust some of your depths/movegroups to help the program prune faster.

This is also not an efficient program to generate algorithms, so "CMLL" seems out of place (the built in Roux function has a preset group of CMLL algs and can be used, in place of this). I would also change the movegroup to <RUD> or <RULD> , etc.

Finally, because LSE does not really solve any pieces until the very end, centers included, it's not really suitable for HARCS to solve in segments like this.

Nonetheless, HARCS is a merciful God:

step fb
movegroup 2
prunedepth 4
searchdepth 4
epmask 0x0000f00f000f
eomask 0x0000f00f000f
cpmask 0x0000f00f
comask 0x0000f00f
cnmask 0x0f0

step sb
movegroup 3
prunedepth 6
searchdepth 7
epmask 0x0000ffff0f0f
eomask 0x0000f00f0f0f
cpmask 0x0000ffff
comask 0x0000ffff
cnmask 0x0f0

step cmll
movegroup 4
prunedepth 8
searchdepth 8
epmask 0x0000ffff0f0f
eomask 0x0000ffff0f0f
cpmask 0xffffffff
comask 0xffffffff
cnmask 0x0f0

step eo
movegroup 7
prunedepth 4
searchdepth 4
epmask 0x0000ffff0f0f
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step ulur
movegroup 7
prunedepth 4
searchdepth 4
epmask 0x0f0fffff0f0f
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff

step l4e
movegroup 7
prunedepth 4
searchdepth 4
epmask 0xffffffffffff
eomask 0xffffffffffff
cpmask 0xffffffff
comask 0xffffffff
cnmask 0xfff
all fb sb cmll eo ulur l4e

rouxez.png



This is a good exercise in learning the syntax, but I highly recommend using the built-in functionality for Roux to generate solutions (there are optimizations under-the-hood that make it faster and more accurate).
 
Thread starter Similar threads Forum Replies Date
A Software Area 10
Similar threads
JARCS doesn't work anymore?
Top