Pedantic Developer's Log Stardate...

Discussion of chess software programming and technical issues.

Moderators: hgm, chrisw, Rebel

JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Pedantic Developer's Log Stardate...

Post by JoAnnP38 »

JoAnnP38 wrote: Tue Apr 11, 2023 5:17 pm I am closing in on release 0.2 of Pedantic and I may be able to attain 2500 Elo rating in this release. That would be a pretty good pickup from my first release. I have uncovered a recent bug that I am perplexed about fixing, because every time it happens, I have a good laugh. The bug causes Pedantic to under-promote even when it doesn't need a knight for checkmate. The first time it happened it was when I was testing Pedantic against Leorik and Pendantic underpromoted to a Rook. It didn't affect the outcome of the game because it was a promotion that was intended to force Leorik to capture and then Leorik's rook was captured in exchange. At the time I had a good belly laugh as I imagined Pedantic trolling Leorik. Since then, it has occurred a handful of times. Today, it underpromoted to a bishop that wasn't en prise!! Pedantic went on to win the game, but this bug needs to be stamped out, even though I still laugh at the prospect that Pedantic is taunting the other engine.
*sigh* :x :oops:

Code: Select all

    8/KP6/8/6p1/8/8/6k1/4q3 w - - 0 162
    info depth 1 score cp -72 nodes 14 nps 93 time 150 pv b7b8q
    info depth 2 score cp -168 nodes 659 nps 4279 time 154 pv b7b8q e1a1 a7b6 a1b1
    info depth 3 score cp -168 nodes 2286 nps 14198 time 161 pv b7b8q e1a1 a7b6 a1b1 b6a7 b1b8
    info depth 4 score cp -195 nodes 5544 nps 32611 time 170 pv b7b8q e1a1 a7b6 a1b1 b6a7 b1b8 a7b8
    info depth 5 score cp -171 nodes 25562 nps 112114 time 228 pv b7b8q e1a5 a7b7 a5b4 b7a7 b4b8 a7b8 g5g4
    info depth 6 score cp -205 nodes 42241 nps 155297 time 272 pv b7b8q e1a5 a7b7 a5b4 b7a7 b4b8 a7b8 g5g4 b8b7
    info depth 7 score cp -205 nodes 75491 nps 211459 time 357 pv b7b8q e1a5 a7b7 a5b4 b7a7 b4b8 a7b8 g5g4 b8a7 g4g3
    info depth 8 score cp -185 nodes 541331 nps 830262 time 652 pv b7b8q e1a5 a7b7 a5b4 b7c7 b4b8 c7b8 g5g4 b8a7 g4g3 a7b7
    info depth 9 score cp -205 nodes 986618 nps 1122432 time 879 pv b7b8q e1f2 a7a6 f2a2 a6b6 a2b3 b6c7 b3g3 c7b7 g3b3 b7c7 b3g3
    info depth 10 score cp -233 nodes 2103200 nps 1491631 time 1410 pv b7b8q e1a1 a7b6 a1b2 b6c7 b2b8 c7b8 g5g4 b8b7 g4g3 b7b6 g2f1
    info depth 11 score cp -973 nodes 14952515 nps 2189882 time 6828 pv b7b8b e1a1 a7b6 a1b1 b6a7 b1c1
    bestmove b7b8b ponder e1a1
JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Pedantic Developer's Log Stardate...

Post by JoAnnP38 »

JoAnnP38 wrote: Tue Apr 11, 2023 6:03 pm
JoAnnP38 wrote: Tue Apr 11, 2023 5:17 pm I am closing in on release 0.2 of Pedantic and I may be able to attain 2500 Elo rating in this release. That would be a pretty good pickup from my first release. I have uncovered a recent bug that I am perplexed about fixing, because every time it happens, I have a good laugh. The bug causes Pedantic to under-promote even when it doesn't need a knight for checkmate. The first time it happened it was when I was testing Pedantic against Leorik and Pendantic underpromoted to a Rook. It didn't affect the outcome of the game because it was a promotion that was intended to force Leorik to capture and then Leorik's rook was captured in exchange. At the time I had a good belly laugh as I imagined Pedantic trolling Leorik. Since then, it has occurred a handful of times. Today, it underpromoted to a bishop that wasn't en prise!! Pedantic went on to win the game, but this bug needs to be stamped out, even though I still laugh at the prospect that Pedantic is taunting the other engine.
Okay, maybe the fact that the position is lost regardless of the chosen promotion. Maybe this bug is actually a manifestation of horizon effect. I would be funny if Pedantic underpromoted to a Bishop simply because its opponents would be more interested in promoting its pawn than killing the bishop.

[fen]8/KP6/8/6p1/8/8/6k1/4q3 w - - 0 162[/fen]
JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Pedantic Developer's Log Stardate...

Post by JoAnnP38 »

I am closing in on release 0.2 of Pedantic. I have finished all of the planned features except for updating the unit tests to cover all the functionality of the evaluation function. To do a good job on this final piece will probably take me a few days. The features I have completed in this release are:
  • More robust UCI implementation
    1. Add updates for: seldepth, hashfull, currmove, currmovenumber and cpuload
  • Removed LiteDB from project and just write data directly to JSON files. (Removes about 10MB from EXE.)
  • Implemented SEE (static exchange evaluation). +90 Elo
    1. Allows "bad" captures to be searched at reduced depths
    2. Prevents "bad" checks from triggering search extension
    3. Prune "bad" captures from quiescence search
  • Optimized time budgeting by adapting to new branching factor (2.0625) +45 Elo
  • Put Mop-Up evaluation from Chess 4.5 back into evaluation +20 Elo
  • Extend evaluation to support lazy evaluation and defer some parts of eval and calculate only if necessary. +25 Elo
  • Correct bug where draws were sometimes avoided in endgame to the point of throwing the game. +10 Elo
  • Removed expensive draw detection from internal node eval. +20 Elo
