New amateur chess engine Petrel

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Frank Quisinsky
Posts: 7076
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: New amateur chess engine Petrel

Post by Frank Quisinsky »

Hi Aleks,

at first, thanks for Petrel!!

looks good with Process Explorer 17.06:
Example I gave 128 and can see ... 137.388k used.
i9, 4Ghz, Intel 10gen, Windows 11 Pro.
With cygwin1.dll, v3.6.4 (250715, last version):

ucidebug for version 1.3, Shredder 12 GUI (more stable as Shredder 13 GUI):

Code: Select all

UCI debug mode is now on
### 1.: to Petrel 1.3 HCE JA (0): debug on

### 2.: to Petrel 1.3 HCE JA (0): quit

### 3.: to Petrel 1.3 HCE JA (0): uci

### 4.: to Petrel 1.3 HCE JA (0): debug on

### from Petrel 1.3 HCE JA (0): id name petrel 1.3 2025-09-14

### from Petrel 1.3 HCE JA (0): id author Aleks Peshkov

### from Petrel 1.3 HCE JA (0): option name Debug Log File type string default <empty>

### from Petrel 1.3 HCE JA (0): option name Hash type spin min 2 max 16384 default 2

### from Petrel 1.3 HCE JA (0): option name Move Overhead type spin min 0 max 10000 default 0

### from Petrel 1.3 HCE JA (0): option name Ponder type check default false

### from Petrel 1.3 HCE JA (0): option name UCI_Chess960 type check default false

### from Petrel 1.3 HCE JA (0): uciok

### 5.: to Petrel 1.3 HCE JA (0): setoption name Hash value 128

### 6.: to Petrel 1.3 HCE JA (0): isready

### from Petrel 1.3 HCE JA (0): info fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

### unknown info token "fen" sent
### unknown info token "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR" sent
### unknown info token "w" sent
### unknown info token "KQkq" sent
### unknown info token "-" sent
### unknown info token "0" sent
### unknown info token "1" sent
### from Petrel 1.3 HCE JA (0): readyok

setoption name Ponder value false

### 7.: to Petrel 1.3 HCE JA (0): setoption name Ponder value false

setoption name Debug Log File value test

### 8.: to Petrel 1.3 HCE JA (0): setoption name Debug Log File value test

setoption name Move Overhead value 100

### 9.: to Petrel 1.3 HCE JA (0): setoption name Move Overhead value 100

### 10.: to Petrel 1.3 HCE JA (0): isready

### from Petrel 1.3 HCE JA (0): info fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

### unknown info token "fen" sent
### unknown info token "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR" sent
### unknown info token "w" sent
### unknown info token "KQkq" sent
### unknown info token "-" sent
### unknown info token "0" sent
### unknown info token "1" sent
### from Petrel 1.3 HCE JA (0): readyok

Engine: Petrel 1.3 HCE JA (128 MB)
von Aleks Peshkov
### 20.: to Petrel 1.3 HCE JA (0): ucinewgame

### 21.: to Petrel 1.3 HCE JA (0): isready

### from Petrel 1.3 HCE JA (0): info fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

### unknown info token "fen" sent
### unknown info token "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR" sent
### unknown info token "w" sent
### unknown info token "KQkq" sent
### unknown info token "-" sent
### unknown info token "0" sent
### unknown info token "1" sent
### from Petrel 1.3 HCE JA (0): readyok

### 22.: to Petrel 1.3 HCE JA (0): position startpos moves h2h3

### 23.: to Petrel 1.3 HCE JA (0): go wtime 484000 btime 482000 winc 2000 binc 2000

### from Petrel 1.3 HCE JA (0): info depth 1 nodes 1 score cp -12 pv b8a6

  1.00	 0:00 	+0.12 	1...Sa6 (1)
### from Petrel 1.3 HCE JA (0): info depth 1 nodes 2 score cp 23 pv b8c6

  1.00	 0:00 	-0.23 	1...Sc6 (2)
### from Petrel 1.3 HCE JA (0): info depth 1 nodes 3 score cp 26 pv g8f6

  1.00	 0:00 	-0.26 	1...Sf6 (3)
