SukakuExplainer Bugreport

Programs which generate, solve, and analyze Sudoku puzzles

SukakuExplainer Bugreport

Postby urhegyi » Thu Dec 16, 2021 4:56 pm

I'm rating a batch of 50 custom extra regions sudoku's.
One of them crashed the GUI and running serate from the command line(with -U option) gave this error:
Code: Select all
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "diuf.sudoku.Grid.getRegionAt(java.lang.Class, diuf.sudoku.Cell)" is null
        at diuf.sudoku.solver.rules.unique.BivalueUniversalGrave.addBug3Hint(Unknown Source)
        at diuf.sudoku.solver.rules.unique.BivalueUniversalGrave.getHints(Unknown Source)
        at diuf.sudoku.solver.Solver.getDifficulty(Unknown Source)
        at diuf.sudoku.test.serate.main(Unknown Source)

To reproduce the issue:
Code: Select all
#1//B4,JSB
..32..4....7..9.........8.7....9..1......6....8......57......86...9.......5......
.....22.....2222..11..22...1111.2.3..11...33..1.4.3333...44..33..4444.....44.....

Image
SukakuExplainer:JSB with the normal boxes and 4 extra regions
Code: Select all
..32..4....7..9.........8.7....9..1......6....8......57......86...9.......5...... .....22.....2222..11..22...1111.2.3..11...33..1.4.3333...44..33..4444.....44.....

Disable "bug" solving method resolved the issue in the GUI but don't know how to do this on command line(Except with the -M -U option).
Code: Select all
Analysis results  Difficulty rating: 8,8
This Sudoku can be solved using the following logical methods:
56 x Hidden Single (1,0-1,5)
7 x Naked Single (2,3)
10 x Pointing (2,6)
21 x Claiming (2,8)
8 x Generalized Intersection (2,9)
3 x Naked Pair (3,0)
1 x Naked Triplet (3,6)
4 x XY-Wing (4,2)
1 x XYZ-Wing (4,4)
1 x Aligned Pair Exclusion (6,2)
1 x Bidirectional X-Cycle (6,5)
1 x Turbot Fish (6,6)
1 x Forcing X-Chain (6,7)
1 x Bidirectional Cycle (7,1)
7 x Forcing Chain (7,2-7,3)
3 x Aligned Triplet Exclusion (7,5)
10 x Nishio Forcing Chains (7,7-8,2)
1 x Region Forcing Chains (8,2)
6 x Cell Forcing Chains (8,3-8,5)
3 x Dynamic Region Forcing Chains (8,7-8,8)
1 x Dynamic Cell Forcing Chains (8,8)

