Making dumb dumber

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
abulmo2
Posts: 338
Joined: Fri Dec 16, 2016 10:04 am
Contact:

Making dumb dumber

Post by abulmo2 » Wed Mar 03, 2021 10:23 pm

As many threads here discuss about weak and new engines, I take my minimalist chess engine Dumb 1.8 and strip all "sophisticated" heuristics, like history, killers, null move, lmr, lmp, check extension, razoring, SEE, etc. to just keep a plain alpha-beta, a simple quiescence search and MVVLVA move ordering to get Dumber 1.0. This Dumber engine is available on github here: https://github.com/abulmo/Dumb/releases/tag/v1.0
My purpose Is to compare Dumb to this new comers. For example, although simpler than Rustic Alpha 1, Dumber is about 100 Elo stronger, maybe because of a better evaluation function (material + pst +tempo, but with tuned weights), but also thanks to a faster search. On my computer Dumber usually analyzes around 10M nodes/s, but Rustic less than 5 M nodes/s, despite a 10% slower move generator.
Compared to dumb 1.8, Dumber is 1000 Elo weaker. All the removed codes just count for 200 lines, so they are worth 5 Elo per lines :-) and are not that complicated.
Richard Delorme

User avatar
mvanthoor
Posts: 986
Joined: Wed Jul 03, 2019 2:42 pm
Location: Netherlands
Full name: Marcel Vanthoor
Contact:

Re: Making dumb dumber

Post by mvanthoor » Wed Mar 03, 2021 10:35 pm

Interesting experiment.

Rustic doesn't have tuned weights yet; that will be in the cards for Rustic 4 or 5 (the first version after the Alpha's). Rustic Alpha 1 basically has no evaluation: it just counts material + PST, and that's it. I often see that tuning PST's and material alone can add 60-100 Elo, so it could be the reason for Dumb being stronger.

It's almost impossible to compare node counts. When I compare Rustic Alpha 1 to other engines on my computer (older i7-6700K) it manages 3-5 million nps. What is your search doing that mine doesn't? If you have plain A/B, I doubt that it can be twice as fast. I'll have to take a look at it. On my computer, I can almost test against any 1600-1800 engine I want, and Rustic is often _much_ faster.

My NPS node count is actually low compared to what could be done. My NPS counts nodes that are actually searched. So if the engine reports 3.2 Mnps, it has generated moves for 3.2 M nodes in that second, and searched them. If the engine enters a node and then immediately exists because (for example) the TT cuts off the search, or is_draw() reports true, the node is NOT counted. (Same for QSearch, btw.)

If I would count a node immediately at the beginning of the search and qsearch functions, I'd not be counting nodes searched, but nodes visited (and left before actually doing anything). That would skyrocket the node count though.
Author of Rustic.
Releases | Code | Docs

User avatar
hgm
Posts: 26134
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Making dumb dumber

Post by hgm » Wed Mar 03, 2021 11:05 pm

Dumber has a transposition table?

abulmo2
Posts: 338
Joined: Fri Dec 16, 2016 10:04 am
Contact:

Re: Making dumb dumber

Post by abulmo2 » Thu Mar 04, 2021 12:09 am

hgm wrote:
Wed Mar 03, 2021 11:05 pm
Dumber has a transposition table?
No.
Richard Delorme

abulmo2
Posts: 338
Joined: Fri Dec 16, 2016 10:04 am
Contact:

Re: Making dumb dumber

Post by abulmo2 » Thu Mar 04, 2021 12:17 am

mvanthoor wrote:
Wed Mar 03, 2021 10:35 pm

My NPS node count is actually low compared to what could be done. My NPS counts nodes that are actually searched. So if the engine reports 3.2 Mnps, it has generated moves for 3.2 M nodes in that second, and searched them. If the engine enters a node and then immediately exists because (for example) the TT cuts off the search, or is_draw() reports true, the node is NOT counted. (Same for QSearch, btw.)

