When does a chess engine blow up?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

benstoker
Posts: 342
Joined: Tue Jan 19, 2010 2:05 am

When does a chess engine blow up?

Post by benstoker »

If you left a chess engine - stockfish for example - running for an entire week analyzing a single position, let's say the start position, a) does is blow up?; b) does it reach a maximum ply and stop?; c) does the search become pointless after a certain amount of time?; d) would a 7 day search be better than a 1 hour search?; e) does anybody do this?

Could you even let an engine search a single position for a month, a year?
Dann Corbit
Posts: 12541
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: When does a chess engine blow up?

Post by Dann Corbit »

benstoker wrote:If you left a chess engine - stockfish for example - running for an entire week analyzing a single position, let's say the start position, a) does is blow up?;
>>
I've seen it happen.
<<
b) does it reach a maximum ply and stop?;
>>
Sometimes within one second (e.g. a tablebase hit).
<<
c) does the search become pointless after a certain amount of time?;
>>
If it already found the right answer, from that point forward additional search has little value.
<<
d) would a 7 day search be better than a 1 hour search?;
>>
Yes, unless it is worse.
<<
e) does anybody do this?
>>
I have run many thousands of searches, anywhere from one second to one week in duration.
<<
Could you even let an engine search a single position for a month, a year?
Sure, why not.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: When does a chess engine blow up?

Post by Michael Sherwin »

A well designed engine that has arrays long enough can search for 10's of billions of years (given immortal hardware and a young star to power it) with out crashing. I would imagine that if TSCP were able to search 100 ply deep with out crashing that it would take at least that long to finish.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: When does a chess engine blow up?

Post by bob »

benstoker wrote:If you left a chess engine - stockfish for example - running for an entire week analyzing a single position, let's say the start position, a) does is blow up?; b) does it reach a maximum ply and stop?; c) does the search become pointless after a certain amount of time?; d) would a 7 day search be better than a 1 hour search?; e) does anybody do this?

