patricia devlog

Discussion of chess software programming and technical issues.

Moderator: Ras

Whiskers
Posts: 234
Joined: Tue Jan 31, 2023 4:34 pm
Full name: Adam Kulju

Re: patricia devlog

Post by Whiskers »

Patricia was ready for release but Pohl tested an oddly lower EAS score than what I was getting in testing.
I've been getting 475,000 locally, but he only got 340,000 EAS. I've tried a variety of different engines and time controls and can't replicate his results, I'm wondering if it might be the opening book now.
User avatar
Rebel
Posts: 7279
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: patricia devlog

Post by Rebel »

Whiskers wrote: Thu Nov 28, 2024 3:53 am Patricia was ready for release but Pohl tested an oddly lower EAS score than what I was getting in testing.
I've been getting 475,000 locally, but he only got 340,000 EAS. I've tried a variety of different engines and time controls and can't replicate his results, I'm wondering if it might be the opening book now.
EAS cost elo :D

Or the other way around, increasing elo will lower EAS.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
pohl4711
Posts: 2645
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: patricia devlog

Post by pohl4711 »

Exactly. Example: Each won (non-sac) game in the endgame (which old Patricia 3.1 could not win) lowers the percents of the won sac-games, because it is a win without a sac. This lowers EAS-score, of course, because all scoring is done with these percent-values.
Whiskers
Posts: 234
Joined: Tue Jan 31, 2023 4:34 pm
Full name: Adam Kulju

Re: patricia devlog

Post by Whiskers »

Patricia 4 is out: https://github.com/Adam-Kulju/Patricia/releases/tag/4

I'm going to spend the next couple months trying to get Patricia to sacrifice more in games played from unbalanced books.
Whiskers
Posts: 234
Joined: Tue Jan 31, 2023 4:34 pm
Full name: Adam Kulju

Re: patricia devlog

Post by Whiskers »

An update because I've been slacking:
I've been quite busy, however I hammered out all the bugs remaining in Patricia.
There was an SMP bug where she would sometimes time out near the end of a game. Also a bug with the skill level setting where if both Skill_Level and UCI_Elo were set (as some GUIs did), Patricia would take the stronger of the two skill levels, often resulting in her playing at full strength no matter what you set one parameter to. She also doesn't print a ton of best lines anymore when playing with reduced skill.

Patricia now supports FRC/Chess960! This is added partly at the request of users and partly because I want to use FRC data in Patricia datagen to see if it works better.

If all these are worthy of a release please let me know, imo the answer is not yet however I could release 4.1 if there is demand for it.
Whiskers
Posts: 234
Joined: Tue Jan 31, 2023 4:34 pm
Full name: Adam Kulju

Re: patricia devlog

Post by Whiskers »

Now for the interesting part.

I'm starting dual net experiments, where Patricia uses two different full-sized networks for evaluation. One network that sacrifices a lot for the middle game, one solid strong network for the endgame. The short-term rationale is that it's hard to sacrifice and in the endgame, so we might as well just make the engine as strong as possible and it shouldn't hurt the EAS much. Patricia can swap between the networks quickly enough that the increase in quality of play is more than worth the speed hit, 25 elo in testing (though I still have to check EAS)

Additional (and more long term) experiments:
Training the middlegame net on only middlegame positions, and the endgame net on only endgame positions. Could increase strength though I'm worried about the lack of tapering this would create.

A triple net architecture, dividing the middlegame net into a somewhat aggressive net whos goal is to get Patricia in position to sacrifice, and then a small extremely sacrificial net to handle the actual attacks themselves. The small net would only come into play when a sacrifice is actively being searched and would only be trained on filtered data to ensure that it is as crazy as possible.

I really need to try and figure out some way to get Patricia to understand long-term winning chances. Too often I see her sacrifice and sacrifice and sacrifice and wind up in a dead draw, or trade much too early because she's too optimistic about the endgame. Maybe the endgame net would help in that regard, but my material scaling really isn't enough to get Patricia to avoid quiet positions.

