Skip to content

Commit

Permalink
- ペタショック化コマンドの途中経過でてないところがあったの修正。
Browse files Browse the repository at this point in the history
- clangなどでBookHeaderがwarningでてたの修正。
- tanuki mateエンジンなどでビルドエラーになっていたの修正。
  • Loading branch information
yaneurao committed Dec 18, 2023
1 parent 5badee4 commit 3e7c94d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions source/book/book.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,9 @@ namespace Book

// cp_to_value()はscale downするから⇓変換後、このclampの範囲外に出ないことは保証される。scale upする場合は、注意。
value = std::clamp(value , VALUE_MATED_IN_MAX_PLY , VALUE_MATE_IN_MAX_PLY);
#if defined(USE_PIECE_VALUE)
r.previousScore = r.usiScore = r.score = USI::cp_to_value(value);
#endif
// ⇨ 定跡の評価値0になってる方が、嬉しい意味もあるか…。

// 2手目の指し手も与えないとponder出来ない。
Expand Down
2 changes: 1 addition & 1 deletion source/book/book.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Search { struct LimitsType; };
// 定跡処理関連のnamespace
namespace Book
{
static char* BookDBHeader2016_100 = "#YANEURAOU-DB2016 1.00";
static const char* BookDBHeader2016_100 = "#YANEURAOU-DB2016 1.00";

// 将棋ソフト用の標準定跡ファイルフォーマットの提案 : http://yaneuraou.yaneu.com/2016/02/05/standard-shogi-book-format/

Expand Down
7 changes: 4 additions & 3 deletions source/book/makebook2023.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,9 @@ namespace MakeBook2023
Color stm = ~book_node.color();
string sfen = (stm != pos.side_to_move()) ? pos.flipped_sfen(ply + 1) : pos.sfen(ply + 1);

// write_sfensのinsertはここでしか行わないので、ここでcheck()すれば十分。
write_sfens.insert(sfen);
write_counter2++;
progress.check(write_counter2++);

// この手はないものとして、この book_node_index を起点として上流に更新していけばOK。
book_node.moves[best_index].move = MOVE_NONE;
Expand Down Expand Up @@ -1247,7 +1248,7 @@ namespace MakeBook2023

// ⇑ sort中にpacked sfenのunpackをしてメモリ節約するのは無謀であったか…。

cout << "Unpack sfens : " << endl;
cout << "Unpack packed sfens : " << endl;

// 並び替えを行う。
// ただしbook_nodes直接並び替えるのはメモリ移動量が大きいのでindexのみをsortする。
Expand Down Expand Up @@ -1280,7 +1281,7 @@ namespace MakeBook2023
// しかしsortするのも丸読みしないといけないから大変か…。
// この時点で要らないものをいったん解放できると良いのだが…。

cout << "Write book directly : " << endl;
cout << "Write to a book DB : " << endl;

SystemIO::TextWriter writer;
if (writer.Open(writebook_path).is_not_ok())
Expand Down
2 changes: 2 additions & 0 deletions source/eval/nnue/evaluate_nnue.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include <memory>

// 評価関数のソースコードへの埋め込みをする時は、EVAL_EMBEDDINGをdefineして、
// ⇓この2つのシンボルを正しく定義するembedded_nnue.cppを書けば良い。
#if defined(EVAL_EMBEDDING)
extern const char* gEmbeddedNNUEData;
extern const size_t gEmbeddedNNUESize;
Expand Down

0 comments on commit 3e7c94d

Please sign in to comment.