Re: Pawn hash table, a little disappointment
Posted: Mon Oct 28, 2019 10:14 pm
The code is up to date on master branch. The entry size is now 68, i'm using 2Mb pawn table, always replace, using king+pawn hash.
Pawn hash (as well as position hash) are computed on the fly in apply or applyNull and computeHash will early return if already computedRubiChess wrote: ↑Thu Oct 31, 2019 3:56 pm This line in your ::eval() seems strange:
if (!getPawnEntry(*this, computePHash(p), pePtr)) { ...
Seems that by calling computePHash(p) you recalculate the complete pawnhash from scratch?
I checked that you already do "delta-hashing" in your movepiece so recalculating should not be necessary and may cost too much time.
Another strange thing: Even in your applyNull() the ph (pawnhash?) is changed. Why that?
Code: Select all
if (p.ph != 0ull) return p.ph;
Not taking color into account in pawn hash is currently under test.xr_a_y wrote: ↑Thu Oct 31, 2019 5:24 pmPawn hash (as well as position hash) are computed on the fly in apply or applyNull and computeHash will early return if already computedRubiChess wrote: ↑Thu Oct 31, 2019 3:56 pm This line in your ::eval() seems strange:
if (!getPawnEntry(*this, computePHash(p), pePtr)) { ...
Seems that by calling computePHash(p) you recalculate the complete pawnhash from scratch?
I checked that you already do "delta-hashing" in your movepiece so recalculating should not be necessary and may cost too much time.
Another strange thing: Even in your applyNull() the ph (pawnhash?) is changed. Why that?applyNull is xoring zobrist key for color and possible ep but this is bad design (this is because eval is returning score from stm point of view).Code: Select all
if (p.ph != 0ull) return p.ph;
In a way, assuming symetric eval, this is probably loosing half of TT ...
Okay. Missed that first line in computePHash.xr_a_y wrote: ↑Thu Oct 31, 2019 5:24 pm Pawn hash (as well as position hash) are computed on the fly in apply or applyNull and computeHash will early return if already computedapplyNull is xoring zobrist key for color and possible ep but this is bad design (this is because eval is returning score from stm point of view).Code: Select all
if (p.ph != 0ull) return p.ph;
In a way, assuming symetric eval, this is probably loosing half of TT ...