domino14 / macondo

A crossword board game AI, written in Go
https://domino14.github.io/macondo
GNU General Public License v3.0
48 stars 10 forks source link

Peg generic #310

Closed domino14 closed 5 months ago

domino14 commented 8 months ago

2-in-the-bag preendgame and possibly more.

domino14 commented 6 months ago

crashed overnight on a 4-PEG :(

{"level":"info","potentialLosses":1333,"p":"<play  N3 SOCA, wins 6587.000000>","minPotentialLosses":1334,"time":"2024-03-04T06:01:40-05:00","message":"new-fewest-potential-losses"}
{"level":"info","potentialLosses":1332,"p":"<play  N3 SOCA, wins 6588.000000>","minPotentialLosses":1333,"time":"2024-03-04T06:01:40-05:00","message":"new-fewest-potential-losses"}
panic: tile in play but not in rack: 5

goroutine 138 [running]:
github.com/domino14/macondo/tinymove/conversions.SmallMoveToMove(0xc283ab9cb8, 0xc35dbf05b0, 0xc000332408, 0xc283ab9a80?, 0xc3928a2f40)
    github.com/domino14/macondo/tinymove/conversions/conversions.go:18 +0x111
github.com/domino14/macondo/preendgame.(*Solver).recursiveSolve(0xc000766b40, {0xa8ec98, 0xc0008a4050}, 0xd, 0xc000185860, 0xc283ab9cb8, {{0xc35dbd1420, 0x4, 0x4}, 0x1, ...}, ...)
    github.com/domino14/macondo/preendgame/peg_generic.go:462 +0x958
github.com/domino14/macondo/preendgame.(*Solver).handleJobGeneric(0xc000766b40, {0xa8ec98, 0xc0008a4050}, {0xc000185860, 0x0, {0xc23a334000, 0x3e, 0x3e}}, 0xd, 0xc000028840)
    github.com/domino14/macondo/preendgame/peg_generic.go:337 +0x108d
github.com/domino14/macondo/preendgame.(*Solver).multithreadSolveGeneric.func1()
    github.com/domino14/macondo/preendgame/peg_generic.go:65 +0x14f
golang.org/x/sync/errgroup.(*Group).Go.func1()
    golang.org/x/sync@v0.5.0/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 28
    golang.org/x/sync@v0.5.0/errgroup/errgroup.go:72 +0x96
[cesar@themonolith macondo]$ ^C
domino14 commented 6 months ago

sigh it happened again

{"level":"info","nmoves":377,"nthreads":16,"time":"2024-03-09T05:30:58-05:00","message":"peg-generated-moves"}
panic: tile in play but not in rack: 18

goroutine 395 [running]:
github.com/domino14/macondo/tinymove/conversions.SmallMoveToMove({0x485001d8, 0x5, 0x0, 0x1a}, 0xc41539f5e0, 0xc000274408, 0xc276b5ba80?, 0xc00041d6c0)
    github.com/domino14/macondo/tinymove/conversions/conversions.go:18 +0x11a
github.com/domino14/macondo/preendgame.(*Solver).recursiveSolve(0xc00017c6c0, {0xa8edf8, 0xc22d8c6050}, 0xd, 0xc2d537a720, {0x485001d8, 0x5, 0x0, 0x1a}, {{0xc41538d658, ...}, ...}, ...)
    github.com/domino14/macondo/preendgame/peg_generic.go:464 +0x995
github.com/domino14/macondo/preendgame.(*Solver).handleJobGeneric(0xc00017c6c0, {0xa8edf8, 0xc22d8c6050}, {0xc2d537a720, 0x0, {0xc268434800, 0x3e, 0x3e}}, 0xd, 0xc26849f9e0)
    github.com/domino14/macondo/preendgame/peg_generic.go:339 +0x1085
github.com/domino14/macondo/preendgame.(*Solver).multithreadSolveGeneric.func1()
    github.com/domino14/macondo/preendgame/peg_generic.go:65 +0x14f
golang.org/x/sync/errgroup.(*Group).Go.func1()
    golang.org/x/sync@v0.5.0/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 157
    golang.org/x/sync@v0.5.0/errgroup/errgroup.go:72 +0x96

after many hours on a 4-PEG. it must just be a very low prob bug but with all the recursion and repeated iteration...

domino14 commented 6 months ago
Trying to convert small move to move did not succeed
sm: {78322336214 13 0 35} m: <0xc2ba5a6620 action: play word: 8L FOR. score: 0 tp: 3 leave:  equity: 0.000> tm: &{map[?:0 A:1 B:2 C:3 D:4 E:5 F:6 G:7 H:8 I:9 J:10 K:11 L:12 M:13 N:14 O:15 P:16 Q:17 R:18 S:19 T:20 U:21 V:22 W:23 X:24 Y:25 Z:26] [? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z                                   ] 1}
rack: [2 5 11 15 20 23 26]
m.Tiles: [6 15 18 0]
board

   A B C D E F G H I J K L M N O 
   ------------------------------
 1|=     '       =       '     = |
 2|  -       "       "     O D   |
 3|    -       '   '       N A   |
 4|'     -       B I O T I C S ' |
 5|    E   -     A   P E   E H   |
 6|  F A     C O T T A G E R "   |
 7|  U '   M   ' H '       '     |
 8|= J   V E L V E T     '     M |
 9|  I T   R   E D '       '   A |
10|  " W   E " N     "       " R |
11|    A   L   U       -       L |
12|' Q I - Y   L '     P I N E Y |
13|  U N       O R A G I O U S   |
14|  I       " s   D O X     -   |
15|A d E N I N E S       '     = |
   ------------------------------

2024-03-10 00:54:12.359074312 -0500 EST m=+5025.802376263
panic: tile in play but not in rack: 6

goroutine 47 [running]:
github.com/domino14/macondo/tinymove/conversions.SmallMoveToMove({0x123c6001d6, 0xd, 0x0, 0x23}, 0xc2ba5a6620, 0xc000410008, 0xc00014a4b0, 0xc00021d980)
    github.com/domino14/macondo/tinymove/conversions/conversions.go:29 +0x4cf
github.com/domino14/macondo/preendgame.(*Solver).recursiveSolve(0xc0004286c0, {0xa8ef58, 0xc00045c050}, 0x4, 0xc2176a2720, {0x123c6001d6, 0xd, 0x0, 0x23}, {{0xc2b9be5620, ...}, ...}, ...)
    github.com/domino14/macondo/preendgame/peg_generic.go:464 +0x995
github.com/domino14/macondo/preendgame.(*Solver).handleJobGeneric(0xc0004286c0, {0xa8ef58, 0xc00045c050}, {0xc2176a2720, 0x0, {0xc24d7c2c00, 0x3e, 0x3e}}, 0x4, 0xc238900960)
    github.com/domino14/macondo/preendgame/peg_generic.go:339 +0x1085
github.com/domino14/macondo/preendgame.(*Solver).multithreadSolveGeneric.func1()
    github.com/domino14/macondo/preendgame/peg_generic.go:65 +0x14f
golang.org/x/sync/errgroup.(*Group).Go.func1()
    golang.org/x/sync@v0.5.0/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 66
    golang.org/x/sync@v0.5.0/errgroup/errgroup.go:72 +0x96
domino14 commented 6 months ago
{"level":"error","error":"tile in play but not in rack: 4","time":"2024-03-11T06:04:30-04:00","message":"quick-and-dirty-solve-error"}
{"level":"error","error":"tile in play but not in rack: 4","time":"2024-03-11T06:04:30-04:00","message":"bag-empty-recursive-solve-err"}
{"level":"error","error":"tile in play but not in rack: 4","time":"2024-03-11T06:04:30-04:00","message":"recursive-solve-err"}
Trying to convert small move to move did not succeed
sm: {407896539 14 0 18} m: <0xc36491b960 action: play word: N8 EF score: 0 tp: 2 leave:  equity: 0.000> tm: &{map[?:0 A:1 B:2 C:3 D:4 E:5 F:6 G:7 H:8 I:9 J:10 K:11 L:12 M:13 N:14 O:15 P:16 Q:17 R:18 S:19 T:20 U:21 V:22 W:23 X:24 Y:25 Z:26] [? A B C D E F G H I J K L M N O P Q R S T U V W X Y Z                                   ] 1}
rack: [2 7 11 15 20 23 26]
m.Tiles: [5 6]
board

   A B C D E F G H I J K L M N O 
   ------------------------------
 1|=     '       =       '     = |
 2|  -       "       "     O D   |
 3|    -       '   '       N A   |
 4|'     -   R   B I O T I C S ' |
 5|        - O   A   P E   E H   |
 6|  F       C O T T A G E R "   |
 7|  U '   M   ' H '       '     |
 8|= J   V E L V E T     '     M |
 9|  I T   R   E D '       '   A |
10|  " W   E " N     "       " R |
11|    A   L   U       -       L |
12|' Q I - Y   L '     P I N E Y |
13|  U N       O R A G I O U S   |
14|  I       " s   D O X     -   |
15|A d E N I N E S       '     = |
   ------------------------------

2024-03-11 06:04:30.004487772 -0400 EDT m=+40021.230857867
-----RECOVER----
Recovered in recursiveSolve. thread=3 pegPlay=<play  N8 EF, wins 0.000000> moveToMake={407896539 14 0 18} inBagOption={[1 2 4 5] 1 0 0} depth=0 pegPlayEmptiesBag=false
Game state is

   A B C D E F G H I J K L M N O                Joshua_Sokol           336
   ------------------------------    ->       Andrew_Golding  BGKOTWZ  348
 1|=     '       =       '     = |
 2|  -       "       "     O D   |   Bag + unseen: (9)
 3|    -       '   '       N A   |
 4|'     -   R   B I O T I C S ' |   A A D E E F I R S 
 5|        - O   A   P E   E H   |
 6|  F       C O T T A G E R "   |
 7|  U '   M   ' H '       '     |
 8|= J   V E L V E T     '     M |
 9|  I T   R   E D '       '   A |
10|  " W   E " N     "       " R |   Turn 20:
11|    A   L   U       -       L |
12|' Q I - Y   L '     P I N E Y |
13|  U N       O R A G I O U S   |
14|  I       " s   D O X     -   |
15|A d E N I N E S       '     = |
   ------------------------------

-----RECOVER----
Recovered in handleJobGeneric. job={0xc000e5e960 false [0 1 1 0 1 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]} thread=3
Game state

   A B C D E F G H I J K L M N O                Joshua_Sokol           336
   ------------------------------    ->       Andrew_Golding  BGKOTWZ  348
 1|=     '       =       '     = |
 2|  -       "       "     O D   |   Bag + unseen: (9)
 3|    -       '   '       N A   |
 4|'     -   R   B I O T I C S ' |   A A D E E F I R S 
 5|        - O   A   P E   E H   |
 6|  F       C O T T A G E R "   |
 7|  U '   M   ' H '       '     |
 8|= J   V E L V E T     '     M |
 9|  I T   R   E D '       '   A |
10|  " W   E " N     "       " R |   Turn 20:
11|    A   L   U       -       L |
12|' Q I - Y   L '     P I N E Y |
13|  U N       O R A G I O U S   |
14|  I       " s   D O X     -   |
15|A d E N I N E S       '     = |
   ------------------------------

panic: tile in play but not in rack: 5 [recovered]
    panic: throwing panic again [recovered]
    panic: throwing panic again

goroutine 166 [running]:
github.com/domino14/macondo/preendgame.(*Solver).handleJobGeneric.func1()
    github.com/domino14/macondo/preendgame/peg_generic.go:183 +0x1db
panic({0x8fe960?, 0xa8ae20?})
    runtime/panic.go:770 +0x132
github.com/domino14/macondo/preendgame.(*Solver).recursiveSolve.func1()
    github.com/domino14/macondo/preendgame/peg_generic.go:371 +0x2c9
panic({0x915340?, 0xc000120020?})
    runtime/panic.go:770 +0x132
github.com/domino14/macondo/tinymove/conversions.SmallMoveToMove({0x185001db, 0xe, 0x0, 0x12}, 0xc36491b960, 0xc000164008, 0xc34b6250e0, 0xc00012a500)
    github.com/domino14/macondo/tinymove/conversions/conversions.go:29 +0x4cf
github.com/domino14/macondo/preendgame.(*Solver).recursiveSolve(0xc00087eea0, {0xa90338, 0xc00014a5f0}, 0x3?, 0xc000e5e960, {0x185001db, 0xe, 0x0, 0x12}, {{0xc363ef3b58, ...}, ...}, ...)
    github.com/domino14/macondo/preendgame/peg_generic.go:486 +0xb45
github.com/domino14/macondo/preendgame.(*Solver).handleJobGeneric(0xc00087eea0, {0xa90338, 0xc00014a5f0}, {0xc000e5e960, 0x0, {0xc36cf17c00, 0x3e, 0x3e}}, 0x3, 0xc370be7d40)
    github.com/domino14/macondo/preendgame/peg_generic.go:349 +0x11c5
github.com/domino14/macondo/preendgame.(*Solver).multithreadSolveGeneric.func1()
    github.com/domino14/macondo/preendgame/peg_generic.go:65 +0x14f
golang.org/x/sync/errgroup.(*Group).Go.func1()
    golang.org/x/sync@v0.5.0/errgroup/errgroup.go:75 +0x56
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 14
    golang.org/x/sync@v0.5.0/errgroup/errgroup.go:72 +0x96
[cesar@themonolith macondo]$