The current state when the error occured:
Image
Solvepath until crash:
Hidden Text: Show
Code: Select all
Solution Path
1: 1.2, Hidden Single: R3C4: 4 in block 2: r3c4=4
2: 1.2, Hidden Single: R4C7: 6 in block 6: r4c7=6
3: 1.2, Hidden Single: R7C6: 5 in block 8: r7c6=5
4: 1.5, Hidden Single: R8C3: 8 in column 3: r8c3=8
5: 2.6, Pointing: Cells R2C4,R2C5,R3C5,R3C6: 3 in block and extra region: r2c7<>3, r4c6<>3
6: 2.6, Pointing: Cells R4C2,R5C2: 7 in block and extra region: r4c4<>7
7: 2.6, Pointing: Cells R5C7,R5C8,R6C7,R6C8: 7 in block and extra region: r6c6<>7
8: 2.8, Claiming: Cells R4C1,R4C2,R4C4: 5 in row and extra region: r3c1<>5, r3c2<>5, r5c2<>5
9: 2.8, Claiming: Cells R3C1,R3C2: 6 in extra region and block: r1c1<>6, r1c2<>6, r2c1<>6, r2c2<>6, r3c3<>6
10: 1.5, Hidden Single: R6C3: 6 in column 3: r6c3=6
11: 2.6, Pointing: Cells R3C1,R3C2: 6 in block and row: r3c5<>6, r3c8<>6
12: 2.8, Claiming: Cells R4C1,R4C2,R4C3,R5C2,R5C3: 4 in extra region and block: r5c1<>4, r6c1<>4
13: 2.8, Claiming: Cells R2C4,R2C5: 6 in extra region and block: r1c5<>6
14: 1.5, Hidden Single: R1C8: 6 in row 1: r1c8=6
15: 2.8, Claiming: Cells R5C7,R5C8,R6C7,R6C8: 9 in extra region and block: r5c9<>9
16: 2.8, Claiming: Cells R7C5,R8C5,R8C6: 2 in extra region and block: r9c5<>2, r9c6<>2
17: 2.8, Claiming: Cells R7C5,R8C5,R8C6: 4 in extra region and block: r9c5<>4, r9c6<>4
18: 2.8, Claiming: Cells R8C5,R9C4: 6 in extra region and block: r9c5<>6
19: 2.8, Claiming: Cells R1C6,R4C6: 7 in extra region and column: r8c6<>7, r9c6<>7
20: 2.9, Generalized Intersection: Cells R5C1,R5C2,R5C3,R6C1: 1 in block: r3c1<>1
21: 2.9, Generalized Intersection: Cells R5C1,R5C2,R5C3,R6C1: 9 in block: r3c1<>9
22: 2.9, Generalized Intersection: Cells R2C4,R5C4: 8 in column: r4c6<>8
23: 1.5, Hidden Single: R4C9: 8 in row 4: r4c9=8
24: 2.8, Claiming: Cells R4C1,R4C2,R4C3: 4 in row and block: r5c2<>4, r5c3<>4
25: 2.8, Claiming: Cells R4C1,R4C2,R4C4: 3 in row and extra region: r5c2<>3
26: 2.8, Claiming: Cells R1C6,R2C4,R2C5: 8 in extra region and block: r1c5<>8
27: 2.9, Generalized Intersection: Cells R3C5,R3C8: 5 in row: r2c7<>5
28: 1.5, Hidden Single: R8C7: 5 in column 7: r8c7=5
29: 2.8, Claiming: Cells R2C4,R2C5,R3C5: 5 in extra region and block: r1c5<>5
30: 2.8, Claiming: Cells R1C1,R1C2: 5 in row and block: r2c1<>5, r2c2<>5
31: 7.5, Aligned Triplet Exclusion: R3C2,R3C3,R4C3: r4c3<>2
32: 2.3, Naked Single: R4C3: 4: r4c3=4
33: 2.9, Generalized Intersection: Cells R4C1,R4C2,R5C1,R5C2,R5C3,R6C1: 2 in block: r3c1<>2
34: 2.3, Naked Single: R3C1: 6: r3c1=6
35: 7.8, Nishio Forcing Chain (w/9 nodes): R1C2.9 on ==> R7C3.9 both on & off: r1c2<>9
36: 7.8, Nishio Forcing Chain (w/9 nodes): R5C8.7 on ==> R6C4.7 both on & off: r5c8<>7
37: 7.8, Nishio Forcing Chain (w/9 nodes): R8C9.4 on ==> R5C8.4 both on & off: r8c9<>4
38: 7.8, Nishio Forcing Chain (w/9 nodes): R9C2.9 on ==> R3C3.9 both on & off: r9c2<>9
39: 7.9, Nishio Forcing Chain (w/15 nodes): R7C5.1 on ==> R3C2.1 both on & off: r7c5<>1
40: 8.2, Region Forcing Chains (w/8 nodes): 7 in block ==> R8C5.1 off: r8c5<>1
41: 8.3, Cell Forcing Chains (w/10 nodes): R6C4 ==> R2C4.1 off: r2c4<>1
42: 8.1, Nishio Forcing Chain (w/27 nodes): R5C5.1 on ==> R2C9.1 both on & off: r5c5<>1
43: 8.3, Cell Forcing Chains (w/12 nodes): R3C5 ==> R2C8.2 off: r2c8<>2
44: 8.3, Cell Forcing Chains (w/12 nodes): R6C4 ==> R8C6.3 off: r8c6<>3
45: 8.3, Cell Forcing Chains (w/12 nodes): R6C4 ==> R2C4.3 off: r2c4<>3
46: 8.3, Cell Forcing Chains (w/12 nodes): R6C4 ==> R4C2.5 off: r4c2<>5
47: 1.5, Hidden Single: R1C2: 5 in column 2: r1c2=5
48: 8.5, Cell Forcing Chains (w/18 nodes): R1C6 ==> R6C6.3 off: r6c6<>3
49: 2.8, Claiming: Cells R5C7,R5C8,R6C7,R6C8: 3 in extra region and block: r5c9<>3
50: 8.7, Region Forcing Chains (w/8 nodes): 1 in block ==> R2C1.1 off: r2c1<>1
51: 8.8, Region Forcing Chains (w/9 nodes): 1 in block ==> R9C4.1 off: r9c4<>1
52: 8.2, Nishio Forcing Chain (w/36 nodes): R7C2.1 on ==> R3C6.1 both on & off: r7c2<>1
53: 8.8, Cell Forcing Chains (w/10 nodes): R7C4 ==> R9C4.3 off: r9c4<>3
54: 8.8, Region Forcing Chains (w/10 nodes): 1 in block ==> R2C2.1 off: r2c2<>1
55: 7.2, Forcing Chain (w/8 nodes): R5C5.4 off: r5c5<>4
56: 2.6, Pointing: Cells R6C5,R6C6: 4 in block and row: r6c8<>4
57: 7.2, Forcing Chain (w/8 nodes): R6C5.4 off: r6c5<>4
58: 1.2, Hidden Single: R6C6: 4 in block 5: r6c6=4
59: 1.2, Hidden Single: R5C9: 4 in block 6: r5c9=4
60: 7.3, Forcing Chain (w/10 nodes): R7C5.3 off: r7c5<>3
61: 7.5, Aligned Triplet Exclusion: R4C4,R6C4,R8C6: r4c4<>3
62: 2.3, Naked Single: R4C4: 5: r4c4=5
63: 1.2, Hidden Single: R5C1: 5 in block 4: r5c1=5
64: 2.8, Claiming: Cells R4C1,R4C2: 3 in row and block: r6c1<>3
65: 7.5, Aligned Triplet Exclusion: R5C4,R6C4,R8C6: r5c4<>3,7
66: 2.8, Claiming: Cells R6C4,R7C4: 3 in column and extra region: r8c5<>3
67: 2.8, Claiming: Cells R6C4,R9C4: 7 in column and extra region: r8c5<>7
68: 1.5, Hidden Single: R8C8: 7 in row 8: r8c8=7
69: 1.2, Hidden Single: R9C8: 4 in block 9: r9c8=4
70: 7.2, Forcing Chain (w/8 nodes): R8C1.1 off: r8c1<>1
71: 7.2, Forcing Chain (w/8 nodes): R8C1.3 off: r8c1<>3
72: 7.7, Nishio Forcing Chain (w/7 nodes): R5C7.9 on ==> R3C2.9 both on & off: r5c7<>9
73: 7.9, Nishio Forcing Chain (w/13 nodes): R5C7.2 on ==> R4C2.2 both on & off: r5c7<>2
74: 7.3, Forcing Chain (w/10 nodes): R7C7.3 off: r7c7<>3
75: 7.9, Nishio Forcing Chain (w/15 nodes): R4C2.2 on ==> R9C1.2 both on & off: r4c2<>2
76: 7.2, Forcing Chain (w/8 nodes): R3C6.1 off: r3c6<>1
77: 2.3, Naked Single: R3C6: 3: r3c6=3
78: 6.2, Aligned Pair Exclusion: R1C6,R3C8: r1c6<>1
79: 2.6, Pointing: Cells R1C5,R2C5,R3C5: 1 in block and column: r6c5<>1, r9c5<>1
80: 2.6, Pointing: Cells R5C4,R6C4: 1 in block and column: r7c4<>1
81: 2.3, Naked Single: R7C4: 3: r7c4=3
82: 4.2, XY-Wing: Cells R8C6,R4C6,R6C4 on value 7: r5c5<>7, r6c5<>7
83: 4.2, XY-Wing: Cells R9C4,R9C5,R2C4 on value 8: r2c5<>8
84: 6.6, Turbot Fish (w/4 nodes): R9C1.1 off: r9c1<>1
85: 7.1, Bidirectional Cycle (w/6 nodes): R1C6,R4C6,R6C4,R6C1,R1C1,R1C5: r1c9<>1
86: 2.3, Naked Single: R1C9: 9: r1c9=9
87: 2.6, Pointing: Cells R7C7,R9C7: 9 in block and column: r6c7<>9
88: 2.6, Pointing: Cells R2C7,R2C9: 1 in block and row: r2c5<>1
89: 2.9, Generalized Intersection: Cells R3C2,R3C3: 9 in block: r5c3<>9
90: 2.8, Claiming: Cells R3C2,R5C2: 9 in extra region and column: r7c2<>9
91: 3.0, Naked Pair: Cells R7C2,R8C1: 2,4 in block: r7c3<>2, r8c2<>2,4, r9c1<>2, r9c2<>2
92: 2.8, Claiming: Cells R9C7,R9C9: 2 in row and block: r7c7<>2, r8c9<>2
93: 2.9, Generalized Intersection: Cells R3C3,R5C3: 2 in column: r3c2<>2
94: 2.8, Claiming: Cells R4C1,R5C2,R5C3: 2 in extra region and block: r6c1<>2
95: 3.0, Naked Pair: Cells R2C2,R7C2: 2,4 in column: r5c2<>2
96: 4.2, XY-Wing: Cells R3C5,R3C8,R2C7 on value 2: r2c9<>2
97: 1.5, Hidden Single: R9C9: 2 in column 9: r9c9=2
98: 4.4, XYZ-Wing: Cells R6C7,R5C7,R6C5 on value 3: r6c8<>3
99: 4.2, XY-Wing: Cells R6C1,R5C3,R6C8 on value 2: r5c8<>2
100: 2.6, Pointing: Cells R6C7,R6C8: 2 in block and row: r6c5<>2
101: 2.3, Naked Single: R6C5: 3: r6c5=3
102: 3.6, Naked Triplet: Cells R5C3,R5C4,R5C5: 1,2,8 in row: r5c2<>1
103: 2.9, Generalized Intersection: Cells R3C2,R5C3: 1 in extra region: r3c3<>1
104: 6.5, Bidirectional X-Cycle (w/4 nodes): R3C2,R5C3,R7C3,R7C7,R2C7,R3C5: r9c7<>1
105: 3.0, Naked Pair: Cells R9C1,R9C7: 3,9 in row: r9c2<>3

