Dynamic EP flag

Code, algorithms, languages, construction...
Post Reply
thevinenator
Posts: 68
Joined: Tue Jun 02, 2015 11:02 pm
Real Name: Vince

Dynamic EP flag

Post by thevinenator » Fri Oct 02, 2015 6:49 pm

i was looking through the CPW code and found some code that is used to optimize whether or not to set the EP flag after a pawn move.

the description given follows:

/* en-passant flag
First erase the current state of the ep-flag, then set it again
in case there has been a two square pawn move that allows such
capture. For example, 1.e4 in the initial position will not set
the en passant flag, because there are no black pawns on d4 and f4.
This soluion helps with opening book and increases the number of
transposition table hits.
*/

i can see why the flag is not necessary if there isn't a pawn that can recapture, but I don't understand how the claims would help otherwise. can two positions be identical with the only difference that the EP flag is set or not? can someone explain if this is valid?
"An Engine's strength flows from the Search. But beware, pruning, extensions, reductions; the dark side of the Search are they. Once you start down the dark path, it will dominate and consume you, as it has to so many developers before.” -- Yoda

hyatt
Posts: 1242
Joined: Thu Jun 10, 2010 2:13 am
Real Name: Bob Hyatt (Robert M. Hyatt)
Location: University of Alabama at Birmingham
Contact:

Re: Dynamic EP flag

Post by hyatt » Sat Oct 03, 2015 5:30 am

You MUST include ep status in a hash position signature, you can't allow two identical positions to map to the same hash entry if one of them has a possible EP capture and the other does not. The simple solution is that any double pawn push triggers the ep flag and modifies the hash signature for one move. But most double pawn pushes don't allow EP captures, so treating a position reached by (say) e4 differently from the same position reached by e3 and then e4 would make you miss the transposition.

That's what this is about..

Post Reply