Pawn-contextual piece square tables

Discussion of chess software programming and technical issues.

Moderator: Ras

dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Pawn-contextual piece square tables

Post by dangi12012 »

There are 443702487 pawn structures (per side)
https://www.talkchess.com/forum3/viewto ... 20#p928617

Entries could be for all other piece types = 5 per square = 64-[8..0] lets call it 60 on average with 2 bytes per lookup.
443702487*5*60*2 / (1024*1024*1024) ==> fits in 256GB of lookups

So either you just bite into 256gb of memory (will be trivial in a few years) or you limit around vacinity of the piece in question (maybe a grid around the piece) per piecetype per square with all pawn 0..8 pawn permutations that are legal inside that vacinity.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
User avatar
j.t.
Posts: 263
Joined: Wed Jun 16, 2021 2:08 am
Location: Berlin
Full name: Jost Triller

Re: Pawn-contextual piece square tables

Post by j.t. »

dangi12012 wrote: Sat Jun 10, 2023 9:10 pm So either you just bite into 256gb of memory (will be trivial in a few years) or you limit around vacinity of the piece in question (maybe a grid around the piece) per piecetype per square with all pawn 0..8 pawn permutations that are legal inside that vacinity.
That is what I've done in Nalwald 15: look at each (sensible) square and the 3×3 area around it. Then for each square in that area you have three possibilities: no pawn, enemy pawn, our pawn. That makes 3^9 = ~20,000 parameters or ~80,000 in Nalwald 17, as I differentiated depending on the rank. Worked well (perhaps 10-20 Elo), despite a heavy performance penalty (though I am not using a pawn hash, and my implementation is probably not ideal). And I could remove basically all other pawn related eval parameters (except passed pawns).