2008-08-31 23:59:13 -06:00
|
|
|
/*
|
2008-10-19 10:56:28 -06:00
|
|
|
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
|
|
|
|
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
|
2016-01-02 02:43:25 -07:00
|
|
|
Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
|
2020-01-07 13:35:47 -07:00
|
|
|
Copyright (C) 2015-2020 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
|
2008-08-31 23:59:13 -06:00
|
|
|
|
2008-10-19 10:56:28 -06:00
|
|
|
Stockfish is free software: you can redistribute it and/or modify
|
2008-08-31 23:59:13 -06:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2009-01-07 06:26:58 -07:00
|
|
|
|
2008-10-19 10:56:28 -06:00
|
|
|
Stockfish is distributed in the hope that it will be useful,
|
2008-08-31 23:59:13 -06:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2009-01-07 06:26:58 -07:00
|
|
|
|
2008-08-31 23:59:13 -06:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2010-11-22 06:55:56 -07:00
|
|
|
#include "bitboard.h"
|
2020-02-05 07:18:24 -07:00
|
|
|
#include "endgame.h"
|
2010-11-22 06:55:56 -07:00
|
|
|
#include "position.h"
|
2011-04-24 02:20:03 -06:00
|
|
|
#include "search.h"
|
2011-12-30 03:30:26 -07:00
|
|
|
#include "thread.h"
|
2017-08-06 05:43:02 -06:00
|
|
|
#include "tt.h"
|
2014-10-26 00:09:19 -06:00
|
|
|
#include "uci.h"
|
2015-01-18 00:05:05 -07:00
|
|
|
#include "syzygy/tbprobe.h"
|
2014-11-25 16:45:28 -07:00
|
|
|
|
2016-09-17 00:19:06 -06:00
|
|
|
namespace PSQT {
|
|
|
|
void init();
|
|
|
|
}
|
|
|
|
|
2010-11-08 12:49:40 -07:00
|
|
|
int main(int argc, char* argv[]) {
|
2008-08-31 23:59:13 -06:00
|
|
|
|
2012-04-01 02:25:07 -06:00
|
|
|
std::cout << engine_info() << std::endl;
|
2012-03-18 16:08:37 -06:00
|
|
|
|
2012-08-18 04:50:43 -06:00
|
|
|
UCI::init(Options);
|
Fishtest Tuning Framework
The purpose of the code is to allow developers to easily and flexibly
setup SF for a tuning session. Mainly you have just to remove 'const'
qualifiers from the variables you want to tune and flag them for
tuning, so if you have:
int myKing = 10;
Score myBonus = S(5, 15);
Value myValue[][2] = { { V(100), V(20) }, { V(7), V(78) } };
and at the end of the update you may want to call
a post update function:
void my_post_update();
If instead of default Option's min-max values,
you prefer your custom ones, returned by:
std::pair<int, int> my_range(int value)
Or you jus want to set the range directly, you can
simply add below:
TUNE(SetRange(my_range), myKing, SetRange(-200, 200), myBonus, myValue, my_post_update);
And all the magic happens :-)
At startup all the parameters are printed in a
format suitable to be copy-pasted in fishtest.
In case the post update function is slow and you have many
parameters to tune, you can add:
UPDATE_ON_LAST();
And the values update, including post update function call, will
be done only once, after the engine receives the last UCI option.
The last option is the one defined and created as the last one, so
this assumes that the GUI sends the options in the same order in
which have been defined.
closes https://github.com/official-stockfish/Stockfish/pull/2654
No functional change.
2015-04-04 00:54:15 -06:00
|
|
|
Tune::init();
|
2015-05-01 18:36:39 -06:00
|
|
|
PSQT::init();
|
2012-04-01 03:46:38 -06:00
|
|
|
Bitboards::init();
|
2013-06-09 05:43:30 -06:00
|
|
|
Position::init();
|
2015-01-03 08:39:17 -07:00
|
|
|
Bitbases::init();
|
2019-05-15 02:41:58 -06:00
|
|
|
Endgames::init();
|
2020-05-23 05:26:13 -06:00
|
|
|
Threads.set(size_t(Options["Threads"]));
|
2017-08-06 05:43:02 -06:00
|
|
|
Search::clear(); // After threads are up
|
2008-08-31 23:59:13 -06:00
|
|
|
|
2014-04-12 04:52:10 -06:00
|
|
|
UCI::loop(argc, argv);
|
2012-08-29 08:43:01 -06:00
|
|
|
|
2017-12-26 02:40:42 -07:00
|
|
|
Threads.set(0);
|
2015-09-27 02:53:39 -06:00
|
|
|
return 0;
|
2008-08-31 23:59:13 -06:00
|
|
|
}
|