In head-to-head play against Pedantic 0.1, Pedantic 0.2 shows about 210 Elo improvement which puts the engine right on the cusp of 2500 Elo.

Code: Select all

Score of Pedantic 0.2B vs Pedantic 0.1: 669 - 129 - 202  [0.770] 1000
...      Pedantic 0.2B playing White: 362 - 41 - 97  [0.821] 500
...      Pedantic 0.2B playing Black: 307 - 88 - 105  [0.719] 500
...      White vs Black: 450 - 348 - 202  [0.551] 1000
Elo difference: 209.9 +/- 21.7, LOS: 100.0 %, DrawRatio: 20.2 %
Next, I will schedule a gauntlet against some other engines of around the same rank or higher to confirm. That can be running while I turn my attention to unit tests. (Yes, I know -- I'm old school and don't often write my unit tests before writing application code. Bad boomer.)
JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Pedantic Developer's Log Stardate...

Post by JoAnnP38 »

Here is the gauntlet results I mentioned in my previous post. It looks like I still have some work to do to cross the 2500 Elo level, but I'm close.

Code: Select all

Rank Name                          Elo     +/-   Games    Wins  Losses   Draws   Points   Score    Draw
   0 Pedantic 0.2B                  22      12    2800    1243    1065     492   1489.0   53.2%   17.6%
   1 Peacekeeper 1.30              226      36     400     282      53      65    314.5   78.6%   16.3%
   2 Leorik 2.0.2                  156      35     400     258      90      52    284.0   71.0%   13.0%
   3 MinimalChess 0.6               32      30     400     174     137      89    218.5   54.6%   22.3%
   4 MadChess 2.0                  -61      32     400     135     204      61    165.5   41.4%   15.3%
   5 Dragon 4.6                    -63      31     400     128     200      72    164.0   41.0%   18.0%
   6 Achillees 1.0                -225      36     400      53     281      66     86.0   21.5%   16.5%
   7 Pedantic 0.1                 -245      35     400      35     278      87     78.5   19.6%   21.8%
rdhoffmann
Posts: 36
Joined: Fri Apr 21, 2023 3:46 pm
Full name: Richard Hoffmann

Re: Pedantic Developer's Log Stardate...

Post by rdhoffmann »

This engine looks very nice and well coded, congratulations!

If you can manage to get to 2700 or so I'd love to try it out, as I'm looking for an engine stronger than mine but weaker than Spike 1.4. :)
JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Pedantic Developer's Log Stardate...

Post by JoAnnP38 »

rdhoffmann wrote: Thu Apr 27, 2023 10:03 am This engine looks very nice and well coded, congratulations!

If you can manage to get to 2700 or so I'd love to try it out, as I'm looking for an engine stronger than mine but weaker than Spike 1.4. :)
Thank you for the encouragement. It may be a while before Pedantic is at the 2700 level, but who knows.

And BTW, I like Spike a lot. It's my go to engine whenever I need to analyze a position to understand Pedantic's "blunders"! :D

I have the next 2-3 releases planned out culminating with a port to C++, but for now C# is faster for me to code in since I haven't programmed in C++ for over 20 years, and I have a lot to catch up on with all the changes to the language.
JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Pedantic Developer's Log Stardate...

Post by JoAnnP38 »

Announcement: Official release of Pedantic 0.2 is now available
I am happy to announce that the first official update to Pedantic is now available. Pedantic 0.2 is a UCI engine that I have tested in both Arena and CuteChess.This release is stronger than v0.1 by about 156 Elo which results in overall playing strength of about 2432.

This version includes the following updates:
  • Lazy Evaluation
  • Static Exchange Evaluator (SEE)
  • Mop-up evaluation
  • Better optimized pruning/reductions/extensions
  • Better optimized time controls
  • Better handling of drawn positions (still needs work)
  • Removed LiteDB and use stand-alone .json file for weights database.
If you have need of an engine with this playing strength please give it a try. As always, I would be happy to hear any experiences you have with it especially if you encounter any bugs.
Carbec
Posts: 153
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Re: Pedantic Developer's Log Stardate...

Post by Carbec »

Hi,

I am coming near the 2650-2700 area, and would like to have it as a sparring partner.
But I develop mainly with Linux. Do you have an executable ?
JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Pedantic Developer's Log Stardate...

Post by JoAnnP38 »

Carbec wrote: Sun Apr 30, 2023 6:56 pm Hi,

I am coming near the 2650-2700 area, and would like to have it as a sparring partner.
But I develop mainly with Linux. Do you have an executable ?
At 2650-2700 (vs 2432) I think you are looking for a punching bag! :D

I have not tested in Linux other than to compile an executable and just run it from the command line to make sure it didn't crash immediately. I could post an executable somewhere if you would like, but I don't want to add it to the current release. I am planning to actually test Linux during my next release.
Carbec
Posts: 153
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Re: Pedantic Developer's Log Stardate...

Post by Carbec »

Hi,
I thought I read the new release was 2700. I read too fats I think. Perhaps the next one ?