Qsearch of Stockfish 1.7.1
Moderators: hgm, Harvey Williamson, bob
Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Qsearch of Stockfish 1.7.1
There could be a bug in updating oldAlpha.
At the top of it there is oldAlpha = alpha, at the middle there is a possibility that alpha will be updated with staticValue or bestValue, if it happens then oldAlpha will now be wrong.
At the end saving of tt info. will be affected.
At the top of it there is oldAlpha = alpha, at the middle there is a possibility that alpha will be updated with staticValue or bestValue, if it happens then oldAlpha will now be wrong.
At the end saving of tt info. will be affected.
Re: Qsearch of Stockfish 1.7.1
There is no bug.
oldAlpha as the name puts it is "original alpha", this is initialized in the beginning of the qsearch and must not be changed at any point
oldAlpha as the name puts it is "original alpha", this is initialized in the beginning of the qsearch and must not be changed at any point
Joona Kiiski
Re: Qsearch of Stockfish 1.7.1
Then why there is "Value alpha" as an argument of qsearch(), and not "const Value oldAlpha"?Joona Kiiski wrote:oldAlpha as the name puts it is "original alpha", this is initialized in the beginning of the qsearch and must not be changed at any point :)
Re: Qsearch of Stockfish 1.7.1
From compiler's point of view this would definitely be better, but I don't know if it is harder to read for a human? I'll discuss about this with Marco.QED wrote:Then why there is "Value alpha" as an argument of qsearch(), and not "const Value oldAlpha"?Joona Kiiski wrote:oldAlpha as the name puts it is "original alpha", this is initialized in the beginning of the qsearch and must not be changed at any point
Joona Kiiski
Re: Qsearch of Stockfish 1.7.1
Another possibiliy would be "const Value alpha" for the argument, and "Value newAlpha" for the variable.Joona Kiiski wrote:From compiler's point of view this would definitely be better, but I don't know if it is harder to read for a human? I'll discuss about this with Marco.QED wrote:Then why there is "Value alpha" as an argument of qsearch(), and not "const Value oldAlpha"?Joona Kiiski wrote:oldAlpha as the name puts it is "original alpha", this is initialized in the beginning of the qsearch and must not be changed at any point :)
I am new to serious chess programming, so I am not sure which is more readable.
Re: Qsearch of Stockfish 1.7.1
In chess programming is a well estabilished convention to call the search functions passing as arguments: 'alpha' and 'beta'QED wrote:Another possibiliy would be "const Value alpha" for the argument, and "Value newAlpha" for the variable.Joona Kiiski wrote:From compiler's point of view this would definitely be better, but I don't know if it is harder to read for a human? I'll discuss about this with Marco.QED wrote:Then why there is "Value alpha" as an argument of qsearch(), and not "const Value oldAlpha"?Joona Kiiski wrote:oldAlpha as the name puts it is "original alpha", this is initialized in the beginning of the qsearch and must not be changed at any point
I am new to serious chess programming, so I am not sure which is more readable.
So I would not change that well understood and general convention used almost always in literature when talking about alpha-beta search.
Re: Qsearch of Stockfish 1.7.1
The thing I see under current scheme is that, ss[ply].pv[ply] can not guarantee to contain a movezamar wrote:There is no bug.
oldAlpha as the name puts it is "original alpha", this is initialized in the beginning of the qsearch and must not be changed at any point
Code: Select all
TT.store(pos.get_key(), value_to_tt(bestValue, ply), VALUE_TYPE_EXACT, d, ss[ply].pv[ply]);Re: Qsearch of Stockfish 1.7.1
So ?Ferdy wrote:The thing I see under current scheme is that, ss[ply].pv[ply] can not guarantee to contain a movezamar wrote:There is no bug.
oldAlpha as the name puts it is "original alpha", this is initialized in the beginning of the qsearch and must not be changed at any point![]()
Code: Select all
TT.store(pos.get_key(), value_to_tt(bestValue, ply), VALUE_TYPE_EXACT, d, ss[ply].pv[ply]);
-
Teemu Pudas
- Posts: 88
- Joined: Wed Mar 25, 2009 11:49 am
Re: Qsearch of Stockfish 1.7.1
It's supposed to contain a move if and only if at least one of the moves is better than standing pat.
Re: Qsearch of Stockfish 1.7.1
When we initialize a node we set (see SearchStack::init()):
pv[ply] = pv[ply + 1] = MOVE_NONE;
So if there is a move better than stand pat score it'll be saved in TT. If not we call TT.store(move=MOVE_NONE) which means that old move won't be overwritten. I can see no problem with current behaviour. Am I missing sth?
pv[ply] = pv[ply + 1] = MOVE_NONE;
So if there is a move better than stand pat score it'll be saved in TT. If not we call TT.store(move=MOVE_NONE) which means that old move won't be overwritten. I can see no problem with current behaviour. Am I missing sth?
Joona Kiiski