Skip to content

Commit ca7d4e9

Browse files
briansheppard-toastsnicolet
authored andcommitted
Eliminate ONE_PLY
Simplification that eliminates ONE_PLY, based on a suggestion in the forum that support for fractional plies has never been used, and @mcostalba's openness to the idea of eliminating it. We lose a little bit of type safety by making Depth an integer, but in return we simplify the code in search.cpp quite significantly. No functional change ------------------------------------------ The argument favoring eliminating ONE_PLY: * The term “ONE_PLY” comes up in a lot of forum posts (474 to date) https://groups.google.com/forum/?fromgroups=#!searchin/fishcooking/ONE_PLY%7Csort:relevance * There is occasionally a commit that breaks invariance of the code with respect to ONE_PLY https://groups.google.com/forum/?fromgroups=#!searchin/fishcooking/ONE_PLY%7Csort:date/fishcooking/ZIPdYj6k0fk/KdNGcPWeBgAJ * To prevent such commits, there is a Travis CI hack that doubles ONE_PLY and rechecks bench * Sustaining ONE_PLY has, alas, not resulted in any improvements to the engine, despite many individuals testing many experiments over 5 years. The strongest argument in favor of preserving ONE_PLY comes from @locutus: “If we use par example ONE_PLY=256 the parameter space is increases by the factor 256. So it seems very unlikely that the optimal setting is in the subspace of ONE_PLY=1.” There is a strong theoretical impediment to fractional depth systems: the transposition table uses depth to determine when a stored result is good enough to supply an answer for a current search. If you have fractional depths, then different pathways to the position can be at fractionally different depths. In the end, there are three separate times when a proposal to remove ONE_PLY was defeated by the suggestion to “give it a few more months.” So… it seems like time to remove this distraction from the community. See the pull request here: #2289
1 parent 328bdd0 commit ca7d4e9

File tree

7 files changed

+86
-100
lines changed

7 files changed

+86
-100
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ script:
5656
- make clean && make -j2 ARCH=x86-32 optimize=no debug=yes build && ../tests/signature.sh $benchref
5757
- make clean && make -j2 ARCH=x86-32 build && ../tests/signature.sh $benchref
5858

59-
# Verify bench number is ONE_PLY independent by doubling its value
60-
- sed -i'.bak' 's/.*\(ONE_PLY = [0-9]*\),.*/\1 * 2,/g' types.h
61-
- make clean && make -j2 ARCH=x86-64 build && ../tests/signature.sh $benchref
6259
#
6360
# Check perft and reproducible search
6461
- ../tests/perft.sh

src/movepick.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
6161
: pos(p), mainHistory(mh), captureHistory(cph), continuationHistory(ch),
6262
refutations{{killers[0], 0}, {killers[1], 0}, {cm, 0}}, depth(d) {
6363

64-
assert(d > DEPTH_ZERO);
64+
assert(d > 0);
6565

6666
stage = pos.checkers() ? EVASION_TT : MAIN_TT;
6767
ttMove = ttm && pos.pseudo_legal(ttm) ? ttm : MOVE_NONE;
@@ -73,7 +73,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHist
7373
const CapturePieceToHistory* cph, const PieceToHistory** ch, Square rs)
7474
: pos(p), mainHistory(mh), captureHistory(cph), continuationHistory(ch), recaptureSquare(rs), depth(d) {
7575

76-
assert(d <= DEPTH_ZERO);
76+
assert(d <= 0);
7777

7878
stage = pos.checkers() ? EVASION_TT : QSEARCH_TT;
7979
ttMove = ttm
@@ -206,7 +206,7 @@ Move MovePicker::next_move(bool skipQuiets) {
206206
endMoves = generate<QUIETS>(pos, cur);
207207

208208
score<QUIETS>();
209-
partial_insertion_sort(cur, endMoves, -4000 * depth / ONE_PLY);
209+
partial_insertion_sort(cur, endMoves, -4000 * depth);
210210
}
211211

212212
++stage;

0 commit comments

Comments
 (0)