Quick question about engine evaluation and the 50-move rule. I've noticed that engines like Stockfish don't seem to adjust their evaluation based on the halfmove clock, even when it's getting close to 100.
For example, in fortress positions where one side is up material but can't make progress (no pawn moves or captures possible), engines will show a significant advantage even when the halfmove clock is at 80 or 90. If I manually change the halfmove clock in the FEN, the evaluation stays the same.
Is there any engine that considers the halfmove clock in evaluation for positions with >7 pieces? (I know Syzygy has the 50MoveRule option for tablebase positions.)
Would it be difficult to implement something like "if all lines lead to halfmove clock ≥ 100 before any capture/pawn move, adjust eval toward 0.00"? Or is this just too expensive computationally?
Why don't engines consider the 50-move rule?
Moderator: Ras
-
Hamster
- Posts: 30
- Joined: Sat May 25, 2013 6:38 pm
- Location: Wien
-
chrisw
- Posts: 4662
- Joined: Tue Apr 03, 2012 4:28 pm
- Location: Midi-Pyrénées
- Full name: Christopher Whittington
Re: Why don't engines consider the 50-move rule?
A Quick Look at the Eval code will tell you. SF always used to adjust eval based on the half move clock, as you describe. It’s a very cheap computation. Maybe they took it out based on Elo results?Hamster wrote: ↑Mon Nov 03, 2025 10:38 am Quick question about engine evaluation and the 50-move rule. I've noticed that engines like Stockfish don't seem to adjust their evaluation based on the halfmove clock, even when it's getting close to 100.
For example, in fortress positions where one side is up material but can't make progress (no pawn moves or captures possible), engines will show a significant advantage even when the halfmove clock is at 80 or 90. If I manually change the halfmove clock in the FEN, the evaluation stays the same.
Is there any engine that considers the halfmove clock in evaluation for positions with >7 pieces? (I know Syzygy has the 50MoveRule option for tablebase positions.)
Would it be difficult to implement something like "if all lines lead to halfmove clock ≥ 100 before any capture/pawn move, adjust eval toward 0.00"? Or is this just too expensive computationally?
-
Hamster
- Posts: 30
- Joined: Sat May 25, 2013 6:38 pm
- Location: Wien
Re: Why don't engines consider the 50-move rule?
Did not know that. Which version of SF are you looking at?
-
towforce
- Posts: 12602
- Joined: Thu Mar 09, 2006 12:57 am
- Location: Birmingham UK
- Full name: Graham Laight
Re: Why don't engines consider the 50-move rule?
In a hand-coded eval, you'd obviously add things like this.
When the eval comes from a net, it it normal to still adjust it for things like this that the net wouldn't take into consideration?
When the eval comes from a net, it it normal to still adjust it for things like this that the net wouldn't take into consideration?
Human chess is partly about tactics and strategy, but mostly about memory
-
chrisw
- Posts: 4662
- Joined: Tue Apr 03, 2012 4:28 pm
- Location: Midi-Pyrénées
- Full name: Christopher Whittington
Re: Why don't engines consider the 50-move rule?
I stopped looking at SF a few years ago, but if you go back to the last HCE version (11?) you’ll find the code in eval. I forget what the variable was named, but search on either 50 or 100 or half move or something similar in eval.c and you should find it. Once you determined their naming for the 50move variable it should be easy enough to see if anything changed in later NNUE versions. If they killed it off it will be because Elo testing.
-
hgm
- Posts: 28403
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Why don't engines consider the 50-move rule?
My experience was that making engines aware of 50-move draws would just cost Elo. Their normal play tries to make progress, and if they cannot, but their evaluation tells them they are ahead (which then obviously is a misevaluation), running into the 50-move barrier makes them play silly sacrifices just to avoid the draw, after which they often lose.
-
Ras
- Posts: 2707
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: Why don't engines consider the 50-move rule?
In my engine, I flatten the eval after 40 'no action' plies. Linearly down to a nominal target of 10% at 100 plies. The idea is both to encourage the engine to play quiet moves when at a disadvantage, and avoid slamming into the 50 moves wall and playing some dumb reset move when at an advantage. It's not really an Elo question, more of style.
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
syzygy
- Posts: 5788
- Joined: Tue Feb 28, 2012 11:56 pm
Re: Why don't engines consider the 50-move rule?
Stockfish does:
https://github.com/official-stockfish/S ... pp#L83-L84
Code: Select all
// Damp down the evaluation linearly when shuffling
v -= v * pos.rule50_count() / 212;-
Uri Blass
- Posts: 10923
- Joined: Thu Mar 09, 2006 12:37 am
- Location: Tel-Aviv Israel
Re: Why don't engines consider the 50-move rule?
This line also can explain:syzygy wrote: ↑Wed Nov 05, 2025 2:19 amStockfish does:
https://github.com/official-stockfish/S ... pp#L83-L84Code: Select all
// Damp down the evaluation linearly when shuffling v -= v * pos.rule50_count() / 212;
"engines will show a significant advantage even when the halfmove clock is at 80 or 90."
v-=v*90/212 is still more than 0.5v and is not close to 0.
-
hgm
- Posts: 28403
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Why don't engines consider the 50-move rule?
In Joker I make it switch to an evaluation that awards Pawn pushing more after 50 reversible plies. So it has 25 moves for trying to gain or trade some material, and then 25 moves for trying to advance his Pawns. If neither is found to be possible, it should better accept that the game is a draw, so I don't 'blackmail' it with a zero score after 50 moves into making a stupid sacrifice in a position that offers no real prospects. The fact that it could not make any progress in 50 moves is a more reliable indication of its 'advantage' than any heuristic evaluation, which could be far off.Ras wrote: ↑Mon Nov 03, 2025 11:35 pm In my engine, I flatten the eval after 40 'no action' plies. Linearly down to a nominal target of 10% at 100 plies. The idea is both to encourage the engine to play quiet moves when at a disadvantage, and avoid slamming into the 50 moves wall and playing some dumb reset move when at an advantage. It's not really an Elo question, more of style.