Get all hints crashed after line 104, get next hint found the naked pair at line 105 and then produced the error.
After line 105 you got an error in BUG 3 solving method.

Here I disable bug solving method:
rest of solvepath:
Hidden Text: Show
Code: Select all
106: 6.7, Forcing X-Chain (w/6 nodes): R1C1.1 on: r1c1<>8, r1c1=1
107: 1.2, Hidden Single: R2C1: 8 in block 1: r2c1=8
108: 1.2, Hidden Single: R2C2: 4 in block 1: r2c2=4
109: 1.2, Hidden Single: R3C3: 2 in block 1: r3c3=2
110: 1.0, Hidden Single: R3C2: 9 in block 1: r3c2=9
111: 1.2, Hidden Single: R3C5: 1 in block 2: r3c5=1
112: 1.0, Hidden Single: R3C8: 5 in row 3: r3c8=5
113: 1.2, Hidden Single: R2C5: 5 in block 2: r2c5=5
114: 1.2, Hidden Single: R2C4: 6 in block 2: r2c4=6
115: 1.2, Hidden Single: R1C6: 8 in block 2: r1c6=8
116: 1.0, Hidden Single: R1C5: 7 in block 2: r1c5=7
117: 1.2, Hidden Single: R2C9: 1 in block 3: r2c9=1
118: 1.0, Hidden Single: R8C9: 3 in column 9: r8c9=3
119: 1.2, Hidden Single: R2C7: 2 in block 3: r2c7=2
120: 1.0, Hidden Single: R2C8: 3 in block 3: r2c8=3
121: 1.2, Hidden Single: R5C3: 1 in block 4: r5c3=1
122: 1.0, Hidden Single: R7C3: 9 in column 3: r7c3=9
123: 1.2, Hidden Single: R4C1: 2 in block 4: r4c1=2
124: 1.2, Hidden Single: R4C2: 3 in block 4: r4c2=3
125: 1.0, Hidden Single: R4C6: 7 in row 4: r4c6=7
126: 1.2, Hidden Single: R5C2: 7 in block 4: r5c2=7
127: 1.0, Hidden Single: R6C1: 9 in block 4: r6c1=9
128: 1.2, Hidden Single: R6C4: 1 in block 5: r6c4=1
129: 1.2, Hidden Single: R5C5: 2 in block 5: r5c5=2
130: 1.0, Hidden Single: R5C4: 8 in block 5: r5c4=8
131: 1.0, Hidden Single: R9C4: 7 in column 4: r9c4=7
132: 1.2, Hidden Single: R6C8: 2 in block 6: r6c8=2
133: 1.0, Hidden Single: R5C8: 9 in column 8: r5c8=9
134: 1.0, Hidden Single: R5C7: 3 in row 5: r5c7=3
135: 1.0, Hidden Single: R6C7: 7 in block 6: r6c7=7
136: 1.2, Hidden Single: R7C2: 2 in block 7: r7c2=2
137: 1.2, Hidden Single: R9C1: 3 in block 7: r9c1=3
138: 1.0, Hidden Single: R8C1: 4 in column 1: r8c1=4
139: 1.2, Hidden Single: R9C6: 1 in block 8: r9c6=1
140: 1.0, Hidden Single: R8C6: 2 in column 6: r8c6=2
141: 1.2, Hidden Single: R8C2: 1 in block 7: r8c2=1
142: 1.0, Hidden Single: R9C2: 6 in block 7: r9c2=6
143: 1.0, Hidden Single: R8C5: 6 in row 8: r8c5=6
144: 1.2, Hidden Single: R7C5: 4 in block 8: r7c5=4
145: 1.0, Hidden Single: R9C5: 8 in block 8: r9c5=8
146: 1.0, Hidden Single: R7C7: 1 in row 7: r7c7=1
147: 1.0, Hidden Single: R9C7: 9 in block 9: r9c7=9