I wonder if there's any possibility of using a solid net if Patricia is doing slightly worse or has no real winning chances to improve her Elo and maybe claw back to the possibility of sacrificing. The solid net itself isn't going to win by sacrificing, but the sacrificial net isn't going to do anything if Patricia's trying to defend an unbalanced opening as Black, and the solid net gives Patricia a better chance of equalizing to the point where she can start working her magic.
Whiskers
Posts: 234
Joined: Tue Jan 31, 2023 4:34 pm
Full name: Adam Kulju

Re: patricia devlog

Post by Whiskers »

I went on Talkchess to post this update and I saw Pohl's thread on Cerberus, which has a very similar idea lol. Using Patricia for sacrifices and Velvet for solid endgame play is pretty similar to what I'm doing - I had no idea about it until twenty minutes ago!
Whiskers
Posts: 234
Joined: Tue Jan 31, 2023 4:34 pm
Full name: Adam Kulju

Re: patricia devlog

Post by Whiskers »

Good progress - have reached just under 500k EAS with the same strength as Patricia 4. Patricia now has three networks and I’m going to test more because why not? It’ll be fun to have an infinity gauntlet of nets :mrgreen:
User avatar
Rebel
Posts: 7279
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: patricia devlog

Post by Rebel »

pohl4711 wrote: Fri Nov 29, 2024 7:47 am Exactly. Example: Each won (non-sac) game in the endgame (which old Patricia 3.1 could not win) lowers the percents of the won sac-games, because it is a win without a sac. This lowers EAS-score, of course, because all scoring is done with these percent-values.
Fun with EAS, if you pit 2 EAS engines against each other.

Code: Select all

                                 bad  avg.win 
Rank  EAS-Score  sacs   shorts  draws  moves  Engine/player 
-------------------------------------------------------------------
   1    110906  15.24%  13.33%  13.26%   72   Patricia-3.01  
   2     66328  03.49%  22.68%  26.43%   66   REBEL-EXTREME  
Both killing each other fighting for EAS points, Patricia wins.

As for the match score -

Code: Select all

No. Name           Win Draw Loss Unf.  Score Games       %
----------------------------------------------------------
  1 REBEL-EXTREME +1803 =1139 -105   *0 2372.5  3047   77.9%
  2 Patricia-3.01  +105 =1139 -1803  *0  674.5  3047   22.1%

Total Games:    3047
White Wins:     1117 (36.7%)
Black Wins:      791 (26.0%)
Draws:          1139 (37.4%)
World upside down.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
pohl4711
Posts: 2645
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: patricia devlog

Post by pohl4711 »

Whiskers wrote: Mon Dec 30, 2024 6:40 am I went on Talkchess to post this update and I saw Pohl's thread on Cerberus, which has a very similar idea lol. Using Patricia for sacrifices and Velvet for solid endgame play is pretty similar to what I'm doing - I had no idea about it until twenty minutes ago!
https://www.sp-cc.de/cerberus-project.htm

And playing the (later) middlegame with Velvet risky. Mention, Velvet risky has a very high EAS score, too. So, there is a decreasing aggressiveness from start to finish of any game:

I used the Eman Chimera program by Khalid Omar, to make one engine out of these. Which engine/net is used, depends on the number of pieces on the board:
Pieces / EAS-scores (EAS taken from my full UHO-Ratinglist):
32-22: Patricia 4.0 (opening/early middlegame). EAS=340432
21-13: Velvet 8.1.1 risky (middlegame/early endgame). EAS=221083
12-02: Velvet 8.1.1 normal (endgame) EAS=121106

Code: Select all

                                 bad  avg.win 
Rank  EAS-Score  sacs   shorts  draws  moves  Engine/player 
-------------------------------------------------------------------
   1    429481  51.61%  38.03%  05.49%   66   Patricia 3.1 avx2  
   2    337432  46.96%  29.39%  03.46%   70   Patricia 4.0 avx2  
   3    312346  43.56%  27.63%  04.21%   68   Cerberus 21124081r81  
   4    250682  37.88%  23.88%  08.79%   75   Rebel Extreme avx2  
   5    218083  32.46%  23.04%  09.25%   71   Velvet 8.1.0 risky