### from Petrel 1.3 HCE JA (0): info depth 1 nodes 20

### from Petrel 1.3 HCE JA (0): info depth 2 nodes 40 score cp -10 pv g8f6 g1f3

  2.00	 0:00 	+0.10 	1...Sf6 2.Sf3 (40)
### from Petrel 1.3 HCE JA (0): info depth 2 nodes 85

### from Petrel 1.3 HCE JA (0): info depth 3 nodes 151 score cp 25 pv g8f6 g1f3 d7d5

  3.00	 0:00 	-0.25 	1...Sf6 2.Sf3 d5 (151)
### from Petrel 1.3 HCE JA (0): info depth 3 nodes 668

### from Petrel 1.3 HCE JA (0): info depth 4 nodes 1175 score cp -10 pv g8f6 g1f3 d7d5 d2d4

  4.00	 0:00 	+0.10 	1...Sf6 2.Sf3 d5 3.d4 (1.175)
### from Petrel 1.3 HCE JA (0): info depth 4 nodes 2156

### from Petrel 1.3 HCE JA (0): info depth 5 nodes 3538 score cp 23 pv g8f6 g1f3 d7d5 d2d4 b8c6

  5.00	 0:00 	-0.23 	1...Sf6 2.Sf3 d5 3.d4 Sc6 (3.538)
### from Petrel 1.3 HCE JA (0): info depth 5 nodes 12710 time 2 nps 5839114

### from Petrel 1.3 HCE JA (0): info depth 6 nodes 21291 time 3 nps 6096729 score cp -10 pv g8f6 g1f3 d7d5 d2d4 b8c6 b1c3

  6.00	 0:00 	+0.10 	1...Sf6 2.Sf3 d5 3.d4 Sc6 4.Sc3 (21.291) 6096
### from Petrel 1.3 HCE JA (0): info depth 6 nodes 40373 time 6 nps 5949367

### from Petrel 1.3 HCE JA (0): info depth 7 nodes 70230 time 11 nps 6028481 score cp 18 pv g8f6 g1f3 d7d5 d2d4 b8c6 b1c3 c8e6

  7.00	 0:00 	-0.18 	1...Sf6 2.Sf3 d5 3.d4 Sc6 4.Sc3 Le6 (70.230) 6028
### from Petrel 1.3 HCE JA (0): info depth 7 nodes 225296 time 33 nps 6764589

### from Petrel 1.3 HCE JA (0): info depth 8 nodes 406477 time 60 nps 6721383 score cp -10 pv g8f6 g1f3 d7d5 d2d4 b8c6 b1c3 c8e6 c1e3

  8.00	 0:00 	+0.10 	1...Sf6 2.Sf3 d5 3.d4 Sc6 4.Sc3 Le6 5.Le3 (406.477) 6721
### from Petrel 1.3 HCE JA (0): info depth 8 nodes 830095 time 128 nps 6460476 score cp -3 pv e7e5 d2d4 e5d4 g1f3 c7c5 c2c3 d8a5 e2e4

  8.00	 0:00 	+0.03 	1...e5 2.d4 exd4 3.Sf3 c5 4.c3 Da5 5.e4 (830.095) 6460
### from Petrel 1.3 HCE JA (0): info depth 8 nodes 994382 time 157 nps 6316042

### from Petrel 1.3 HCE JA (0): info depth 9 nodes 2586722 time 397 nps 6507802 score cp 26 pv e7e5 e2e4 g8f6 g1f3 b8c6 f1d3 d7d5 b1c3 c8e6

  9.00	 0:00 	-0.26 	1...e5 2.e4 Sf6 3.Sf3 Sc6 4.Ld3 d5 5.Sc3 Le6 (2.586.722) 6507
### from Petrel 1.3 HCE JA (0): info depth 9 nodes 4776507 time 704 nps 6780514