Code: Select all
.---------.---------.---------.
| 1  5  3 | 2  7  8 | 4  6  9 |
| 8  4  7 | 6  5  9 | 2  3  1 |
| 6  9  2 | 4  1  3 | 8  5  7 |
:---------+---------+---------:
| 2  3  4 | 5  9  7 | 6  1  8 |
| 5  7  1 | 8  2  6 | 3  9  4 |
| 9  8  6 | 1  3  4 | 7  2  5 |
:---------+---------+---------:
| 7  2  9 | 3  4  5 | 1  8  6 |
| 4  1  8 | 9  6  2 | 5  7  3 |
| 3  6  5 | 7  8  1 | 9  4  2 |
'---------'---------'---------'
urhegyi
 
Posts: 743
Joined: 13 April 2020

Re: SukakuExplainer Bugreport

Postby 1to9only » Thu Dec 16, 2021 9:50 pm

Noted. I'll look into this sometime...

As SE was originally written for classic sudoku and modified for various variants, there are likely to exist other software bugs in the code.
User avatar
1to9only
 
Posts: 4175
Joined: 04 April 2018

Re: SukakuExplainer Bugreport

Postby urhegyi » Thu Dec 16, 2021 11:16 pm

I tried some older versions: 02 dec 2021: bug, same problem with version 02 nov 2021.
version 02 feb 2021(first version where extra regions support was added): works, but analyze log differs from newer version where I could only test with bug method disabled.
all newer versions have this bug
Image
urhegyi
 