Could you even let an engine search a single position for a month, a year?[/quote

Crafty has always had a max depth. Once it completes 60 plies, it will stop the search no matter what time control is being used, because going deeper would begin to run into array bound conditions. Inside the search, no single branch can go beyond 64 plies since that is an absolute limit, again imposed by array bounds, and this is checked at the top of any search call.

Good code _never_ crashes or hangs.
benstoker
Posts: 342
Joined: Tue Jan 19, 2010 2:05 am

Re: When does a chess engine blow up?

Post by benstoker »

bob wrote:
benstoker wrote:If you left a chess engine - stockfish for example - running for an entire week analyzing a single position, let's say the start position, a) does is blow up?; b) does it reach a maximum ply and stop?; c) does the search become pointless after a certain amount of time?; d) would a 7 day search be better than a 1 hour search?; e) does anybody do this?

Could you even let an engine search a single position for a month, a year?[/quote

Crafty has always had a max depth. Once it completes 60 plies, it will stop the search no matter what time control is being used, because going deeper would begin to run into array bound conditions. Inside the search, no single branch can go beyond 64 plies since that is an absolute limit, again imposed by array bounds, and this is checked at the top of any search call.

Good code _never_ crashes or hangs.
Begs the question: so how long do you estimate it would take crafty to crunch 60 ply from the start position on your super duper computer?
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: When does a chess engine blow up?

Post by mcostalba »

benstoker wrote:
bob wrote:
benstoker wrote:If you left a chess engine - stockfish for example - running for an entire week analyzing a single position, let's say the start position, a) does is blow up?; b) does it reach a maximum ply and stop?; c) does the search become pointless after a certain amount of time?; d) would a 7 day search be better than a 1 hour search?; e) does anybody do this?

Could you even let an engine search a single position for a month, a year?[/quote

Crafty has always had a max depth. Once it completes 60 plies, it will stop the search no matter what time control is being used, because going deeper would begin to run into array bound conditions. Inside the search, no single branch can go beyond 64 plies since that is an absolute limit, again imposed by array bounds, and this is checked at the top of any search call.

Good code _never_ crashes or hangs.
Begs the question: so how long do you estimate it would take crafty to crunch 60 ply from the start position on your super duper computer?
From start position it will take forever, not only Crafty but any engine...

You can reach big depths only in very simple positions with few pieces, typically endgame positions.
User avatar
Roman Hartmann
Posts: 295
Joined: Wed Mar 08, 2006 8:29 pm

Re: When does a chess engine blow up?

Post by Roman Hartmann »

It also depends on some rather trivial stuff like how you implement the 'search forever'-part.
Some engines will just add a huge number to the current time and stop the search if that time is reached. depending on how big that number is, the search might terminate after a few hours/days already.

Some of my old versions behave like that, they just stop after a few hours of search ...

best regards
Roman
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: When does a chess engine blow up?

Post by jwes »

benstoker wrote:
bob wrote:
benstoker wrote:If you left a chess engine - stockfish for example - running for an entire week analyzing a single position, let's say the start position, a) does is blow up?; b) does it reach a maximum ply and stop?; c) does the search become pointless after a certain amount of time?; d) would a 7 day search be better than a 1 hour search?; e) does anybody do this?

Could you even let an engine search a single position for a month, a year?[/quote

Crafty has always had a max depth. Once it completes 60 plies, it will stop the search no matter what time control is being used, because going deeper would begin to run into array bound conditions. Inside the search, no single branch can go beyond 64 plies since that is an absolute limit, again imposed by array bounds, and this is checked at the top of any search call.

Good code _never_ crashes or hangs.
Begs the question: so how long do you estimate it would take crafty to crunch 60 ply from the start position on your super duper computer?
A fast machine might get to ply 16 in 1 second. Assuming that each ply takes twice as long as the previous ply, 60 ply would take 2^44 seconds or about 524,000 years. It would likely take much longer because when the hash table is way overfilled move ordering suffers badly.
benstoker
Posts: 342
Joined: Tue Jan 19, 2010 2:05 am

Re: When does a chess engine blow up?

Post by benstoker »

jwes wrote:
benstoker wrote:
bob wrote:
benstoker wrote:If you left a chess engine - stockfish for example - running for an entire week analyzing a single position, let's say the start position, a) does is blow up?; b) does it reach a maximum ply and stop?; c) does the search become pointless after a certain amount of time?; d) would a 7 day search be better than a 1 hour search?; e) does anybody do this?

Could you even let an engine search a single position for a month, a year?[/quote

Crafty has always had a max depth. Once it completes 60 plies, it will stop the search no matter what time control is being used, because going deeper would begin to run into array bound conditions. Inside the search, no single branch can go beyond 64 plies since that is an absolute limit, again imposed by array bounds, and this is checked at the top of any search call.

Good code _never_ crashes or hangs.
Begs the question: so how long do you estimate it would take crafty to crunch 60 ply from the start position on your super duper computer?
A fast machine might get to ply 16 in 1 second. Assuming that each ply takes twice as long as the previous ply, 60 ply would take 2^44 seconds or about 524,000 years. It would likely take much longer because when the hash table is way overfilled move ordering suffers badly.
It appears that one would then get the "best" pv out of any given engine on good hardware after about a day of crunching. After that, it's a waste of time. Is that about right?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: When does a chess engine blow up?

Post by bob »

benstoker wrote:
bob wrote:
benstoker wrote:If you left a chess engine - stockfish for example - running for an entire week analyzing a single position, let's say the start position, a) does is blow up?; b) does it reach a maximum ply and stop?; c) does the search become pointless after a certain amount of time?; d) would a 7 day search be better than a 1 hour search?; e) does anybody do this?

Could you even let an engine search a single position for a month, a year?[/quote

Crafty has always had a max depth. Once it completes 60 plies, it will stop the search no matter what time control is being used, because going deeper would begin to run into array bound conditions. Inside the search, no single branch can go beyond 64 plies since that is an absolute limit, again imposed by array bounds, and this is checked at the top of any search call.

Good code _never_ crashes or hangs.
Begs the question: so how long do you estimate it would take crafty to crunch 60 ply from the start position on your super duper computer?
If you assume depth=20 is one second, to get to 60 with an effective branching factor of 2 would take 2^40 seconds. Which is 1 trillion seconds or about 35,000 years. Probably won't happen. :)