### from Petrel 1.3 HCE JA (0): info depth 10 nodes 8298544 time 1245 nps 6660904 score cp -4 pv e7e5 e2e4 g8f6 g1f3 c7c6 f1e2 f6e4 f3e5 d8g5 e5g4

 10.00	 0:01 	+0.04 	1...e5 2.e4 Sf6 3.Sf3 c6 4.Le2 Sxe4 5.Sxe5 Dg5 6.Sg4 (8.298.544) 6660
### from Petrel 1.3 HCE JA (0): info depth 10 nodes 15800689 time 2533 nps 6235933

### from Petrel 1.3 HCE JA (0): info depth 11 nodes 36997439 time 5790 nps 6389600 score cp 15 pv e7e5 e2e4 g8f6 b1c3 c7c6 g1f3 d7d5 e4d5 e5e4 f3e5 c6d5

 11.00	 0:05 	-0.15 	1...e5 2.e4 Sf6 3.Sc3 c6 4.Sf3 d5 5.exd5 e4 6.Se5 cxd5 (36.997.439) 6389
### from Petrel 1.3 HCE JA (0): info depth 11 nodes 60921223 time 9535 nps 6388628 score cp 23 pv g8f6 g1f3 d7d5 d2d4 e7e6 e2e3 b8c6 f1d3 f8d6 e1g1 e8g8

 11.00	 0:09 	-0.23 	1...Sf6 2.Sf3 d5 3.d4 e6 4.e3 Sc6 5.Ld3 Ld6 6.O-O O-O (60.921.223) 6388
### from Petrel 1.3 HCE JA (0): info depth 11 nodes 105569609 time 15962 nps 6613513

### from Petrel 1.3 HCE JA (0): info score cp 23 pv g8f6 g1f3 d7d5 d2d4 e7e6 e2e3 b8c6 f1d3 f8d6 e1g1 e8g8

  0.00	 0:16 	-0.23 	1...Sf6 2.Sf3 d5 3.d4 e6 4.e3 Sc6 5.Ld3 Ld6 6.O-O O-O 6613
### from Petrel 1.3 HCE JA (0): bestmove g8f6

Bester Zug: Sg8-f6 Zeit: 0:16.000 min  K/s: 6.613.513  Knoten: 105.569.609 
Best
Frank

PS: Have a look in Jim's thread (for ucidebug v2.0).
I am really thinking "Hash" is the problem, compare the two debug files!
Have a nice Sunday, hope not the long day with chess programming.
Aleks Peshkov
Posts: 947
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: New amateur chess engine Petrel

Post by Aleks Peshkov »

Now I am forced to make Windows build myself. I hope to do this in several hours.
taychoe
Posts: 8
Joined: Wed Jul 02, 2025 6:28 pm
Full name: Tay Choe

Re: New amateur chess engine Petrel

Post by taychoe »

You are correct, Frank. The engine crashes when you try to change the hash, either via a GUI, or via setoption in CLI. It fails during the call to free(). I worked around it by replacing that allocateAligned(bytes, min) with a simple malloc(bytes) and re-compiling. I'm not sure why that works, but the online reference I looked at mention that the behaviour of free() is undefined if the ptr did not come from malloc, calloc, realloc, or aligned_alloc.
Aleks Peshkov
Posts: 947
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: New amateur chess engine Petrel

Post by Aleks Peshkov »

As temporary hack we can set default hash size to 256M, so we do not need to free anything. :)
taychoe
Posts: 8
Joined: Wed Jul 02, 2025 6:28 pm
Full name: Tay Choe

Re: New amateur chess engine Petrel

Post by taychoe »

You can also try replacing allocateAligned(bytes, min) with aligned_alloc(alignment, bytes). :wink:
User avatar
Gabor Szots
Posts: 1466
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: New amateur chess engine Petrel

Post by Gabor Szots »

Aleks Peshkov wrote: Sun Oct 12, 2025 10:05 am Does petrel 1.3 allocate hash memory correctly?
I don't have that version but 1.0 did it correctly.
Gabor Szots
CCRL testing group
User avatar
Gabor Szots
Posts: 1466
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: New amateur chess engine Petrel

Post by Gabor Szots »

FYI, when using makefile, I get this error output:

