cjbolt / EubosChess

A Java chess engine. Uses UCI protocol. Playable on lichess.
GNU General Public License v3.0
14 stars 3 forks source link

dynamic PSTs #8

Closed tissatussa closed 1 year ago

tissatussa commented 1 year ago

Regarding the new version 2.18 i read :

Uses parallel add and substract for updating PST contribution, when applying a move Reformatted PSTs to support parallel arithmetic by game phase [..]

So, is this a concept to have "dynamic PSTs" ? (a term i use myself) I never saw any engine have this feature .. until now ? Sounds interesting. Do you use a known concept or is this your own development ? Can you elaborate a bit on your ideas ? I'm curious.

cjbolt commented 1 year ago

Sadly, the change was rather less interesting than that. I store the PST value by piece as a uint32 where the lower 2bytes are the middlegame score and the upper 2 bytes are the endgame score. When a move is applied to the board, or undone, I use a multi-byte arithmetic operation (from 'Hacker's Delight') to update the PST total for the side moving, doing the arithmetic for both the middlegame and endgame at the same time.

I had experimented with linear scaling of my existing PST values, but they are const at run-time - I was tuning them between builds. I found this a boring affair due to the number of games needed to evaluate an improvement, so ended up basing the most recent on Stockfish version 14, with some approximation to bring them in line with the rest of my evaluation scores.

Thanks for your interest. Chris

tissatussa commented 1 year ago

Thanks for the info. I do not understand all you write, but in general yes, i'm somewhat familiar with the method of scaling MG and EG PST values according to the game phase, although i have no clue how relevant this is and how to improve the engine strength by this ..

..due to the number of games needed to evaluate an improvement..

do you use self-play for this and quick time controls ? Many engine programmers seem to use this method, but also here i have no clue how relevant this is - i think using longer time controls can show how good /smart pruning works at higher depths, but ofcourse this will then take a lot of time to do many games. Btw. i'm a programmer, but not of any engine yet.

cjbolt commented 1 year ago

I generally play Eubos against a comparable strength engine (recently Beowulf, Dragon 4.6 (which is quite a bit stronger)), rather than self-play (though I do that as well for interest). I run 2/+1 time control games and use the Arena GUI to run 15 tournaments simultaneously. Even then it takes about 1.5 days to get to 5000 games played. I consider 3000 games a minimum to make a decision about whether a change is beneficial or not. I'm not very scientific about that though!

BTW, regarding my first reply 'Hacker's Delight' is a book with optimised algorithms for bit manipulation - handy for chess, uint32 is embedded programmers shorthand for 'unsigned int' (my day job is as an embedded software engineer).

tissatussa commented 1 year ago

nice info, also for all other users who are interested. you may close the Issue now.