Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pawn structure & harmonious play #3

Open
tissatussa opened this issue Sep 10, 2021 · 4 comments
Open

pawn structure & harmonious play #3

tissatussa opened this issue Sep 10, 2021 · 4 comments

Comments

@tissatussa
Copy link

tissatussa commented Sep 10, 2021

recently i let MinimalChess 0.6.1 play a game in CuteChess with Black, time format 7 minutes each .. in this rather standard opening position White just did Be3 and MinimalChess has to defend its Bishop on c5 :

.. and MinimalChess played d6 !? Indeed, this seems a good continuation .. i let several other (strong) engines think about this position and it seems 3 moves are best : d6 or Bb6 to cover the Bishop, or Bxe3 to exchange .. here, the move d6 gives Black doubled pawns on the c-file, but also a half-open d-file .. this may have advantages, but this pawn structure needs some insight ..

now White played Bb5, attacking Blacks Nc6 which is the defender of pawn e5, which is attacked by Whites Nf3 :

so, MinimalChess decided to play Re8, and White captured the Nc6, leaving Black with a tripled (!?) pawn on the c-line, which is bad in general .. btw. Black also has an open b-line .. i let several engines play this position and most of them find Nd4 best move, not Re8 .. so, now Black might loose pawn e5, but the Black pawn structure is more sane ..

how does MinimalChess handle pawn structures? Why does it allow a tripled pawn? Is it only counting material? I guess not .. does it know about any "harmonious connection" of the pieces ?

MinimalChess does not have MPV .. that's OK, although i like MPV very much .. it shows how the eval of some (hidden good) moves is changing with increasing depth .. i guess such process will also exist inside the (MinimalChess) evaluation algorithm, but obviously for each depth it does not manage some top-N list .. eg. Xiphos (latest v0.6) is a rather old engine, no longer updated, it's is very strong but has no MPV ..

here comes my point : in my first position 3 moves are best (Bb6 / Bxe3 / d6), other moves are clearly much weaker .. i can imagine a mechanism which detects this top-3 and chooses the move which is "most harmonious", not being d6 ! Same for position 2.

can you elaborate on this ? -- i know this can be hard..

[ our best reference for years is the StockFish engine - i find it has a great understanding of harmony : the pieces are moved very logically, not caring about a pawn or 2.. ]

@lithander
Copy link
Owner

Thanks for filing this very detailed issue! The analysis of an experienced chess player is always insightful for me and much appreciated.

how does MinimalChess handle pawn structures? Why does it allow a tripled pawn? Is it only counting material? I guess not .. does it know about any "harmonious connection" of the pieces ?

MinimalChess uses Piece-Square-Tables as the foundation of its evaluation which means that it knows which squares are statistically good for certain piece types to stand on. But these values are static and do not change based on what else is going on in this position. Based on the PSTs what MMC thinks here is "When the white bishop captures Nc6 I can recapture with a pawn. The trade is fine material wise and the PSTs say that the new square the pawn would be on isn't any worse than the old one". And it's true. It's not generally a bad square for a pawn to stand on. It's just bad in this particular position because doubled pawns and even trippled pawns have a disadvantage. It would have to be aware that there are other pawns already on that file and that it is not great if that happens.

But MinimalChess' evaluation is too simple for that. What I would have to do to address this blindness is to look for specific properties in the position and assign a bonus and malus. For example -25 centipawns for a file with 2 pawns, -75 centipawns for a file with 3 pawns. Something like that. It would discourage MinimalChess from picking that position.

In handcrafted evaluations the programmers often assign dozens of small bonuses and maluses to teach their engines to better know the difference between a good and a bad position. MinimalChess is more... minimal... in that regard. ;)

If the evaluation doesn't know how to tell a good pawn structure from a bad one the engines only hope is to search deep enough to see how the bad pawnstructure turns into a weakness it can detect. But often the bad pawnstructure is nothing the opponent can immediately exploit. The regret comes only many moves later and MMC doesn't forsee that at the time it made the unfortunate decision.

I hope I could explain it properly?

What I would have to do to fix that is to add some handcrafted terms to the evaluation.

@tissatussa
Copy link
Author

I hope I could explain it properly?

What I would have to do to fix that is to add some handcrafted terms to the evaluation.

you did explain very well .. most of it i agree, most of it i already knew (in general, being a programmer and tester of engines, although i never created an engine myself).

once i found this phrase :
simple is not always best, but best is always simple

for years i use this text line as my email footer .. it's true, and simpleness is not "leaving some things out" but its origin is a vision which results in a concept with few parts .. with this approach a creator will be able to do 80% of what is needed, but it's most efficient.

i'm a chess fanatic and club player with rating about 1850 .. but i can beat 2000+ players because they do moves i expect !
i'm also an artist, mostly video now, you'll find many creations on my channel https://www.bitchute.com/channel/roelofb/ - a title will contain 'chess'.

i understand your idea to add some handcrafted terms for evaluation .. does an engine exist which have "pawn structure PSTs"? The pawn movement / structure eval could be seperated from the pieces. I know many eval techniques exist, many copied from others but i also find rare unique concepts -- when reading the readme's and viewing UCI options, eg. some engines use some "pawn hash" .. do you know what that is ?

@tissatussa
Copy link
Author

i want to add this to our "minimalistic contemplation" : i can imagine what happens when the algorithm reaches higher depth .. some pruning must always be done .. some engines quickly reach a high depth, while others are "slower" in calculation .. and i also know MCTS (eg. Komodo) gives a slow depth increase .. but the definition of "depth" is not the same for all engines .. and good pruning is more important then rapidly increasing depth .. the engine might have skipped some critical (hidden but best) continuation .. so, when examining a current position and giving a value to it, could be done by some extra "handcrafted rules", but only at a few depth ?!

For me the famous 5 Kb javascript chess engine from the well-known (?) old-school 5k.org contest, which is now continued by https://www.chessprogramming.org/P4wn , was a miracle : it plays very fast and good moves .. the creator must have been genius to create a bunch of rules-of-thumb !

@amanjpro
Copy link

i understand your idea to add some handcrafted terms for evaluation .. does an engine exist which have "pawn structure PSTs"? The pawn movement / structure eval could be seperated from the pieces. I know many eval techniques exist, many copied from others but i also find rare unique concepts -- when reading the readme's and viewing UCI options, eg. some engines use some "pawn hash" .. do you know what that is ?

A pawnhash is nothing more than a hashtable, to not evaluate the same pawn structure more than once... many engines have very elaborate pawnstrcutres, and most engines have their very own evaluation functions... some engines have evaluation function that depend greatly on king position (Nalwald is one of them), some of them is more general than that (my engine is an example here), and both have non-borrowed/non-copied evaluation terms... of course they both implement chess theory ideas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants