### Install DeepLearningShogi Environment Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2025 Setup steps for installing dependencies, cloning the repository, and applying patches. ```bash pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html git clone https://github.com/TadaoYamaoka/DeepLearningShogi.git ~/DeepLearningShogi pushd ~ curl -RLO https://gist.githubusercontent.com/mizar/1f36c8c456926460bc8585e2fc631bd7/raw/8b7e831b7570b5165f8ca2425643b4837e88e4a0/dlshogi.diff popd pushd ~/DeepLearningShogi git apply ~/dlshogi.diff pip3 install --no-cache-dir -e . pip3 install cshogi popd ``` -------------------------------- ### Example Configuration for Endless Extend Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2024 An example of how to configure the `makebook endless_extend_tree` command within a chess engine setup, specifying parameters like Hash, Threads, depth, and other extension controls. ```ini Hash 4096 Threads 8 makebook endless_extend_tree book/user_book1.db book/kadai_sfen.txt book/think_sfen.txt depth 36 startmoves 1 moves 70 loop 100 black_eval_limit -50 white_eval_limit -150 nodes 1000000000 ``` -------------------------------- ### Install Ubuntu Build Dependencies Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Install essential build tools, Clang, and OpenBLAS on Ubuntu systems. ```bash sudo apt-get update sudo apt-get -y install build-essential clang lld libopenblas-dev unzip zip p7zip-full ``` -------------------------------- ### USI Ponder Configuration Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2022まで Example USI commands for configuring ponder and setting up a game position with moves. ```text bookfile book.bin USI_Ponder true isready position startpos moves 6i7h 8c8d 7g7f go btime 64000 wtime 58000 binc 3000 winc 3000 ``` -------------------------------- ### Install Git on MSYS2 Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Install the git version control system using pacman. ```bash pacman --needed --noconfirm -Syuu git ``` -------------------------------- ### Yaneuraou Game Start and Position Setup Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2023 Commands to initialize a new game and set a specific board position with a sequence of moves. Used for testing and analysis. ```sh usinewgame position startpos moves 7g7f 8c8d 2g2f 8d8e 8h7g 3c3d 7i6h 2b7g+ 6h7g 3a2b 3g3f 7c7d 6i7h 4a3b 1g1f 7a7b 3i3h 2b3c 4g4f 1c1d 9g9f 5a4b 3h4g 9c9d 2i3g 6c6d 5i6h 7b6c 4i4h 8a7c 6g6f 6c5d 2h2i 6a6b 4g5f 8b8a 2f2e go ``` -------------------------------- ### Install Git on macOS Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Install git using Homebrew. ```bash $ brew install git ``` -------------------------------- ### Generate Opening Book via Thinking (Start Moves) Source: https://context7.com/yaneurao/yaneuraou/llms.txt Generates an opening book by thinking, starting from a specified move number and continuing up to a certain depth. ```bash makebook think 2016.sfen user_book1.db startmoves 5 moves 16 depth 32 ``` -------------------------------- ### Generate opening book starting from a specific move Source: https://github.com/yaneurao/yaneuraou/wiki/定跡の作成 Generates an opening book by thinking from game records, starting the analysis from a specified move number. The 'startmoves' option defines the initial ply for analysis. ```bash makebook think 2016.sfen yaneura_book.db startmoves 5 moves 16 depth 32 ``` -------------------------------- ### Bench Command Output Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2025 This is an example output from the 'bench' command, showing performance metrics for a chess engine. It reports the total time, nodes searched, and nodes per second. ```text bench 64 32 20 default depth =========================== Total time (ms) : 149488 Nodes searched : 3425547456 Nodes/second : 22915200 ``` -------------------------------- ### Initialize Engine Source: https://context7.com/yaneurao/yaneuraou/llms.txt Starts the engine and initializes it in USI mode. ```bash # エンジンを起動してUSIモードで初期化 ./YaneuraOu-by-gcc usi # 出力例: # id name YaneuraOu NNUE 7.63 # id author by yaneurao # option name Threads type spin default 4 min 1 max 512 # option name USI_Hash type spin default 1024 min 1 max 33554432 # option name USI_Ponder type check default false # option name MultiPV type spin default 1 min 1 max 800 # option name EvalDir type string default eval # ... その他のオプション ... # usiok ``` -------------------------------- ### Peta Next Command Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2023 Example command sequence for the 'peta next' command, used for generating game databases. It sets parameters for draw values and specifies the database creation process. ```bash SkipLoadingEval true DrawValueBlack 0 DrawValueWhite 0 makebook peta_shock_next book.db peta_next_sfens.txt 30 50 quit ``` -------------------------------- ### Parameter Tuning with TUNE Macro (Example) Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2025 This example demonstrates how to use the `TUNE` macro for parameter tuning in Yaneuraou. It shows how to define tunable parameters, set their ranges, and initialize them. The snippet also illustrates how to access and modify these parameters during engine runtime and verify changes. ```cpp // globalに確保 Value myValue[][2] = {{100, 20}, {7, 78}}; // add_options()などで TUNE(SetRange(100, 200), myValue); Tune::init(options); // エンジン起動後に myvalue[0][0] = 123 などとして変更。 // isreadyなどで確認。 sync_cout << myValue[0][0] << sync_endl; 123 ``` -------------------------------- ### PetaShock Book Conversion Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2023 Example command to convert an existing book database to the peta_shock format. This process enhances the book with deeper analysis and loop detection. ```sh makebook peta_shock book.db peta_shock.db ``` -------------------------------- ### Self-Play Command Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2022まで An example command for initiating self-play matches between two engines using a Python script. It specifies engine paths, evaluation files, hash sizes, time controls, logging, and core/CPU usage. ```bash c:\python27\python engine_invoker6.py --engine1 nnue/YaneuraOuNNUE_V720_avx2.exe --eval1 . --engine2 cluster/YaneuraOu-nnue-cluster.exe --eval2 . --hash1 128 --hash2 128 --time b1000 --loop 3000 --PARAMETERS_LOG_FILE_PATH result --cores 40 --cpu 2 --rand_book 1 ``` -------------------------------- ### Execute Mate Search Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2022まで Example commands for the YaneuraOu mate solver. ```text NodesLimit 10000 isready sfen ln1gkg1nl/6+P2/2sppps1p/2p3p2/p8/P1P1P3P/2NP1PP2/3s1KSR1/L1+b2G1NL w R2Pbgp 42 go mate 100000 NodesLimit 0 isready sfen l2g5/2s3g2/3k1p2p/P2pp2P1/1pP4s1/p1+B6/NP1P+nPS1P/K1G4+p1/L6NL b RBGNLPrs3p 1 go mate 100000 ``` -------------------------------- ### Performance Profiling Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2019まで A template for tracking execution frequency and performance bottlenecks. ```cpp static u64 c1 = 0; static u64 c2 = 0; c1++; if ((c1 % 100000) == 0) cout << c2 << " / " << c1 << endl; if (...) { c2++; } ``` -------------------------------- ### Configure Book Generation and Testing Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2022まで Example commands for setting up engine parameters and running book generation or testing sequences. ```text usi_hash 2048 Threads 4 MultiPv 4 makebook think book/flood2018.sfen mybook.db startmoves 1 moves 4 depth 4 ``` ```text position startpos moves 5i5h 5a5b 5h5i 5b5a ``` ```text IgnoreBookPly true isready go IgnoreBookPly false isready go IgnoreBookPly true isready position startpos moves 5i5h 5a5b 5h5i 5b5a go IgnoreBookPly false isready position startpos moves 5i5h 5a5b 5h5i 5b5a go ``` ```text BookOnTheFly true ``` -------------------------------- ### USI Protocol Format Example for Root SFENs Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2024 Example of a starting position using the Universal Shogi Interface (USI) protocol format. This can also be used to define starting positions for opening book generation. ```text startpos moves 7g7f ``` -------------------------------- ### Startup Commands from startup.txt Source: https://github.com/yaneurao/yaneuraou/wiki/隠し機能 If a 'startup.txt' file exists in the same folder as the engine, all commands within it will be executed sequentially before any command-line arguments are processed. Commands are executed one per line. ```text startup.txt ``` -------------------------------- ### SFEN Format Example for Root SFENs Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2024 Example of a Super Fine Net (SFEN) string representing a chess position. This format is used for defining the starting positions for opening book generation. ```text sfen lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL b - 1 ``` -------------------------------- ### Initialize Learning from Scratch Source: https://context7.com/yaneurao/yaneuraou/llms.txt Commands to clear existing evaluation data and start a new learning session. ```bash EvalDir nonexistent_folder SkipLoadingEval true isready learn targetdir ./teacher_data ``` -------------------------------- ### Configure and Execute PV Mate Search Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2024 Example USI commands to initialize and run the PV mate search process. ```text PV_Mate_Search_Threads 2 isready usinewgame position sfen 1p3+p+pp1/1+Pg4n1/1+Pn2pksp/1Sp1K4/1+r6L/4pG3/PPP2LPPP/1B2R2L1/BN1PP1GNL b g2s 1 go ``` ```text PV_Mate_Search_Threads 2 isready usinewgame position startpos moves 2g2f 8c8d 2f2e 4a3b 6i7h 8d8e 3i3h 7a7b 9g9f 9c9d 3g3f 8e8f 8g8f 8b8f 5i6h 1c1d 2i3g 7c7d 2e2d 2c2d 2h2d P*2c 2d7d 8f8b P*8g 7b7c 7d7e 3c3d 7e2e 4c4d 7g7f 3a4b 4g4f 4b4c 3h4g 7c6d 4i4h 6a5b 6h5h 2a3c 2e2i 8b7b 7h7g 5c5d 1g1f 4d4e 3g4e 3c4e 4f4e 6d6e 5g5f 5d5e N*4d 5e5f 6g6f 4c4d 4e4d 6e5d 4g5f 2b4d S*4e P*4g 4h4g 5d4e 5f4e 4d7a 4g5g P*5f 5g5f N*6d 5h6g 6d5f 4e5f N*6d 5f6e 8a7c N*6h 7c6e 6f6e 7a9c 6e6d S*6i N*7e S*5h 6g5f P*5e 5f4f 6c6d 7g6f 5b5c 6f5e P*5d 5e4e 7b8b P*5b 5c5b 8h1a+ 8b8g+ L*7g G*4g 4f5f 6i7h 4e5d 7h7i 5d6d 9c8b N*4d S*5e 5f5e 8b6d 5e6e 6d7e 4d5b+ 5a5b S*6c 5b6c S*7d 6c5b G*6c 5b4b 7f7e P*6d 6c6d N*6a P*5d S*2b B*4d 2b1a 5d5c+ 4b3a 4d1a+ B*5a P*2b 3b2b S*4b 5a4b 5c4b 3a4b 1a2b S*7f 6e5e P*5d 6d5d G*4e 5e4e go ``` -------------------------------- ### Get Thread Count by NUMA Node Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2026 Retrieves a list of pairs, where each pair contains the start and end thread count for a specific NUMA node. This is used for detailed thread allocation information. ```cpp virtual std::vector> get_bound_thread_count_by_numa_node() const { return std::vector>(); } ``` -------------------------------- ### Verify Engine Startup Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Copy the compiled binary and run it to check configuration and compiler details. ```bash cp YaneuraOu-by-gcc "../../YaneuraOuNNUE_20240624_avx2" cd ~ ./YaneuraOuNNUE_20240624_avx2 config 💡 ⇦ このコマンドでビルド時の設定が表示できる configured by config.h ASSERT_LV : 0 HASH_KEY_BITS : 128 TT_CLUSTER_SIZE : 4 PRETTY_JP : true FOR_TOURNAMENT : false ENABLE_TEST_CMD : true ENABLE_MAKEBOOK_CMD : true USE_SUPER_SORT : false TUNING_SEARCH_PARAME : false USE_GLOBAL_OPTIONS : true EVAL_LEARN : false 💡 学習版は、ここがtrueになっている。 USE_MATE_DFPN : true USE_YO_CLUSTER : false compiler 💡 ⇦ このコマンドでビルドに用いたコンパイラのバージョンを表示できる。 Compiled by clang++ 18.1.3 on Linux Compilation architecture : (undefined architecture) Compilation settings : 64bit AVX2 SSE41 SSSE3 SSE2 Compiler __VERSION__ macro : Ubuntu Clang 18.1.3 (1) quit 💡 ⇦ エンジンを終了 ``` -------------------------------- ### Execute Commands on Startup Source: https://context7.com/yaneurao/yaneuraou/llms.txt Methods to run specific commands upon engine initialization. ```bash ./YaneuraOu-by-gcc position startpos , go depth 10 , wait , quit ``` ```text Threads 8 USI_Hash 4096 ``` -------------------------------- ### Install p7zip on macOS Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Install p7zip using Homebrew. ```bash $ brew install p7zip ``` -------------------------------- ### Execute USI Position and Go Commands Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2019まで Example of setting up a board position and initiating a search with time constraints. ```text position startpos moves 1g1f 8c8d 7g7f 8d8e 8h7g 7a6b 6g6f 5a4b 2h8h 5c5d 7i7h 4b3b 3i3h 6b5c 5i4h 3c3d 3g3f 5c4d 7h6g 5d5e 4g4f 6a5b 6i5h 7c7d 5h4g 9c9d 1f1e 2b3c 2i3g 8a7c 4h3i 9d9e 3i2h 3c4b 2g2f 8b8d 6f6e 7c6e 7g6f 8d8a 5g5f 5e5f 6g5f 6c6d 4f4e 4d3c P*5d 5b6c 5f5e 3b2b 3g2e 4a3b 3f3e 3d3e 8h5h 8e8f 5e4f 8f8g+ 2e3c 4b3c 6f3c+ 3b3c 5h5i P*5g B*7b 8a8f 7b6c+ 8g7g 6c6d 8f8h+ 6d6e 7g6h 5i5g 8h8i N*2e 3c3b 6e5e N*3c P*3d N*4b 4f3e 8i7i 5d5c+ B*7h 3d3c+ 2a3c 2e3c+ 3b3c N*2e P*3b 5c4c N*3d 4c3c 3b3c 2e3c+ 2b2a G*2b 3a2b go btime 0 wtime 0 byoyomi 30000000 ``` ```text isready position startpos moves 7g7f 8b3b 5i6h 5a6b 2g2f 6b7b 2f2e 3c3d 3i4h 3d3e 8h2b+ 3a2b 2e2d 2c2d 7i7h 5c5d 7h7g 2b2c B*6f B*2b 6f2b+ 3b2b 6h7h 2c3d 4g4f 2d2e 4h4g 2e2f B*6f B*3c 6f3c+ 2a3c 4i3h B*4i B*5f 3d2e 4g5h 4i5h+ 6i5h S*5e B*1e 4a3b 5f4g 5e4f 4g5f 5d5e go btime 10000000 ``` ```text position startpos moves 2g2f 3c3d 7g7f 8c8d 2f2e 1c1d 2e2d 2c2d 2h2d go btime 169000 wtime 17100000 byoyomi 0 ``` -------------------------------- ### Adjust thread start timing Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2019まで This code snippet adjusts the start timing of worker threads to potentially randomize their seeding. A sleep of 10 seconds is introduced between starting each thread. ```cpp for (auto th : Threads.slaves) { th->start_searching(); sleep(10); } // 開始タイミングをずらすことで乱数seedをばらけさせる ``` -------------------------------- ### Generate opening book with specific engine settings Source: https://github.com/yaneurao/yaneuraou/wiki/定跡の作成 Generates an opening book using specified engine parameters like Hash, Threads, and MultiPV. The example shows settings for 4096MB Hash, 8 Threads, and MultiPV 5, processing a game record to a depth of 32. ```bash Hash 4096 Threads 8 MultiPV 5 makebook think 2016.sfen user_book1.db moves 16 depth 32 ``` -------------------------------- ### Install p7zip on MSYS2 Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Install the p7zip package for handling .7z archives. ```bash pacman -S p7zip ``` -------------------------------- ### Displaying Startup Information from startup_info.txt Source: https://github.com/yaneurao/yaneuraou/wiki/隠し機能 A 'startup_info.txt' file in the engine's directory will be read and displayed upon startup. This is useful for displaying debugging information or macro definitions. ```text startup_info.txt ``` -------------------------------- ### Access Moves from Start Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2025 Retrieves the stack of moves played from the starting position. ```cpp const FixedSizeStack& MovesFromStart() const { return moves_; } ``` -------------------------------- ### Executing Commands from a File Source: https://github.com/yaneurao/yaneuraou/wiki/隠し機能 You can specify a file containing commands to be executed at startup. The engine will execute all commands from this file before proceeding. If command-line arguments are also provided, they will be executed after the file commands. ```bash YaneuraOu-nano.exe file cmd.txt ``` -------------------------------- ### Configure PV Mate Search Threads Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2024 Example configuration for enabling PV mate search threads and initiating a search with specific time controls. ```text PV_Mate_Search_Threads 2 UCT_Threads1 2 isready usinewgame position startpos moves 7g7f 8c8d 6i7h 9c9d 9g9f 8d8e 8h7g 6c6d 7i6h 4a3b 1g1f 1c1d 2g2f 3c3d 3i3h 3a4b 7g2b+ 3b2b 6h7g 7a6b 2f2e 4b3c 3g3f 6a5b 5i6h 7c7d 4g4f 2b3b 2i3g 5a4b 3h4g 8a7c 4i4h 6b6c 2h2i 5b6b 4g5f 8b8a 6g6f 6c5d 6h7i 5d6c 7i8h 6c5d 5f6g 5d5e 3f3e 3d3e 3g4e 3c4d 2e2d 2c2d 6g5f 5e4f 2i2d P*2c 2d2f 3e3f P*3c 2a3c 4e3c+ 3b3c 2f3f 4d3e 3f3h P*3f P*4g 3f3g+ 4h3g 4f5g+ P*5d 5c5d N*4f 3e4f 3g4f P*3g 3h2h N*8f 8g8f 8e8f 7g8f 8a8f P*8g 8f7f S*7g 7f7e N*4e 3c3b B*8f N*6c 8f7e 6c7e R*2a 4c4d 2a9a+ 4d4e L*4d 4b3c 4f4e B*6i P*7f N*3f 2h1h 5g5f 7f7e S*3d N*2e 3d2e 9a1a 5f5e 4e5e 5d5e 1a4a P*8f L*3e N*3d 7g8f P*4h 7h6h 6i4g+ 3e3d 2e3d S*4c 3b4c 4d4c+ 3d4c G*3e S*3d P*4d 4c5b 4a3a L*3b 3e3d 3c3d 3a3b 3d4e S*5h B*7f 5h4g 7f3b L*4f 4e5d 4d4c+ 5b4c 7e7d P*8e 7d7c+ 8e8f 7c6b 8f8g+ 8h8g P*8f 8g8f S*7d B*7b 5d5c 6b6c 7d6c N*4e 5c6b 7b6c+ 6b6c N*7e 6c5d S*6c 5d4d 4g3f G*3e 4e5c+ 3e4f 1h4h P*4g 5c4c 4d4c 3f3e P*8e 8f8e L*8a P*8b R*8h N*8f S*7c P*4d 4c3c G*4c 3b4c 4d4c+ 3c4c S*9c 8a8b P*8d L*8a 7e8c+ 8b8c B*6a 4c3b 8d8c+ N*7a P*3c 3b2b 6a7b+ 8a8c P*8d 8c8d 9c8d 7c8d 8e8d 8h8f+ L*8e N*8a 3c3b+ go btime 6000 wtime 9000 binc 1000 winc 1000 ``` -------------------------------- ### Lance Effect Calculation Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2022まで Example usage of the lanceEffect template function. ```cpp //Square sq = SQ_21; //Bitboard occ(SQ_27); Square sq = SQ_11; Bitboard occ(SQ_17); cout << lanceEffect(sq, occ); ``` -------------------------------- ### Install 32-bit MSYS2 Dependencies Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Install Clang and Python for the 32-bit mingw32 environment. ```bash pacman -S --needed mingw-w64-i686-clang mingw-w64-i686-lld pacman -S --needed python ``` -------------------------------- ### Verify Clang Installation Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Check the installed version of Clang to ensure the environment is ready. ```bash $ clang --version clang version 20.1.7 Target: x86_64-w64-windows-gnu Thread model: posix InstalledDir: C:/msys64/mingw64/bin ``` -------------------------------- ### Compiler Warning Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2024 Example of a compiler warning encountered during 32-bit OS compilation for NNUE_halfkpe9. ```cpp long_effect.cpp:174:34: warning: implicit conversion from 'long long' to 'u32' (aka 'unsigned int') changes value from 2134471622175 to 4167843359 [-Wconstant-conversion] 174 | return (Directions)PEXT64(t, 0b11111000011111000011011000011111000011111); | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` -------------------------------- ### Engine Configuration and Move Execution Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2024 Example of setting the evaluation directory and executing a sequence of moves in the engine. ```text evaldir BBhalfkpe9 evaldir hao isready position startpos moves 7g7f 8c8d 2g2f 8d8e 8h7g 3c3d 7i6h 4c4d 4g4f 4a3b 3i3h 3a4b 6i7h 4b4c 3h4g 7a6b 4g5f 9c9d 5i6i 5c5d 2f2e 2b3c 4i5i 7c7d 6i7i 6b5c 2h4h 6a6b 3g3f 8a7c 1g1f 5a6a 9g9f 1c1d 2i3g 5c6d 4f4e 4d4e 5f4e 3c7g+ 8i7g P*4g 4h4g B*3h 4g4f 3h2g+ 5i4h 6d5e 4f4g 8e8f 8g8f 8b8f 5g5f P*4f 4g5g 5e6d P*4d 4c5b P*8g 8f8b 5f5e 2a3c 4e3d 2g2f B*2a 2f4d 2a3b+ 4d3d G*3e 3d4c 3b4c 5b4c 5e5d P*5e B*2b 4c5d 2b3c+ 7c6e 5g5i 6e7g+ 6h7g N*5f 4h5h S*4h N*6f 5d6e N*8f 6b7c 3c4d 4h3g+ 5i4i 4f4g+ 5h4g P*4h 4g5f 4h4i+ 5f6e 6d6e 7i8i N*8e S*6b 8b6b 4d6b 6a6b R*8b 6b7a 8b8e+ R*5i N*7i B*4g P*5f 4g5f+ P*5g P*8h 8i8h 5i5g+ N*6h 5f4g P*5f S*6d 3e4d P*8d 8e6e 6d6e 7f7e 6e6f S*8b 7a8b 6g6f N*8e 7i6g R*6i S*7i 8e7g+ 8h7g 5g6g 7g6g 4g5f 6g7g N*8e 7g8h S*7g 7h7g G*8i 8h9h S*9g go btime 7000 wtime 16000 binc 1000 winc 1000 ``` -------------------------------- ### Stochastic Ponder USI Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2025 Example USI commands for testing Stochastic Ponder functionality. ```text usi_ponder true stochastic_ponder true bookfile no_book isready position startpos go position startpos moves 7g7f 3c3d津 go ponder btime 10000 wtime 10000 byoyomi 10000 ``` -------------------------------- ### Execute PetaShock command with specific parameters Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2024 Examples of running the PetaShock command with different configuration flags and database files. ```text USI_Hash 0 SkipLoadingEval true makebook peta_shock user_book1_20240108165930.db user_book1.db hash 1024 ``` ```text USI_Hash 0 SkipLoadingEval true makebook peta_shock user_book1_20240105221623.db user_book1.db ``` ```text USI_Hash 0 SkipLoadingEval true makebook peta_shock user_book1_20240108165930.db user_book1.db ``` -------------------------------- ### Install MSYS2 Build Dependencies Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王のビルド手順 Use pactoys to install the required toolchain, Clang, and OpenBLAS on MSYS2. ```bash pacman --needed --noconfirm -Syuu pactoys pacboy --needed --noconfirm -Syuu clang lld openblas openmp toolchain base-devel: ``` -------------------------------- ### UCI Command Sequence Examples Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2025 Example sequences of UCI commands used for engine configuration and search initiation. ```text uct_threads 1 PV_Mate_Search_Threads 0 isready position startpos go ``` ```text threads 32 isready go infinite ``` -------------------------------- ### Build on Ubuntu/Linux Source: https://context7.com/yaneurao/yaneuraou/llms.txt Standard build process for Linux environments including learning and tournament editions. ```bash sudo apt-get update sudo apt-get -y install build-essential clang lld libopenblas-dev unzip zip p7zip-full git git clone https://github.com/yaneurao/YaneuraOu.git cd YaneuraOu/source make clean YANEURAOU_EDITION=YANEURAOU_ENGINE_NNUE make -j8 tournament COMPILER=clang++ \ YANEURAOU_EDITION=YANEURAOU_ENGINE_NNUE \ TARGET_CPU=AVX2 make clean YANEURAOU_EDITION=YANEURAOU_ENGINE_NNUE make -j8 evallearn COMPILER=clang++ \ YANEURAOU_EDITION=YANEURAOU_ENGINE_NNUE \ TARGET_CPU=AVX2 ``` -------------------------------- ### Start Searching Thread Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2025 Signals a waiting thread to start searching by setting the 'searching' flag and notifying the condition variable. ```cpp // 待機していたスレッドを起こして探索を開始させる void Thread::start_searching() { mutex.lock(); searching = true; mutex.unlock(); // Unlock before notifying saves a few CPU-cycles cv.notify_one(); // idle_loop()で回っているスレッドを起こす。(次の処理をさせる) } ``` -------------------------------- ### Engine Debug and Setup Commands Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2022まで Commands used to configure engine behavior and initiate a search from a specific position. ```text DebugMessage true MaxMovesToDraw 150 isready position startpos moves 6i7h 8c8d 7g7f 8d8e 8h7g 3c3d 7i6h 2b7g+ 6h7g 4a3b 3g3f 3a4b 5i6h 7a6b 2g2f 4b3c 3i4h 7c7d 4g4f 9c9d 2i3g 6b7c 4i3h 7c6d 2f2e 7d7e 7f7e 6d7e 2e2d 2c2d P*2e P*7f 7g8h 8e8f 2e2d 8f8g+ 8h8g P*2b 2h2e P*8f 8g9h 7e6d 4h4g 5a5b 2e2i 9d9e P*8h 9e9f 9g9f B*7d 6h5h 7d9f 7h6h 8f8g+ 9h8g 9f8g+ 8h8g 9a9i+ 6h7h 9i8i 2i8i S*7g P*7i 8b9b L*9i P*9h B*8c 9b9g+ 8c6a+ 5b6a B*4a 6a7b G*8h 7g8h+ 7h8h 9g9c 9i9h 9c7c 4a3b+ 7f7g+ 8h7g 7c7g G*7h 7g7c 3b4a N*5e 4a5a 5e4g+ 3h4g S*3h S*4i B*2i N*8d 7b8c 5a7c 6d7c 4i3h 2i3h+ R*4h 3h3i 8d9b+ S*3h 9h9c+ 8c7b 5h6h 8a9c 8i9i 9c8e 9i9c+ 3h4g+ S*8c 7b6b 4h4g G*4h 9c8b 7c8b 8c7b+ 6b7b 9b8b 7b8b S*9c 8b9c P*9d 9c9d P*9e 9d9e S*8f 9e8d 8f8e 8d8e 8g8f 8e8f 7h7g 8f9g P*9h 9g9h P*9i 9h9i 4g4h go infinite ``` -------------------------------- ### Setting and Getting Evaluator Name Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2025 Methods to set and get the name of the evaluation function. This is used when displaying information during the 'usi' command. ```cpp // 評価関数をset/getする。 virtual void set_evaluator(std::shared_ptr evaluator) = 0; virtual std::shared_ptr get_evaluator() = 0; ``` -------------------------------- ### USI Engine PV Output Example Source: https://github.com/yaneurao/yaneuraou/wiki/やねうら王の更新履歴2023 Example of USI protocol output showing depth, score, and principal variation during a ponder hit. ```text :position startpos moves 2g2f 8c8d 7g7f 3c3d 2f2e 4a3b 6i7h 8d8e 2e2d 2c2d 2h2d 8e8f 8g8f 8b8f 2d3d 2b3c 5i5h 8f8b 3g3f P*8f P*8c 8b8c P*8d 8c8b 2i3g 5a4b 3g4e 3c8h+ 7i8h P*3c 3d2d P*2c 2d2e 7a6b 8i7g 4c4d P*2d B*3d 2e3e 3d4e 3e4e 4d4e 2d2c+ 3b2c B*6e 8b8d 6e2a+ 3a3b 2a1a 8f8g+ 8h8g R*8i N*3e 2c3d L*4c 4b5b 1a2b N*5e 3i3h 6b5a 2b3b 4e4f 4g4f P*8f 8g9f 5b6b P*8e 8d4d B*8c 4d4f P*4g 4f3f 4c4b+ P*4f 7g6e 4f4g+ 5h6h 6a7b 6e5c+ 6b7a 3b5d 5e6g+ 6h6g 7b8c 5d3f 8i6i+ P*6h B*5h 4i5h 6i5h 6g7g 5h5g 6h6g G*8g >1:go ponder btime 297000 wtime 703000 binc 10000 winc 10000 1:ponderhit <1:info depth 31 seldepth 28 score mate 27 nodes 140658895 nps 7155300 hashfull 197 time 19658 pv 9f8g 5g5c 4b5a 8f8g+ 7h8g S*7b R*5b 5c5b 5a5b R*7i 7g8f 7i7g+ 8g7g P*8d B*6b 7a8b S*7a 8b9b R*8b 8c8b 7a8b+ 9b8b S*7a 8b8c R*8b 8c7d G*7e <1:info depth 31 seldepth 28 score mate 27 nodes 144650757 nps 7133383 hashfull 200 time 20278 pv 9f8g 5g5c 4b5a 8f8g+ 7h8g S*7b R*5b 5c5b 5a5b R*7i 7g8f 7i7g+ 8g7g P*8d B*6b 7a8b S*7a 8b9b R*8b 8c8b 7a8b+ 9b8b S*7a 8b8c R*8b 8c7d G*7e <1:bestmove 9f8g ponder 5g5c ```