Posts: 743
Joined: 13 April 2020

Re: SukakuExplainer Bugreport

Postby urhegyi » Fri Dec 24, 2021 12:35 am

I was rating 100 windoku-x. Nr 67 has the same error as the previous post:
Code: Select all
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "Object.equals(Object)" because the return value of "diuf.sudoku.Grid.getRegionAt(java.lang.Class, diuf.sudoku.Cell)" is null
        at diuf.sudoku.solver.rules.unique.BivalueUniversalGrave.addBug3Hint(Unknown Source)
        at diuf.sudoku.solver.rules.unique.BivalueUniversalGrave.getHints(Unknown Source)
        at diuf.sudoku.solver.Solver.getDifficulty(Unknown Source)
        at diuf.sudoku.test.serate.main(Unknown Source)

to reproduce:
Code: Select all
.....6..............271......1.....4..4...8..6.....9......537..............8.....
WINDOKU-X
In GUI it crashed too. Solution disable BUG solving method. On command line -M disables uniqueness and BUG methods too.(temporary fix)
urhegyi
 
Posts: 743
Joined: 13 April 2020

Re: SukakuExplainer Bugreport

Postby urhegyi » Thu Jan 06, 2022 10:21 pm

Thank you for fixing the nullpointerexception at addBug3Hint. Retested both examples with SE version from 4 jan 2022: excellent work!
urhegyi
 
Posts: 743
Joined: 13 April 2020


Return to Software