TerjeKir / weiss

Weiss - a UCI chess engine
GNU General Public License v3.0
103 stars 18 forks source link

dynamic piece square tables ? #498

Closed tissatussa closed 1 year ago

tissatussa commented 3 years ago

i'm not a chess engine programmer myself, but i'm a chess fanatic and a web developer / programmer .. i do no C / C++ but mostly PHP and Python (and only Linux) .. i also gather chess engines and test them with CuteChess by letting them play against eachother and watch the game :-) In the meantime i learned many things about chess engine programming (in general) and i gave extended feedback to some engine creators, like Wasp, Halogen, RofChade, DON and more ..

i think your Weiss engine is rather special : it's strong, it has no NN(UE), it reaches high depth rather quickly and is only 108 Kb !

one of the main "ingredients" of a chess engine are the "piece square tables" .. i found in general those appear in 2 types : for the middle game and for the end game .. in your file psqt.c i see only 1 table (am i right?) .. i wonder : could it be possible & good to have different piece square tables, even dynamically ? I mean, according to the position some "rules" might be applied to determine a unique piece square table !? Those rules may act as some kind of pre-processor for the position ..

NOTE: you might take a look at the PeSTo engine : http://rofchade.nl/?p=307

TerjeKir commented 3 years ago

I save the midgame and endgame scores in 1 integer (idea seen in SF, Ethereal and others). A value of S( 52, 76) means 52 for midgame and 76 for endgame for example, thus the single table effectively holds 2 tables :)

Compiled on my machine and stripped of symbols it is 92 Kb :D

tissatussa commented 3 years ago

OK, but what about my idea of "dynamic" PST ? Is it realistic ?

TerjeKir commented 3 years ago

Dynamic PSQTs, specifically using different ones when kings are castled opposite has been on my radar for a while and seems like a good idea. Weiss often seems clueless how to play in opposite castling and I think differnet PSQTs for that might be a good solution. There may be other situations too, but I haven't thought of any yet.

tissatussa commented 3 years ago

some thoughts about such dynamic PSQTs :

design factors to accomplish this ..

TerjeKir commented 3 years ago

Thanks for the idea, I'll be contemplating this going forward, but it might take a while to come up with something that works.

tissatussa commented 3 years ago

Thanks .. just be open .. i know, i'm a programmer too .. other points of view might help ..

some UCI option i found, is called "dynamic contempt" (true/false) .. what is that ? could it match this issue ?

TerjeKir commented 3 years ago

Apologies, I seem to have missed the question here.

I think dynamic contempt means the engine gives all positions a bonus score when the engine thinks it is winning (or a malus when losing). Weiss does this (always on). I don't think it's related to dynamic PSQTs though.