cubing / twsearch

🔍 Twizzle Search — a program to find algs and scrambles for twisty puzzles
GNU General Public License v3.0
27 stars 9 forks source link

Scramble state distinguish indistinguishable pieces, why not allowed #45

Closed DougCube closed 1 year ago

DougCube commented 1 year ago

I attached a simple TWS file and SCR file.

When I run it, I get this:

$ ./build/bin/twsearch.exe bug_from_doug.tws bug_from_doug.scr
# This is twsearch v0.6.4-53-g2a98284 (C) 2022 Tomas Rokicki.
# ./build/bin/twsearch bug_from_doug.tws bug_from_doug.scr
Created new moves U2 U' R2 R' F2 F'
State size is 2702238129360 log2 41.2973
Requiring 53 bits 8 bytes per entry; 20 from identity.
Found 900 canonical move states.
Calculated canonical states in 0.032346
For memsize 8589934592 bytesize 8589934592 subshift 42 memshift 29 shardshift 29
Trying to allocate 8589934656
Initializing memory in 0.088753
Filling depth 0 val 0 saw 1 (1) in 0.00744796 rate 0.000134265
Filling depth 1 val 0 saw 9 (21) in 0.000118971 rate 0.176514
Filling depth 2 val 0 saw 54 (300) in 0.000132084 rate 2.27128
Filling depth 3 val 0 saw 385 (3982) in 0.000536919 rate 7.41639
7: ! scramble position permutation doesn't match solved
At: End

But it works find if I get rid of the indistinguishable pieces with changing Solved from this

Solved
CORNER
1 2 3 4 5 6 7
MIDGE
1 2 1 2 2 2 2 2 1 2 1 2 2 2 2 2 1 2 1 2 1 2 1 2
End

to this

Solved
CORNER
1 2 3 4 5 6 7
MIDGE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
End

And it also works when I used a ScrambleAlg instead of a Scramble state. I think it is only allowing me to give state with the indistinguishable pieces, like only MIDGE 1 and 2. But the scramble state was taken from a '-r' output with the larger full state space definition.

bug_from_doug.zip

DougCube commented 1 year ago

It also works if I modify the SCR file to make the pieces indistinguishable there, but doing this manually is very inconvenient.

rokicki commented 1 year ago

This is the intended behavior. The Solved state and the Scramble files must match with regard to indistinguishable pieces; these are puzzle states, and must reflect the same sets of indistinguishable pieces.

If they do not match, it is impossible to permute from one state (the scramble) to the other state (solved), no matter what moves are provided. I'm not sure what behavior you intend.

On Fri, Nov 10, 2023 at 11:55 AM DougCube @.***> wrote:

It also works if I modify the SCR file to make the pieces indistinguishable there, but doing this manually is very inconvenient.

— Reply to this email directly, view it on GitHub https://github.com/cubing/twsearch/issues/45#issuecomment-1806355667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOLS5XOZMWRETP4M5GQ7DYD2BDNAVCNFSM6AAAAAA7GUFODOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGM2TKNRWG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

DougCube commented 1 year ago

I was hoping that it would automatically map the distinguished pieces in the scramble state to the indistinguishable indexing.

I guess I'm a bit stuck. What I'm trying to do is use a random state generated by the '-r' with the full puzzle and run it thru a partial solver which uses a simplified TWS file. Because I then want to take the output of this and compose with the random scramble state and run the full solver/TWS on it.

I'm sure I can do it with scripting and post-processing but I'm looking for an easier method.

rokicki commented 1 year ago

I don't have an immediate fix for you, or any sort of workaround. I'd recommend forking and adding some sort of support for this that has the actual semantics you want, if this is a blocker for you.

On Fri, Nov 10, 2023 at 12:50 PM DougCube @.***> wrote:

I was hoping that it would automatically map the distinguished pieces in the scramble state to the indistinguishable indexing.

I guess I'm a bit stuck. What I'm trying to do is use a random state generated by the 'r' with the full puzzle and run it thru a partial solver which uses a simplified TWS file. Because I then want to take the output of this and compose with the random scramble state and run the full solver/TWS on it.

I'm sure I can do it with scripting and post-processing but I'm looking for an easier method.

— Reply to this email directly, view it on GitHub https://github.com/cubing/twsearch/issues/45#issuecomment-1806413339, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOLS4F6BIUJUW6BHNFI7DYD2HSTAVCNFSM6AAAAAA7GUFODOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWGQYTGMZTHE . You are receiving this because you commented.Message ID: @.***>

--

rokicki commented 1 year ago

Closing because this is as-designed. If different functionality is requested, please phrase as a feature request.