If I would count a node immediately at the beginning of the search and qsearch functions, I'd not be counting nodes searched, but nodes visited (and left before actually doing anything). That would skyrocket the node count though.
So you do not count terminal nodes?
Richard Delorme

User avatar
hgm
Posts: 26134
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Making dumb dumber

Post by hgm » Thu Mar 04, 2021 8:17 am

If I understood Marcel correctly, then in any case he doesn't count nodes where a stand-pat cutoff occurs. I am not sure that this completely coincides with the concept of 'terminal node'. There must be QS nodes that do not have eval >= beta, so that you would start searching captures, but where you discover (after move generation) that there actually are none. (Or, when you prune bad captures, you discover all captures are bad.) I would also qualify these as 'terminal nodes', bu I am not sure whether Rustic counts these. Counting those would be tantamount to counting move generations.

I suspect that the speed difference between Rustic and Dumber is largely due to this.

The advantage of Rustic's way of counting is that the speedup you get by implementing futility pruning ('delta pruning') shows up in the node count. When you also count stand-pat nodes, futility pruning would reduce the node count, because it prevents that such nodes will be reached.

When comparing such things between engines, it would be a good idea to make a more differentiated 'node count': counts move generations and evaluations separately, and even distinguis capture-only move generation from that in the full-width search.

User avatar
mvanthoor
Posts: 986
Joined: Wed Jul 03, 2019 2:42 pm
Location: Netherlands
Full name: Marcel Vanthoor
Contact:

Re: Making dumb dumber

Post by mvanthoor » Thu Mar 04, 2021 9:28 am

hgm wrote:
Thu Mar 04, 2021 8:17 am
If I understood Marcel correctly, then in any case he doesn't count nodes where a stand-pat cutoff occurs. I am not sure that this completely coincides with the concept of 'terminal node'. There must be QS nodes that do not have eval >= beta, so that you would start searching captures, but where you discover (after move generation) that there actually are none. (Or, when you prune bad captures, you discover all captures are bad.) I would also qualify these as 'terminal nodes', bu I am not sure whether Rustic counts these. Counting those would be tantamount to counting move generations.
In Rustic it's simple: it counts a node, as soon as it generates moves in it. If it doesn't generate moves due to an early exit, it doesn't count the node. Depth == 0 is counted by qsearch of course, IF the node generates moves... if it doesn't, it's not counted. I could count both at the point where it generates moves (because it's doing work there), and at the point where it calls evaluation (also doing work there). I don't like just incrementing the node count at the beginning of search/qsearch, because it will massively inflate the speed when nodes are cut off with early exits.

Kiwipete position:

Code: Select all

Counting directly after move generation (so does not count a node when evaluating).

info score cp 25 depth 1 seldepth 16 time 0 nodes 1598 nps 0 pv e2a6 b4c3 b2c3 e6d5
info score cp 25 depth 2 seldepth 16 time 1 nodes 3196 nps 3196000 pv e2a6 b4c3 b2c3 e6d5
info score cp 20 depth 3 seldepth 20 time 2 nodes 8550 nps 4275000 pv e2a6 e6d5 a6b7 b4c3 b7a8 c3d2
info score cp 20 depth 4 seldepth 20 time 6 nodes 18819 nps 3136500 pv e2a6 e6d5 a6b7 b4c3 b7a8 c3d2
info score cp 5 depth 5 seldepth 20 time 25 nodes 69957 nps 2798280 hashfull 2 pv e2a6 b4c3 d2c3 e6d5 e4d5 f6d5
info score cp 15 depth 6 seldepth 22 time 96 nodes 212014 nps 2208479 hashfull 19 pv e2a6 e6d5 c3d5 b6d5 a6b7 a8d8 b7d5 f6d5
info score cp 5 depth 7 seldepth 24 time 396 nodes 891736 nps 2251859 hashfull 69 pv e2a6 e6d5 c3d5 f6d5 e5c4 f7f5 c4b6 a7b6
info score cp -15 depth 8 seldepth 26 time 1722 nodes 3348919 nps 1944785 hashfull 401 pv e2a6 e6d5 c3d5 f6d5 e5d3 f7f5 g2h3 f5e4
info score cp -40 depth 9 seldepth 27 time 8717 nodes 16334347 nps 1873850 hashfull 978 pv d5e6 e7e6 e2a6 e6e5 g2h3 b4c3 d2c3 e5e6 c3f6 g7f6

