King Hunt PST's

Discussion of chess software programming and technical issues.

Moderator: Ras

Mike Sherwin
Posts: 965
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

King Hunt PST's

Post by Mike Sherwin »

Here is a partially filled in khPST for the bishop.

Code: Select all

s32 bkhtbl[225] = {
   12,   ,   ,   ,   ,   ,   ,  0,   ,   ,   ,   ,   ,   , 12,
     , 16,   ,   ,   ,   ,   ,  4,   ,   ,   ,   ,   , 16,   ,
     ,   , 20,   ,   ,   ,   , 10,   ,   ,   ,   , 20,   ,   ,
     ,   ,   , 24,   ,   ,   , 16,   ,   ,   , 24,   ,   ,   ,
     ,   ,   ,   , 28,   ,   , 22,   ,   , 28,   ,   ,   ,   ,
     ,   ,   ,   ,   , 32,   , 28,   , 32,   ,   ,   ,   ,   ,
     ,   ,   ,   ,   ,   , 36, 34, 36,   ,   ,   ,   ,   ,   ,
    0,  4, 10, 16, 22, 28, 34, 40, 34, 28, 22, 16, 10,  4,  0,
     ,   ,   ,   ,   ,   , 36, 34, 36,   ,   ,   ,   ,   ,   ,
     ,   ,   ,   ,   , 32,   , 28,   , 32,   ,   ,   ,   ,   ,
     ,   ,   ,   , 28,   ,   , 22,   ,   , 28,   ,   ,   ,   ,
     ,   ,   , 24,   ,   ,   , 16,   ,   ,   , 24,   ,   ,   ,
     ,   , 20,   ,   ,   ,   , 10,   ,   ,   ,   , 20,   ,   ,
     , 16,   ,   ,   ,   ,   ,  4,   ,   ,   ,   ,   , 16,   ,
   12,   ,   ,   ,   ,   ,   ,  0,   ,   ,   ,   ,   ,   , 12,
};
I have no idea if this is even a good beginning. Maybe a Texel Tuning can give good values?

The way it works is no matter where the enemy king is it is mapped to the "40" in the center making the 8x8 chess board float around the "40". Then before the search the relevant king hunter values are loaded into a regular 8x8 pst. I wonder how well an engine would do with these kinds of PSTs?
User avatar
hgm
Posts: 28401
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: King Hunt PST's

Post by hgm »

Why would it be good for a Bishop to be on the same orthogonal as the enemy King?

The disadvantage of this type of static adaptation of the evaluation to the root position is that in deep searches (and most strong engines nowadays do very deep searches) the incorporated aspects become obsolete, and counter-productive. I think this is why most engines now use a dynamic King Safety term, which is recalculated in every position depending on the actual number of attackers on the King neighborhood.

PST-like evaluation also has the disadvantage that it is blind to blocking; it would still award a Bishop on b2 to 'hunt' a King on h8 when the center is crowded with interlocked Pawn chains. If you want to tweek evaluation to the root position it should not be too difficult to take account of that.

More sensible than basing the evaluation only on the root would be to redo it deeper in the tree, but not so deep that it starts to consume too much time. E.g. whenever the remaining search depth is 4 or 5 ply, you could prepare a new set of PST for use in that sub-tree.
Luecx
Posts: 138
Joined: Thu Jun 18, 2020 9:20 pm
Full name: Finn Eggers

Re: King Hunt PST's

Post by Luecx »

Mike Sherwin wrote: Wed Nov 03, 2021 11:25 pm Here is a partially filled in khPST for the bishop.

Code: Select all

s32 bkhtbl[225] = {
   12,   ,   ,   ,   ,   ,   ,  0,   ,   ,   ,   ,   ,   , 12,
     , 16,   ,   ,   ,   ,   ,  4,   ,   ,   ,   ,   , 16,   ,
     ,   , 20,   ,   ,   ,   , 10,   ,   ,   ,   , 20,   ,   ,
     ,   ,   , 24,   ,   ,   , 16,   ,   ,   , 24,   ,   ,   ,
     ,   ,   ,   , 28,   ,   , 22,   ,   , 28,   ,   ,   ,   ,
     ,   ,   ,   ,   , 32,   , 28,   , 32,   ,   ,   ,   ,   ,
     ,   ,   ,   ,   ,   , 36, 34, 36,   ,   ,   ,   ,   ,   ,
    0,  4, 10, 16, 22, 28, 34, 40, 34, 28, 22, 16, 10,  4,  0,
     ,   ,   ,   ,   ,   , 36, 34, 36,   ,   ,   ,   ,   ,   ,
     ,   ,   ,   ,   , 32,   , 28,   , 32,   ,   ,   ,   ,   ,
     ,   ,   ,   , 28,   ,   , 22,   ,   , 28,   ,   ,   ,   ,
     ,   ,   , 24,   ,   ,   , 16,   ,   ,   , 24,   ,   ,   ,
     ,   , 20,   ,   ,   ,   , 10,   ,   ,   ,   , 20,   ,   ,
     , 16,   ,   ,   ,   ,   ,  4,   ,   ,   ,   ,   , 16,   ,
   12,   ,   ,   ,   ,   ,   ,  0,   ,   ,   ,   ,   ,   , 12,
};
I have no idea if this is even a good beginning. Maybe a Texel Tuning can give good values?

The way it works is no matter where the enemy king is it is mapped to the "40" in the center making the 8x8 chess board float around the "40". Then before the search the relevant king hunter values are loaded into a regular 8x8 pst. I wonder how well an engine would do with these kinds of PSTs?
Koivisto had those piece square tables before using neural networks. We also texel tuned them not just for our own king but also the opponents king. We also did this for knights, queens and rooks. It gained about 20 elo if I remember correctly. Latest Koivisto version should be 5.70 or something like that. Feel free to check it oyt
The ability to speak does not make you intelligent. https://github.com/Luecx/Koivisto

Image
connor_mcmonigle
Posts: 544
Joined: Sun Sep 06, 2020 4:40 am
Full name: Connor McMonigle

Re: King Hunt PST's

Post by connor_mcmonigle »

hgm wrote: Thu Nov 04, 2021 9:40 am Why would it be good for a Bishop to be on the same orthogonal as the enemy King?

The disadvantage of this type of static adaptation of the evaluation to the root position is that in deep searches (and most strong engines nowadays do very deep searches) the incorporated aspects become obsolete, and counter-productive. I think this is why most engines now use a dynamic King Safety term, which is recalculated in every position depending on the actual number of attackers on the King neighborhood.

PST-like evaluation also has the disadvantage that it is blind to blocking; it would still award a Bishop on b2 to 'hunt' a King on h8 when the center is crowded with interlocked Pawn chains. If you want to tweek evaluation to the root position it should not be too difficult to take account of that.

More sensible than basing the evaluation only on the root would be to redo it deeper in the tree, but not so deep that it starts to consume too much time. E.g. whenever the remaining search depth is 4 or 5 ply, you could prepare a new set of PST for use in that sub-tree.
I agree that just using this "king-relative" psqt with the root's king position would almost certainly fail. However, king moves are rare in the search tree so computing the "king-relative" psqt incrementally is feasible as one must only recompute everything when the king moves.