clang++: warning: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Wdeprecated-ofast]
clang++: warning: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Wdeprecated-ofast]
In file included from src/Evaluation.cpp:1:
In file included from src/Evaluation.hpp:5:
src/typedefs.hpp:141:85: error: static assertion failed due to requirement 'sizeof(Move) == sizeof(short)'
141 | constexpr Move (Square::_t f, Square::_t t) : from_{f}, to_{t} { static_assert (sizeof(Move) == sizeof(int16_t)); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/typedefs.hpp:141:98: note: expression evaluates to '4 == 2'
141 | constexpr Move (Square::_t f, Square::_t t) : from_{f}, to_{t} { static_assert (sizeof(Move) == sizeof(int16_t)); }
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from src/Evaluation.cpp:1:
src/Evaluation.hpp:108:9: warning: packed attribute is unnecessary for 'PieceSquareTable::element_type::(unnamed struct at src/Evaluation.hpp:108:9)' [-Wpacked]
108 | struct PACKED {
| ^
1 warning and 1 error generated.
make: *** [Makefile:123: build/Evaluation.o] Error 1
Gabor Szots
CCRL testing group
User avatar
Jim Ablett
Posts: 2309
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: New amateur chess engine Petrel

Post by Jim Ablett »

Gabor Szots wrote: Sun Oct 12, 2025 11:37 am FYI, when using makefile, I get this error output:

clang++: warning: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Wdeprecated-ofast]
clang++: warning: argument '-Ofast' is deprecated; use '-O3 -ffast-math' for the same behavior, or '-O3' to enable only conforming optimizations [-Wdeprecated-ofast]
In file included from src/Evaluation.cpp:1:
In file included from src/Evaluation.hpp:5:
src/typedefs.hpp:141:85: error: static assertion failed due to requirement 'sizeof(Move) == sizeof(short)'
141 | constexpr Move (Square::_t f, Square::_t t) : from_{f}, to_{t} { static_assert (sizeof(Move) == sizeof(int16_t)); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/typedefs.hpp:141:98: note: expression evaluates to '4 == 2'
141 | constexpr Move (Square::_t f, Square::_t t) : from_{f}, to_{t} { static_assert (sizeof(Move) == sizeof(int16_t)); }
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from src/Evaluation.cpp:1:
src/Evaluation.hpp:108:9: warning: packed attribute is unnecessary for 'PieceSquareTable::element_type::(unnamed struct at src/Evaluation.hpp:108:9)' [-Wpacked]
108 | struct PACKED {
| ^
1 warning and 1 error generated.
make: *** [Makefile:123: build/Evaluation.o] Error 1
Compile with my modified src code (included with my build)

Jim.
User avatar
Gabor Szots
Posts: 1466
Joined: Sat Jul 21, 2018 7:43 am
Location: Budapest, Hungary
Full name: Gabor Szots

Re: New amateur chess engine Petrel

Post by Gabor Szots »

Jim Ablett wrote: Sun Oct 12, 2025 11:45 amCompile with my modified src code (included with my build)

Jim.
Oh, thanks, OK with that. But I do this only out of curiosity, your builds are much faster.
Gabor Szots
CCRL testing group
Aleks Peshkov
Posts: 947
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: New amateur chess engine Petrel

Post by Aleks Peshkov »

Jim Ablett wrote: Sun Oct 12, 2025 11:45 am src/typedefs.hpp:141:85: error: static assertion failed due to requirement 'sizeof(Move) == sizeof(short)'
141 | constexpr Move (Square::_t f, Square::_t t) : from_{f}, to_{t} { static_assert (sizeof(Move) == sizeof(int16_t)); }
In file included from src/Evaluation.cpp:1:
src/Evaluation.hpp:108:9: warning: packed attribute is unnecessary for 'PieceSquareTable::element_type::(unnamed struct at src/Evaluation.hpp:108:9)' [-Wpacked]
108 | struct PACKED {
| ^
1 warning and 1 error generated.
make: *** [Makefile:123: build/Evaluation.o] Error 1
My understanding cannot fix these issues. They are serious problems.