2M nps, +/- 200K.

Code: Select all

Counting directly at the top of search / qsearch. Counts everything, even early exists where no work is done.

info score cp 25 depth 1 seldepth 16 time 0 nodes 4319 nps 0 pv e2a6 b4c3 b2c3 e6d5
info score cp 25 depth 2 seldepth 16 time 0 nodes 8716 nps 0 pv e2a6 b4c3 b2c3 e6d5
info score cp 20 depth 3 seldepth 20 time 2 nodes 25626 nps 12813000 pv e2a6 e6d5 a6b7 b4c3 b7a8 c3d2
info score cp 20 depth 4 seldepth 20 time 6 nodes 63015 nps 10502500 pv e2a6 e6d5 a6b7 b4c3 b7a8 c3d2
info score cp 5 depth 5 seldepth 20 time 24 nodes 283598 nps 11816583 hashfull 2 pv e2a6 b4c3 d2c3 e6d5 e4d5 f6d5
info score cp 15 depth 6 seldepth 22 time 96 nodes 935911 nps 9749073 hashfull 19 pv e2a6 e6d5 c3d5 b6d5 a6b7 a8d8 b7d5 f6d5
info score cp 5 depth 7 seldepth 24 time 397 nodes 4342636 nps 10938630 hashfull 69 pv e2a6 e6d5 c3d5 f6d5 e5c4 f7f5 c4b6 a7b6
info score cp -15 depth 8 seldepth 26 time 1731 nodes 16376305 nps 9460604 hashfull 401 pv e2a6 e6d5 c3d5 f6d5 e5d3 f7f5 g2h3 f5e4
info score cp -40 depth 9 seldepth 27 time 8744 nodes 87974242 nps 10061098 hashfull 978 pv d5e6 e7e6 e2a6 e6e5 g2h3 b4c3 d2c3 e5e6 c3f6 g7f6

10M nodes/second, +/- 500K.
There's your 10M nodes/second, on an older i7-6700K :)

Counting directly after move generation (so it's doing/going to do work), and where a node is evaluated (not generating moves, but also work) This should count "work done nodes" (either move generation/searching or evaluation), but not early exits.

Strange. Hardly any difference with only counting nodes that do move generation.
Author of Rustic.
Releases | Code | Docs

User avatar
hgm
Posts: 26134
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Making dumb dumber

Post by hgm » Thu Mar 04, 2021 9:59 am

What "early exits" do you still have when you count evaluation as "work done"? Is this the version with TT?

User avatar
lithander
Posts: 161
Joined: Sun Dec 27, 2020 1:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Making dumb dumber

Post by lithander » Thu Mar 04, 2021 5:32 pm

Much appreciated! Even though, if it's 100 ELO stronger than rustic, it's not quite in reach for my engine just yet!
abulmo2 wrote:
Thu Mar 04, 2021 12:17 am
So you do not count terminal nodes?
It may be a stupid question but do you count every node evaluated in QSearch or stop counting as soon as you reach depth 0 and start QSearch?
Minimal Chess. My very first chess engine! Details on Youtube & Github

User avatar
lithander
Posts: 161
Joined: Sun Dec 27, 2020 1:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Making dumb dumber

Post by lithander » Thu Mar 04, 2021 5:39 pm

Hmm... maybe you shouldn't have dumbed down the time control code, too! ;)

Dumber-1.0 lost it's first game against MinimalChess on time. Played in CuteChess GUI. TC: 5seconds + 1sec increment. Still have it open if you need anything...

Last edited by lithander on Thu Mar 04, 2021 6:07 pm, edited 1 time in total.
Minimal Chess. My very first chess engine! Details on Youtube & Github

Post Reply