cs0x7f / sq12phase Goto Github PK
View Code? Open in Web Editor NEWsquare one solver
square one solver
Hey! I'm currently maintaining TNoodle and sq1
is causing us a headache, because it slows down our integration tests by a ton. The reason is that we still use the sub-optimal solver before your fix.
I understand that I can just cherry-pick your recent commits, but we still cannot use your optimal solver because of conflicts with the turn metrics:
U
and D
face turn individually, so (1, 2)
is actually 2 moves(U, D)
group counts as 1 moveI have considered a "hacky" solution where your program counts each U
and D
as 0.5 moves, but that doesn't work because (1, 0) / (2, 3)
becomes 2.5 moves when it should be 3 per WCA.
Apart from this initial idea, I have failed to implement this metric myself because the code is too advanced for me ๐
Is there any chance you could implement 12c4 metrics either here directly or as a PR on our separate sq12phase
clone over at https://github.com/thewca/tnoodle-lib ?
Thanks a lot for your help! :)
I added timing of the initialization to Search.java (see https://github.com/jfly/sq12phase/commit/12752059ae7d6f3e46dc21b50b6eb1764b458bd3). I'm seeing times like
2.87255555 seconds to initialize
2.644265412 seconds to initialize
2.640455625 seconds to initialize
which is a lot slower than the nearly instantaneous speed of the js on http://www.cubing.net/mark2/#competition_name=&rounds=%5B%5B%22sq1%22%2C%22Round%201%22%2C1%2C5%5D%5D.
When toying around with extremely simple puzzle states in tnoodle-lib
, the optimal solver crashes with an ArrayIndexOutOfBoundsException
right at https://github.com/thewca/tnoodle-lib/blob/master/sq12phase/src/main/java/cs/sq12phase/FullCube.java#L157
An example to reproduce this is (2, -4)
. I have used the following debug method to figure out the puzzle state:
int[] debugState() {
int[] debug = new int[24];
for (int i = 0; i < 24; i++) {
debug[i] = pieceAt(i);
}
return debug;
}
For the above example, TNoodle yields the following "converted" FullCube
output:
[1,2,3,3,4,5,5,6,7,7,0,1,12,15,15,14,9,9,8,11,11,10,13,13]
Upon further inspection, the initial error makes sense because the piece 1
(a corner that is 2 vertices wide) "wraps around" and thus makes cnt
think it's a new piece. However, I am astonished that for > 100 random "long" scrambles, this problem does not occur and I can only forcibly reproduce it for extremely short scramble sequences.
I thus have two major suspicions:
(a) The getParity
code acutally has a flaw
(b) The converter from TNoodle --> sq12phase is faulty, in which case I need input from either you or @jfly concerning https://github.com/thewca/tnoodle-lib/blob/master/scrambles/src/main/java/net/gnehzr/tnoodle/puzzle/SquareOnePuzzle.java#L244
Please advise how to proceed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.