ProDeo
Would you like to react to this message? Create an account in a few clicks or log in to continue.
ProDeo

Computer Chess
 
HomeHome  CalendarCalendar  Latest imagesLatest images  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

Post new topic   Reply to topic
 

 Visual Studio can't find file with long name

Go down 
5 posters
AuthorMessage
Eelco

Eelco


Posts : 232
Join date : 2021-10-08

Visual Studio can't find file with long name Empty
PostSubject: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptyWed Jan 26, 2022 8:56 pm

Hi Ed,

Rebel 14.1 looks very good! It just could not be compiled by me, because Visual Studio 2022 could not find
Code:

Severity   Code   Description   Project   File   Line   Suppression State
Error   C1083   Cannot open include file: 'C:\Users\Gebruiker\Downloads\Rebel-14.1-Master\embedded-nnues\resume-iter=1-pos=1.2B-d6+d7-lambda=0.5-lr=0.000004-epoch=147-arch=3-loss=0.16804.txt': No such file or directory   fruitig   C:\Users\Gebruiker\Downloads\Rebel-14.1-Master\nnue.cpp   567   

As you can see, I did try to give it a path as it is on my computer but that also did not work. With Rebel 14 there is no problem finding the corresponding line in nnue.cpp

Code:
#include "rebel-14.txt"

although you would expect that maybe it could not find it, because it is called rebel-14.txt.txt
Back to top Go down
Eelco

Eelco


Posts : 232
Join date : 2021-10-08

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptyThu Jan 27, 2022 4:33 am

Hi Ed,

I think I got that resolved now, still with the long name but everything compiles cleanly. I did not check if the output is the same though with the executables because I had also changed my copy of search_full.cpp in the mean time. I hope you don't mind terribly there is now also a Rebel with Singular Extensions. For analysis purposes? Probably extremely buggy but it did not crash right away. Sorry, I could not resist if I could hack that just from scratch this night... It was just finished and compiled for the first time. I did no changes to eval.cpp or anything, just in full_no_null and a little bit after the in check single reply extension from Fabien.

But in nnue.cpp, I have deleted a space between #include and " but that should not do anything I suppose, and changed the path a little, and added - kopie to the name of the file. So line 567 is now:

Code:
#include "embedded-nnues/resume-iter=1-pos=1.2B-d6+d7-lambda=0.5-lr=0.000004-epoch=147-arch=3-loss=0.16804 - kopie.txt"
Back to top Go down
Eelco

Eelco


Posts : 232
Join date : 2021-10-08

Visual Studio can't find file with long name Empty
PostSubject: 20 plies for Rebel "Special Edition"    Visual Studio can't find file with long name EmptyMon Jan 31, 2022 12:19 am

Wow, the first time I could make Rebel 14.1 with Singuiar Extensions reach a depth of 20 plies without crashing Visual Studio can't find file with long name 1f382

After about 50 versions that crashed, sometimes reaching about 13 plies though, it felt so close! Then again, it might fail forever...  Embarassed

Now Rebel with SE in the opening position plays a decent Indian opening at 20 plies deep. Basketball But full_no_null, if I am not mistaken generates full PV searches, for every move in the node where it is started? Maybe I'm wrong... Exclusion Search is of course, very much shortened and with a very small window, so not like an ordinary PV search (in the Verification Search after Null). You don't want to do Null Move if you have already excluded one move, the object is to search all the other moves, not null move which you probably already have tried. That is why I chose  full_no_null after excluding the move from the transposition table which is also conveniently available here by Fabien's original breakthrough design of Fruit.

Code:
Rebel 14.1 by Fabien Letouzey, Pawel Koziol, Chris Whittington and Ed Schroder
uci
id name Rebel 14.1
id author Fabien Letouzey, Pawel Koziol, Chris Whittington and Ed Schroder
option name Hash type spin default 128 min 4 max 1024
option name IIR Depth type spin default 6 min 3 max 99
option name NNUE Tuner type spin default 100 min 25 max 200
option name Lazy Eval type spin default 200 min 50 max 1000
option name Ponder type check default false
option name OwnBook type check default true
option name BookFile type string default book_small.bin
option name NullMove Pruning type combo default Fail High var Always var Fail High var Never
option name NullMove Reduction type spin default 3 min 1 max 3
option name Verification Search type combo default Endgame var Always var Endgame var Never
option name Verification Reduction type spin default 5 min 1 max 6
option name History Pruning type check default true
option name History Threshold type spin default 60 min 0 max 100
option name Quiescence Check Plies type spin default 1 min 0 max 2
option name Material type spin default 100 min 0 max 400
option name Piece Activity type spin default 100 min 0 max 400
option name King Safety type spin default 100 min 0 max 400
option name King Tropism type spin default 25 min 0 max 400
option name Pawn Structure type spin default 100 min 0 max 400
option name Passed Pawns type spin default 100 min 0 max 400
uciok
go depth 20
info depth 1
info depth 1 seldepth 1 score cp -87 time 0 nodes 2 pv b1a3
info depth 1 seldepth 1 score cp -46 time 0 nodes 3 pv b1c3
info depth 1 seldepth 1 score cp -23 time 0 nodes 4 pv g1f3
info depth 1 seldepth 1 time 0 nodes 21 nps 0
info depth 2
info depth 2 seldepth 2 score cp 47 time 0 nodes 45 pv g1f3 d7d5
info depth 2 seldepth 2 score cp 58 time 16 nodes 87 pv d2d4 d7d5
info depth 2 seldepth 2 time 16 nodes 105 nps 0
info depth 3
info depth 3 seldepth 7 score cp 6 time 16 nodes 194 pv d2d4 d7d5 e2e4
info depth 3 seldepth 7 time 16 nodes 486 nps 0
info depth 4
info depth 4 seldepth 8 score cp 55 time 31 nodes 1303 pv d2d4 c7c5 d4c5 d8a5 b1c3
info depth 4 seldepth 9 time 31 nodes 1699 nps 0
info depth 5
info depth 5 seldepth 10 score cp -2 time 31 nodes 4107 pv d2d4 d7d5 b1c3 c8f5 e2e4 d5e4
info depth 5 seldepth 11 score cp 23 time 47 nodes 7283 pv e2e4 c7c5 d2d4 g8f6 d4c5 f6e4
info depth 5 seldepth 11 time 47 nodes 8749 nps 0
info depth 6
info depth 6 seldepth 11 score cp 46 time 47 nodes 12719 pv e2e4 c7c5 b1c3 e7e6 g1f3 b8c6
info depth 6 seldepth 11 time 62 nodes 13207 nps 0
info depth 7
info depth 7 seldepth 15 score cp 37 time 78 nodes 28484 pv e2e4 c7c5 d2d3 g8f6 g1f3 d7d5
info depth 7 seldepth 15 time 94 nodes 35883 nps 0
info depth 8
info depth 8 seldepth 15 score cp 47 time 141 nodes 58409 pv e2e4 c7c5 g1f3 e7e6 b1c3 b8c6 f1b5 f8e7 b5c6 b7c6
info depth 8 seldepth 15 time 141 nodes 59914 nps 0
info depth 9
info depth 9 seldepth 17 score cp 47 time 203 nodes 96415 pv e2e4 c7c5 g1f3 e7e6 c2c4 b8c6 b1c3 g8f6
info depth 9 seldepth 17 time 203 nodes 101614 nps 0
info depth 10
info depth 10 seldepth 21 score cp 37 time 312 nodes 167839 pv e2e4 e7e6 d2d4 d7d5 b1c3 f8b4 e4d5 e6d5 g1f3 g8f6
info depth 10 seldepth 21 time 359 nodes 200804 nps 0
info depth 11
info depth 11 seldepth 23 score cp 48 time 406 nodes 229872 pv e2e4 e7e6 d2d4 d7d5 b1c3 f8b4 d1g4 g8f6 g4g7 h8g8
info depth 11 seldepth 23 time 437 nodes 246232 nps 0
info depth 12
info depth 12 seldepth 23 score cp 72 time 562 nodes 328765 pv e2e4 e7e6 d2d4 d7d5 b1c3 f8b4 e4d5 e6d5 g1f3 g8f6 f1d3 d8e7 c1e3 b8c6
info depth 12 seldepth 23 time 578 nodes 333436 nps 0
info depth 13
info depth 13 seldepth 23 score cp 49 time 719 nodes 431237 pv e2e4 e7e6 d2d4 d7d5 b1c3 f8b4 e4d5 e6d5 g1f3 g8f6 f1d3 d8e7 c1e3 c7c6 e1g1
info depth 13 seldepth 23 time 828 nodes 496847 nps 0
info depth 14
info time 1000 nodes 610000 nps 610000 cpuload 1000
info hashfull 9
info depth 14 seldepth 29 score cp 51 time 1219 nodes 739419 pv e2e4 e7e5 g1f3 b8c6 f1c4 g8f6 d2d3 f8c5 b1c3 e8g8 e1g1 d7d6
info currmove d2d4 currmovenumber 2
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 14 seldepth 29 time 1312 nodes 784087 nps 597627
info depth 15
info currmove e2e4 currmovenumber 1
info depth 15 seldepth 31 score cp 47 time 1937 nodes 1164506 pv e2e4 e7e5 g1f3 g8f6 f3e5 d7d6 e5f3 f6e4 d2d4 d6d5 f1d3 f8d6 e1g1 e8g8 c2c4
info currmove d2d4 currmovenumber 2
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info time 2000 nodes 1200000 nps 600000 cpuload 1000
info hashfull 20
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 15 seldepth 31 time 2187 nodes 1297752 nps 593394
info depth 16
info currmove e2e4 currmovenumber 1
info depth 16 seldepth 31 score cp 39 time 2937 nodes 1761302 pv e2e4 e7e5 g1f3 b8c6 f1c4 g8f6 d2d3 f8c5 b1c3 e8g8 e1g1 d7d6 c1e3 c5e3 f2e3 c6e7
info currmove d2d4 currmovenumber 2
info time 3000 nodes 1800000 nps 600000 cpuload 1000
info hashfull 32
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 16 seldepth 31 time 3797 nodes 2266845 nps 597009
info depth 17
info currmove e2e4 currmovenumber 1
info time 4000 nodes 2390000 nps 597500 cpuload 1000
info hashfull 44
info depth 17 seldepth 32 score cp 39 time 4828 nodes 2905799 pv e2e4 e7e5 g1f3 b8c6 f1c4 g8f6 d2d3 f8c5 b1c3 e8g8 e1g1 h7h6 c1e3 d7d6 e3c5 d6c5 h2h3 f6h5
info currmove d2d4 currmovenumber 2
info time 5000 nodes 3000000 nps 600000 cpuload 1000
info hashfull 56
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 17 seldepth 32 time 5422 nodes 3244903 nps 598470
info depth 18
info currmove e2e4 currmovenumber 1
info time 6000 nodes 3590000 nps 598333 cpuload 1000
info hashfull 67
info time 7016 nodes 4170000 nps 594356 cpuload 1000
info hashfull 78
info depth 18 seldepth 34 score cp 37 time 7203 nodes 4278017 pv e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5c6 d7c6 e1g1 d8f6 d2d4 e5d4 e4e5 f6g6 d1d4 c8g4
info currmove d2d4 currmovenumber 2
info time 8016 nodes 4780000 nps 596307 cpuload 1000
info hashfull 91
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info time 9016 nodes 5400000 nps 598935 cpuload 1000
info hashfull 104
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 18 seldepth 34 time 9406 nodes 5625600 nps 598086
info depth 19
info currmove e2e4 currmovenumber 1
info time 10016 nodes 6000000 nps 599042 cpuload 1000
info hashfull 115
info time 11016 nodes 6620000 nps 600944 cpuload 1000
info hashfull 127
info depth 19 seldepth 34 score cp 32 time 11250 nodes 6767269 pv e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5c6 d7c6 e1g1 d8d6 h2h3 g8e7 c2c3 e7g6 d2d4 c8e6 d4e5 d6d1 f1d1
info currmove d2d4 currmovenumber 2
info time 12016 nodes 7230000 nps 601698 cpuload 1000
info hashfull 139
info time 13016 nodes 7850000 nps 603104 cpuload 1000
info hashfull 152
info currmove d2d4 currmovenumber 2
info time 14016 nodes 8480000 nps 605023 cpuload 1000
info hashfull 165
info currmove g1f3 currmovenumber 3
info time 15016 nodes 9110000 nps 606686 cpuload 1000
info hashfull 178
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info time 16031 nodes 9740000 nps 607573 cpuload 1000
info hashfull 190
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 19 seldepth 34 time 16234 nodes 9862906 nps 607546
info depth 20
info currmove e2e4 currmovenumber 1
info time 17031 nodes 10340000 nps 607128 cpuload 1000
info hashfull 202
info time 18047 nodes 10950000 nps 606749 cpuload 1000
info hashfull 214
info time 19047 nodes 11570000 nps 607445 cpuload 1000
info hashfull 226
info depth 20 seldepth 34 score cp 22 time 19687 nodes 11963242 pv e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5a4 g8f6 e1g1 f8d6 c2c3 f6e4 d2d4 e8g8 a4c2 f7f5 c2b3 g8h8 d4e5
info currmove d2d4 currmovenumber 2
info time 20047 nodes 12190000 nps 608071 cpuload 1000
info hashfull 237
info currmove d2d4 currmovenumber 2
info time 21047 nodes 12810000 nps 608638 cpuload 1000
info hashfull 249
info time 22047 nodes 13450000 nps 610060 cpuload 1000
info hashfull 260
info time 23047 nodes 14060000 nps 610058 cpuload 1000
info hashfull 273
info time 24047 nodes 14700000 nps 611303 cpuload 1000
info hashfull 284
info depth 20 seldepth 38 score cp 30 time 24922 nodes 15256003 pv d2d4 g8f6 g1f3 e7e6 c2c4 d7d5 e2e3 f8e7 f1e2 d5c4 e2c4 e8g8 e1g1 c7c5 d4c5 e7c5 b1c3 d8c7 c3b5 c7b6 a2a4
info currmove g1f3 currmovenumber 3
info time 25047 nodes 15330000 nps 612049 cpuload 1000
info hashfull 295
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info time 26047 nodes 15950000 nps 612355 cpuload 1000
info hashfull 307
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 20 seldepth 38 time 26516 nodes 16236761 nps 612338
info time 26531 nodes 16236761 nps 611992 cpuload 1000
info hashfull 313
bestmove d2d4 ponder g8f6

Admin likes this post

Back to top Go down
Admin
Admin
Admin


Posts : 2608
Join date : 2020-11-17
Location : Netherlands

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptyMon Jan 31, 2022 8:16 am

Hi Eelco, can you post the changes?
Back to top Go down
http://rebel13.nl/
Eelco

Eelco


Posts : 232
Join date : 2021-10-08

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptyMon Jan 31, 2022 8:35 am

Hi Ed,

Good morning, by all means yes, I would love to do so, if the latest attempt does not crash I mean. The one from yesterday, did not crash, because the critical part was never called, as I was starting to post below:


It was still not working of course, only the Exclusion Search was never called... If it was, it would crash still at 13 ply deep. I should have known a 20 ply search is not equal to debugging. However I tried again and this also does not crash in the first 20 plies, and now it plays the variation I happened to be investigating for Eduard Nemeth's new opening book. This is about the only opening line I could remember, a favorite from Karpov - Korchnoi matches in the 70-ies. The Tarrasch variation of the French opening! With 6. Bb5 of the main line even, although 5. ...Nf6 was not the main line in Manilla I suppose. Fette Brezels and Blueberry yoghurt drunken !

https://en.wikipedia.org/wiki/French_Defence

Quote :

Tarrasch Variation: 3.Nd2

The Tarrasch Variation is named after Siegbert Tarrasch. This move became particularly popular during the 1970s and early 1980s when Anatoly Karpov used it to great effect. Though less aggressive than the alternate 3.Nc3, it is still used by top-level players seeking a small, safe advantage.

Like 3.Nc3, 3.Nd2 protects e4, but is different in several key respects: it does not block White's c-pawn from advancing, which means he can play c3 at some point to support his d4-pawn. Hence, it avoids the Winawer Variation as 3...Bb4 is now readily answered by 4.c3. On the other hand, 3.Nd2 develops the knight to an arguably less active square than 3.Nc3, and in addition, it hems in White's dark-square bishop. Hence, White will typically have to spend an extra tempo moving the knight from d2 at some point before developing said bishop.

3... c5 4. exd5 and now Black has two ways to recapture:
4... exd5 was a staple of many old Karpov–Korchnoi battles, including seven games in their 1974 match. It usually leads to Black having an isolated queen's pawn (see isolated pawn). The main line continues 5.Ngf3 Nc6 6.Bb5 Bd6 7.0-0 Nge7 8.dxc5 Bxc5 9.Nb3 Bb6 with a position where, if White can neutralise the activity of Black's pieces in the middlegame, he will have a slight advantage in the ending. Another possibility for White is 5.Bb5+ Bd7 (5...Nc6 is also possible) 6.Qe2+ Be7 7.dxc5 to trade off the bishops and make it more difficult for Black to regain the pawn.
4... Qxd5 is an important alternative for Black; the idea is to trade his c- and d-pawns for White's d- and e-pawns, leaving Black with an extra centre pawn. This constitutes a slight structural advantage, but in return White gains time for development by harassing Black's queen. This interplay of static and dynamic advantages is the reason why this line has become popular in the last decade. Play usually continues 5.Ngf3 cxd4 6.Bc4 Qd6 7.0-0 Nf6 (preventing 8.Ne4) 8.Nb3 Nc6 9.Nbxd4 Nxd4, and here White may stay in the middlegame with 10.Nxd4 or offer the trade of queens with 10.Qxd4, with the former far more commonly played today.
3... Nf6 While the objective of 3...c5 was to break open the centre, 3... Nf6 aims to close it. After 4. e5 Nfd7 5. Bd3 c5 6. c3 Nc6 (6...b6 intends ...Ba6 next to get rid of Black's "bad" light-square bishop, a recurring idea in the French) 7. Ne2 (leaving f3 open for the queen's knight) 7... cxd4 8. cxd4 f6 9. exf6 Nxf6 10. Nf3 Bd6 Black has freed his pieces at the cost of having a backward pawn on e6. White may also choose to preserve his pawn on e5 by playing 4.e5 Nfd7 5.c3 c5 6.f4 Nc6 7.Ndf3, but his development is slowed as a result, and Black will gain dynamic chances if he can open the position to advantage.
3... Nc6 is known as the Guimard Variation: after 4.Ngf3 Nf6 5.e5 Nd7 Black will exchange White's cramping e-pawn next move by ...f6. However, Black does not exert any pressure on d4 because he cannot play ...c5, so White should maintain a slight advantage, with 6.Be2 or 6 Nb3.
3... Be7 is known as the Morozevich Variation.[5] A fashionable line among top GMs in recent years, this odd-looking move aims to prove that every White move now has its drawbacks, e.g. after 4.Ngf3 Nf6 5.e5 Nfd7 White cannot play f4, whereas 4.Bd3 c5 5.dxc5 Nf6 and 4.e5 c5 5. Qg4 Kf8!? lead to obscure complications. 3...h6?!, with a similar rationale, has also gained some adventurous followers in recent years, including GM Alexander Morozevich.
Another rare line is 3... a6, which gained some popularity in the 1970s. Similar to 3...Be7, the idea is to play a waiting move to make White declare his intentions before Black commits to a plan of his own. 3...a6 also controls the b5-square, which is typically useful for Black in most French lines because, for example, White no longer has the option of playing Bb5.

Code:

Rebel 14.1 by Fabien Letouzey, Pawel Koziol, Chris Whittington and Ed Schroder
uci
id name Rebel 14.1
id author Fabien Letouzey, Pawel Koziol, Chris Whittington and Ed Schroder
option name Hash type spin default 128 min 4 max 1024
option name IIR Depth type spin default 6 min 3 max 99
option name NNUE Tuner type spin default 100 min 25 max 200
option name Lazy Eval type spin default 200 min 50 max 1000
option name Ponder type check default false
option name OwnBook type check default true
option name BookFile type string default book_small.bin
option name NullMove Pruning type combo default Fail High var Always var Fail High var Never
option name NullMove Reduction type spin default 3 min 1 max 3
option name Verification Search type combo default Endgame var Always var Endgame var Never
option name Verification Reduction type spin default 5 min 1 max 6
option name History Pruning type check default true
option name History Threshold type spin default 60 min 0 max 100
option name Quiescence Check Plies type spin default 1 min 0 max 2
option name Material type spin default 100 min 0 max 400
option name Piece Activity type spin default 100 min 0 max 400
option name King Safety type spin default 100 min 0 max 400
option name King Tropism type spin default 25 min 0 max 400
option name Pawn Structure type spin default 100 min 0 max 400
option name Passed Pawns type spin default 100 min 0 max 400
uciok
go depth 20
info depth 1
info depth 1 seldepth 1 score cp -87 time 0 nodes 2 pv b1a3
info depth 1 seldepth 1 score cp -46 time 0 nodes 3 pv b1c3
info depth 1 seldepth 1 score cp -23 time 0 nodes 4 pv g1f3
info depth 1 seldepth 1 time 0 nodes 21 nps 0
info depth 2
info depth 2 seldepth 2 score cp 47 time 16 nodes 45 pv g1f3 d7d5
info depth 2 seldepth 2 score cp 58 time 16 nodes 87 pv d2d4 d7d5
info depth 2 seldepth 2 time 16 nodes 105 nps 0
info depth 3
info depth 3 seldepth 7 score cp 6 time 16 nodes 194 pv d2d4 d7d5 e2e4
info depth 3 seldepth 7 time 16 nodes 486 nps 0
info depth 4
info depth 4 seldepth 8 score cp 55 time 31 nodes 1303 pv d2d4 c7c5 d4c5 d8a5 b1c3
info depth 4 seldepth 9 time 31 nodes 1699 nps 0
info depth 5
info depth 5 seldepth 10 score cp -2 time 31 nodes 4107 pv d2d4 d7d5 b1c3 c8f5 e2e4 d5e4
info depth 5 seldepth 11 score cp 23 time 47 nodes 7283 pv e2e4 c7c5 d2d4 g8f6 d4c5 f6e4
info depth 5 seldepth 11 time 47 nodes 8749 nps 0
info depth 6
info depth 6 seldepth 11 score cp 46 time 63 nodes 12723 pv e2e4 c7c5 b1c3 e7e6 g1f3 b8c6
info depth 6 seldepth 11 time 63 nodes 13214 nps 0
info depth 7
info depth 7 seldepth 15 score cp 37 time 94 nodes 29255 pv e2e4 c7c5 d2d3 g8f6 g1f3 d7d5
info depth 7 seldepth 15 time 109 nodes 37025 nps 0
info depth 8
info depth 8 seldepth 15 score cp 47 time 141 nodes 56303 pv e2e4 c7c5 g1f3 e7e6 b1c3 b8c6 f1b5 f8e7 b5c6 b7c6
info depth 8 seldepth 15 time 141 nodes 58007 nps 0
info depth 9
info depth 9 seldepth 18 score cp 42 time 219 nodes 104487 pv e2e4 e7e5 g1f3 b8c6 b1c3 g8f6 d2d4 e5d4 f3d4 f8b4 d4c6 b7c6
info depth 9 seldepth 18 time 234 nodes 112444 nps 0
info depth 10
info depth 10 seldepth 21 score cp 42 time 266 nodes 135267 pv e2e4 e7e5 g1f3 b8c6 b1c3 g8f6 d2d4 e5d4 f3d4 f8b4 d4c6 b7c6
info depth 10 seldepth 21 time 313 nodes 160304 nps 0
info depth 11
info depth 11 seldepth 28 score cp 27 time 391 nodes 212034 pv e2e4 e7e5 g1f3 b8c6 f1b5 g8f6 e1g1 f8e7 b1c3 a7a6 b5c6 d7c6 f3e5
info depth 11 seldepth 28 time 484 nodes 268946 nps 0
info depth 12
info depth 12 seldepth 28 score cp 32 time 703 nodes 409098 pv e2e4 e7e5 g1f3 b8c6 b1c3 g8f6 d2d4 f8b4 d4d5 f6e4 d5c6 e4c3 b2c3 b4c3 c1d2 c3a1 c6d7 c8d7 d1a1
info depth 12 seldepth 28 time 781 nodes 450013 nps 0
info depth 13
info depth 13 seldepth 28 score cp 32 time 984 nodes 569268 pv e2e4 e7e5 g1f3 b8c6 b1c3 g8f6 d2d4 f8b4 d4d5 c6e7 f1d3 d7d6 e1g1 b4c3 b2c3
info time 1000 nodes 580000 nps 580000 cpuload 1000
info hashfull 10
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 13 seldepth 28 time 1141 nodes 650547 nps 570155
info depth 14
info currmove e2e4 currmovenumber 1
info depth 14 seldepth 29 score cp 41 time 1469 nodes 845553 pv e2e4 e7e5 g1f3 b8c6 b1c3 g8f6 d2d4 f8b4 d4d5 c6e7 f1d3 d7d6 e1g1 e7g6 d3b5 c8d7 b5d7 d8d7
info currmove d2d4 currmovenumber 2
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 14 seldepth 29 time 1672 nodes 956232 nps 571909
info depth 15
info currmove e2e4 currmovenumber 1
info time 2000 nodes 1150000 nps 575000 cpuload 1000
info hashfull 20
info depth 15 seldepth 30 score cp 66 time 2734 nodes 1593130 pv e2e4 e7e5 g1f3 b8c6 f1b5 f8d6 e1g1 a7a6 b5e2 g8f6 d2d3 e8g8 c2c3 h7h6
info currmove d2d4 currmovenumber 2
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 15 seldepth 30 time 2922 nodes 1685344 nps 576778
info depth 16
info currmove e2e4 currmovenumber 1
info time 3000 nodes 1730000 nps 576667 cpuload 999
info hashfull 32
info time 4000 nodes 2320000 nps 580000 cpuload 1000
info hashfull 45
info depth 16 seldepth 36 score cp 26 time 4828 nodes 2824972 pv e2e4 e7e5 g1f3 b8c6 f1b5 a7a6 b5c6 d7c6 e1g1 f8d6 d2d4 e5d4 d1d4 f7f6 b1d2 g8e7 d2c4 c8e6 c4d6 d8d6 d4c3 e8c8
info currmove d2d4 currmovenumber 2
info time 5000 nodes 2930000 nps 586000 cpuload 1000
info hashfull 58
info currmove d2d4 currmovenumber 2
info time 6000 nodes 3550000 nps 591667 cpuload 1000
info hashfull 71
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info time 7000 nodes 4170000 nps 595714 cpuload 1000
info hashfull 84
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 16 seldepth 36 time 7297 nodes 4338680 nps 594584
info depth 17
info currmove e2e4 currmovenumber 1
info time 8000 nodes 4760000 nps 595000 cpuload 1000
info hashfull 95
info depth 17 seldepth 36 score cp 36 time 8406 nodes 5015396 pv e2e4 e7e5 g1f3 b8c6 f1c4 g8f6 d2d3 f8c5 c2c3 c5b6 e1g1 d7d6 a2a4 e8g8 h2h3 c6e7
info currmove d2d4 currmovenumber 2
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info time 9000 nodes 5360000 nps 595556 cpuload 1000
info hashfull 106
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 17 seldepth 36 time 9125 nodes 5432157 nps 595305
info depth 18
info currmove e2e4 currmovenumber 1
info time 10000 nodes 5950000 nps 595000 cpuload 1000
info hashfull 118
info time 11000 nodes 6560000 nps 596364 cpuload 1000
info hashfull 130
info depth 18 seldepth 36 score cp 30 time 11891 nodes 7126632 pv e2e4 e7e5 g1f3 b8c6 f1c4 g8f6 d2d3 f8c5 c2c3 d7d6 e1g1 c5b6 a2a4 e8g8 h2h3 h7h6 b1a3 f6h5
info currmove d2d4 currmovenumber 2
info time 12000 nodes 7190000 nps 599167 cpuload 1000
info hashfull 142
info time 13000 nodes 7810000 nps 600769 cpuload 1000
info hashfull 156
info currmove d2d4 currmovenumber 2
info time 14000 nodes 8440000 nps 602857 cpuload 1000
info hashfull 168
info time 15000 nodes 9080000 nps 605333 cpuload 1000
info hashfull 179
info time 16000 nodes 9730000 nps 608125 cpuload 1000
info hashfull 191
info depth 18 seldepth 36 score cp 36 time 16656 nodes 10144640 pv d2d4 d7d5 g1f3 g8f6 e2e3 e7e6 c2c4 c7c5 b1c3 f8e7 f1e2 d5c4 e2c4 e8g8 e1g1 h7h6 d4c5 e7c5 d1c2 b8c6 f1d1
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info time 17000 nodes 10350000 nps 608824 cpuload 1000
info hashfull 203
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 18 seldepth 36 time 17641 nodes 10723811 nps 607891
info depth 19
info currmove d2d4 currmovenumber 1
info time 18000 nodes 10940000 nps 607778 cpuload 1000
info hashfull 214
info time 19000 nodes 11570000 nps 608947 cpuload 1000
info hashfull 225
info time 20000 nodes 12190000 nps 609500 cpuload 1000
info hashfull 237
info time 21000 nodes 12810000 nps 610000 cpuload 1000
info hashfull 249
info depth 19 seldepth 36 score cp 36 time 21328 nodes 13006097 pv d2d4 d7d5 g1f3 g8f6 e2e3 e7e6 c2c4 c7c5 f1e2 f8e7 b1c3 d5c4 e2c4 e8g8 e1g1 h7h6 d4c5 e7c5 d1c2 b8c6 f1d1
info currmove e2e4 currmovenumber 2
info time 22000 nodes 13410000 nps 609545 cpuload 1000
info hashfull 261
info currmove e2e4 currmovenumber 2
info time 23016 nodes 14050000 nps 610445 cpuload 1000
info hashfull 272
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info time 24016 nodes 14660000 nps 610426 cpuload 1000
info hashfull 284
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info time 25016 nodes 15270000 nps 610409 cpuload 1000
info hashfull 296
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 19 seldepth 36 time 25125 nodes 15323964 nps 609909
info depth 20
info currmove d2d4 currmovenumber 1
info time 26016 nodes 15880000 nps 610394 cpuload 1000
info hashfull 307
info time 27016 nodes 16510000 nps 611119 cpuload 1000
info hashfull 317
info time 28016 nodes 17160000 nps 612507 cpuload 1000
info hashfull 329
info time 29016 nodes 17790000 nps 613110 cpuload 1000
info hashfull 340
info time 30016 nodes 18420000 nps 613673 cpuload 1000
info hashfull 351
info time 31016 nodes 19060000 nps 614522 cpuload 1000
info hashfull 363
info time 32016 nodes 19700000 nps 615317 cpuload 1000
info hashfull 374
info time 33016 nodes 20320000 nps 615459 cpuload 1000
info hashfull 386
info time 34016 nodes 20940000 nps 615593 cpuload 1000
info hashfull 398
info time 35016 nodes 21570000 nps 616004 cpuload 1000
info hashfull 409
info time 36016 nodes 22200000 nps 616393 cpuload 1000
info hashfull 420
info time 37016 nodes 22830000 nps 616760 cpuload 1000
info hashfull 431
info time 38016 nodes 23440000 nps 616582 cpuload 1000
info hashfull 442
info depth 20 seldepth 39 score cp 22 time 38781 nodes 23913297 pv d2d4 d7d5 g1f3 g8f6 c2c4 e7e6 b1c3 c7c5 c1g5 c5d4 f3d4 d8b6 d1d2 d5c4 g5f6 g7f6 e2e3 b8c6 f1c4 c6d4 e3d4
info currmove e2e4 currmovenumber 2
info time 39016 nodes 24060000 nps 616670 cpuload 1000
info hashfull 453
info currmove e2e4 currmovenumber 2
info time 40016 nodes 24680000 nps 616753 cpuload 1000
info hashfull 463
info time 41016 nodes 25310000 nps 617076 cpuload 1000
info hashfull 475
info time 42016 nodes 25920000 nps 616908 cpuload 1000
info hashfull 487
info time 43016 nodes 26520000 nps 616515 cpuload 1000
info hashfull 497
info time 44016 nodes 27130000 nps 616367 cpuload 1000
info hashfull 508
info time 45016 nodes 27750000 nps 616447 cpuload 1000
info hashfull 519
info time 46016 nodes 28350000 nps 616090 cpuload 1000
info hashfull 530
info time 47016 nodes 28960000 nps 615961 cpuload 1000
info hashfull 541
info time 48016 nodes 29570000 nps 615836 cpuload 1000
info hashfull 551
info time 49016 nodes 30170000 nps 615513 cpuload 1000
info hashfull 561
info time 50016 nodes 30780000 nps 615403 cpuload 1000
info hashfull 571
info time 51016 nodes 31410000 nps 615689 cpuload 1000
info hashfull 580
info time 52016 nodes 32020000 nps 615580 cpuload 1000
info hashfull 591
info time 53016 nodes 32650000 nps 615852 cpuload 1000
info hashfull 603
info time 54016 nodes 33260000 nps 615743 cpuload 1000
info hashfull 613
info time 55016 nodes 33880000 nps 615821 cpuload 1000
info hashfull 624
info time 56016 nodes 34520000 nps 616252 cpuload 1000
info hashfull 634
info time 57016 nodes 35160000 nps 616669 cpuload 1000
info hashfull 643
info time 58016 nodes 35800000 nps 617071 cpuload 1000
info hashfull 652
info depth 20 seldepth 39 score cp 36 time 58156 nodes 35886544 pv e2e4 e7e6 d2d4 d7d5 b1d2 c7c5 e4d5 e6d5 g1f3 g8f6 f1b5 c8d7 b5d7 b8d7 e1g1 f8e7 f1e1 e8g8 d2f1 c5d4 f3d4 f8e8 h2h3 e7c5 e1e8 d8e8 d4f5
info currmove g1f3 currmovenumber 3
info currmove b1c3 currmovenumber 4
info currmove d2d3 currmovenumber 5
info currmove a2a3 currmovenumber 6
info currmove c2c3 currmovenumber 7
info currmove h2h3 currmovenumber 8
info currmove c2c4 currmovenumber 9
info time 59031 nodes 36420000 nps 616964 cpuload 1000
info hashfull 661
info currmove b2b3 currmovenumber 10
info currmove g2g3 currmovenumber 11
info currmove a2a4 currmovenumber 12
info currmove h2h4 currmovenumber 13
info currmove e2e3 currmovenumber 14
info currmove b1a3 currmovenumber 15
info currmove f2f4 currmovenumber 16
info currmove g1h3 currmovenumber 17
info currmove f2f3 currmovenumber 18
info currmove b2b4 currmovenumber 19
info currmove g2g4 currmovenumber 20
info depth 20 seldepth 39 time 59734 nodes 36850706 nps 616913
info time 59750 nodes 36850706 nps 616748 cpuload 1000
info hashfull 666
bestmove e2e4 ponder e7e6

Version 029 of  the search, sorry it is messy and a lot of commented out code. I would attach the file but max size is 0 Mb, did not work:
Code:

// search_full.cpp

// includes

#define IIR      1      // 0=IID   | 1=IIR

#include <math.h>

#include "attack.h"
#include "board.h"
#include "colour.h"
#include "eval.h"
#include "list.h"
#include "move.h"
#include "move_check.h"
#include "move_do.h"
#include "option.h"
#include "piece.h"
#include "pst.h"
#include "pv.h"
#include "recog.h"
#include "search.h"
#include "search_full.h"
#include "see.h"
#include "sort.h"
#include "trans.h"
#include "util.h"
#include "value.h"

#include "nnue.h"
#include "globals.h"

void Nnue_Housekeeping(board_t* board, int move, undo_t* undo, int nply);

// constants and variables

// main search

static const bool UseDistancePruning = true;

// transposition table

static const bool UseTrans = true;
static const int TransDepth = 1;

static const bool UseMateValues = true; // use mate values from shallower searches?

// null move

static /* const */ bool UseNull = true;
static /* const */ bool UseNullEval = true; // true
static const int NullDepth = 2;
static /* const */ int NullReduction = 3;

static /* const */ bool UseVer = true;
static /* const */ bool UseVerEndgame = true; // true
static /* const */ int VerReduction = 5; // was 3

// move ordering

static const bool UseIID = true;
static /*/const*/ int IIDDepth = 6;          // @ed - org = 3
static const int IIDReduction = 2;

static int lazy_eval = 200;                 // @ed

// extensions

static const bool ExtendSingleReply = true; // true

// history pruning

static /* const */ bool UseHistory = true;
static const int HistoryDepth = 3;
static const int HistoryMoveNb = 3;
static /* const */ int HistoryValue = 9830; // 60%
static const bool HistoryReSearch = true;

// quiescence search

static /* const */ bool UseDelta = true; // false
static /* const */ int DeltaMargin = 50; // TODO: tune me!

static /* const */ int CheckNb = 1;
static /* const */ int CheckDepth = 0; // 1 - CheckNb

// misc

static const int NodeAll = -1;
static const int NodePV  =  0;
static const int NodeCut = +1;

// lmr

int lmr_pv[256][256];
int lmr_zw[256][256];

// macros

#define NODE_OPP(type)     (-(type))
#define DEPTH_MATCH(d1,d2) ((d1)>=(d2))
#define Min(x, y)          ((x) < (y) ? (x) : (y))
#define Max(x, y)          ((x) > (y) ? (x) : (y))

// prototypes

static int  full_root            (list_t * list, board_t * board, int alpha, int beta, int depth, int height, int search_type);

static int  full_search          (board_t * board, int alpha, int beta, int depth, int height, mv_t pv[], int node_type, int was_null);
static int  full_no_null         (board_t * board, int alpha, int beta, int depth, int height, mv_t pv[], int node_type, int trans_move, int * best_move, int excluded_move);

static int  full_quiescence      (board_t * board, int alpha, int beta, int depth, int height, mv_t pv[]);

static int  full_new_depth       (int depth, int move, board_t * board, bool single_reply, bool in_pv);

static bool do_null              (const board_t * board);
static bool do_ver               (const board_t * board);

static void pv_fill              (const mv_t pv[], board_t * board);

static bool move_is_dangerous    (int move, const board_t * board);
static bool capture_is_dangerous (int move, const board_t * board);

static bool simple_stalemate     (const board_t * board);

// functions

// search_full_init()

void search_full_init(list_t * list, board_t * board) {

   const char * string;
   int trans_move, trans_min_depth, trans_max_depth, trans_min_value, trans_max_value;

   ASSERT(list_is_ok(list));
   ASSERT(board_is_ok(board));

   // null-move options

   string = option_get_string("NullMove Pruning");

   if (false) {
   } else if (my_string_equal(string,"Always")) {
      UseNull = true;
      UseNullEval = false;
   } else if (my_string_equal(string,"Fail High")) {
      UseNull = true;
      UseNullEval = true;
   } else if (my_string_equal(string,"Never")) {
      UseNull = false;
      UseNullEval = false;
   } else {
      ASSERT(false);
      UseNull = true;
      UseNullEval = true;
   }

   NullReduction = option_get_int("NullMove Reduction");

   string = option_get_string("Verification Search");

   if (false) {
   } else if (my_string_equal(string,"Always")) {
      UseVer = true;
      UseVerEndgame = false;
   } else if (my_string_equal(string,"Endgame")) {
      UseVer = true;
      UseVerEndgame = true;
   } else if (my_string_equal(string,"Never")) {
      UseVer = false;
      UseVerEndgame = false;
   } else {
      ASSERT(false);
      UseVer = true;
      UseVerEndgame = true;
   }

   VerReduction = option_get_int("Verification Reduction");

   // history-pruning options

   UseHistory = option_get_bool("History Pruning");
   HistoryValue = (option_get_int("History Threshold") * 16384 + 50) / 100;

   // quiescence-search options

   CheckNb = option_get_int("Quiescence Check Plies");
   CheckDepth = 1 - CheckNb;

   // Ed stuff
  
   IIDDepth = option_get_int("IIR Depth");
   lazy_eval = option_get_int("Lazy Eval");

   // late move reduction

   double r;

   for (int dp = 0; dp < 256; dp++)
      for (int mv = 0; mv < 256; mv++) {

         r = log((double)dp) * log((double)Min(mv, 63)) / 2;
         if (r < 0.80) r = 0;

         lmr_zw[dp][mv] = (int)r;             // zero window node
         lmr_pv[dp][mv] = (int)Max(r - 1, 0); // principal variation node

         if (lmr_pv[dp][mv] < 1) lmr_pv[dp][mv] = 0; // ultra-small reductions make no sense
         if (lmr_pv[dp][mv] < 1) lmr_pv[dp][mv] = 0;

         if (lmr_pv[dp][mv] > dp - 1) lmr_pv[dp][mv] = dp - 1; // don't exceed actual depth
         if (lmr_zw[dp][mv] > dp - 1) lmr_zw[dp][mv] = dp - 1;  
   }

   // standard sort

   list_note(list);
   list_sort(list);

   // basic sort

   trans_move = MoveNone;
   if (UseTrans) trans_retrieve(Trans,board->key,&trans_move,&trans_min_depth,&trans_max_depth,&trans_min_value,&trans_max_value);

   note_moves(list,board,0,trans_move);
   list_sort(list);
}

// search_full_root()

int search_full_root(list_t * list, board_t * board, int depth, int search_type) {

   int value;

   ASSERT(list_is_ok(list));
   ASSERT(board_is_ok(board));
   ASSERT(depth_is_ok(depth));
   ASSERT(search_type==SearchNormal||search_type==SearchShort);

   ASSERT(list==SearchRoot->list);
   ASSERT(!LIST_IS_EMPTY(list));
   ASSERT(board==SearchCurrent->board);
   ASSERT(board_is_legal(board));
   ASSERT(depth>=1);

   value = full_root(list,board,-ValueInf,+ValueInf,depth,0,search_type);

   ASSERT(value_is_ok(value));
   ASSERT(LIST_VALUE(list,0)==value);

   return value;
}

// full_root()

static int full_root(list_t * list, board_t * board, int alpha, int beta, int depth, int height, int search_type) {

   int old_alpha;
   int value, best_value;
   int i, move;
   int new_depth;
   undo_t undo[1];
   mv_t new_pv[HeightMax];

   ASSERT(list_is_ok(list));
   ASSERT(board_is_ok(board));
   ASSERT(range_is_ok(alpha,beta));
   ASSERT(depth_is_ok(depth));
   ASSERT(height_is_ok(height));
   ASSERT(search_type==SearchNormal||search_type==SearchShort);

   ASSERT(list==SearchRoot->list);
   ASSERT(!LIST_IS_EMPTY(list));
   ASSERT(board==SearchCurrent->board);
   ASSERT(board_is_legal(board));
   ASSERT(depth>=1);

   // init

   SearchCurrent->node_nb++;
   SearchInfo->check_nb--;

   for (i = 0; i < LIST_SIZE(list); i++) list->value[i] = ValueNone;

   old_alpha = alpha;
   best_value = ValueNone;

   // move loop

   for (i = 0; i < LIST_SIZE(list); i++) {

      move = LIST_MOVE(list,i);

      SearchRoot->depth = depth;
      SearchRoot->move = move;
      SearchRoot->move_pos = i;
      SearchRoot->move_nb = LIST_SIZE(list);

      search_update_root();

      new_depth = full_new_depth(depth,move,board,board_is_check(board)&&LIST_SIZE(list)==1,true);

      Nnue_Housekeeping(board, move, undo, height); // @Chris

      move_do(board, move, undo);

      if (search_type == SearchShort || best_value == ValueNone) { // first move
         value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NodePV, 0);
      } else { // other moves
         value = -full_search(board,-alpha-1,-alpha,new_depth,height+1,new_pv,NodeCut, 0);
         if (value > alpha) { // && value < beta
            SearchRoot->change = true;
            SearchRoot->easy = false;
            SearchRoot->flag = false;
            search_update_root();
            value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NodePV, 0);
         }
      }

      move_undo(board,move,undo);

      if (value <= alpha) { // upper bound
         list->value[i] = old_alpha;
      } else if (value >= beta) { // lower bound
         list->value[i] = beta;
      } else { // alpha < value < beta => exact value
         list->value[i] = value;
      }

      if (value > best_value && (best_value == ValueNone || value > alpha)) {

         SearchBest->move = move;
         SearchBest->value = value;
         if (value <= alpha) { // upper bound
            SearchBest->flags = SearchUpper;
         } else if (value >= beta) { // lower bound
            SearchBest->flags = SearchLower;
         } else { // alpha < value < beta => exact value
            SearchBest->flags = SearchExact;
         }
         SearchBest->depth = depth;
         pv_cat(SearchBest->pv,new_pv,move);

         search_update_best();
      }

      if (value > best_value) {
         best_value = value;
         if (value > alpha) {
            if (search_type == SearchNormal) alpha = value;
            if (value >= beta) break;
         }
      }
   }

   ASSERT(value_is_ok(best_value));

   list_sort(list);

   ASSERT(SearchBest->move==LIST_MOVE(list,0));
   ASSERT(SearchBest->value==best_value);

   if (UseTrans && best_value > old_alpha && best_value < beta) {
      pv_fill(SearchBest->pv,board);
   }

   return best_value;
}

// full_search()

static int full_search(board_t * board, int alpha, int beta, int depth, int height, mv_t pv[], int node_type, int was_null) {

   bool in_check;
   bool single_reply;
   int trans_move, trans_depth, trans_min_depth, trans_max_depth, trans_min_value, trans_max_value;
   int min_value, max_value;
   int old_alpha;
   int value, best_value, exclusion_value;
   int move, best_move;
   int new_depth;
   int played_nb, quiet_nb;
   int i;
   int opt_value;
   bool flag_reduced, flag_singular, verification_fail_low = false;
   int reduction;
   attack_t attack[1];
   sort_t sort[1];
   undo_t undo[1];
   mv_t new_pv[HeightMax];
   mv_t played[256];

   ASSERT(board!=NULL);
   ASSERT(range_is_ok(alpha,beta));
   ASSERT(depth_is_ok(depth));
   ASSERT(height_is_ok(height));
   ASSERT(pv!=NULL);
   ASSERT(node_type==NodePV||node_type==NodeCut||node_type==NodeAll);

   ASSERT(board_is_legal(board));

   // horizon?

   if (depth <= 0) return full_quiescence(board,alpha,beta,0,height,pv);

   // init

   SearchCurrent->node_nb++;
   SearchInfo->check_nb--;
   PV_CLEAR(pv);

   if (height > SearchCurrent->max_depth) SearchCurrent->max_depth = height;

   if (SearchInfo->check_nb <= 0) {
      SearchInfo->check_nb += SearchInfo->check_inc;
      search_check();
   }

   // draw?

   if (board_is_repetition(board) || recog_draw(board)) return ValueDraw;

   // mate-distance pruning

   if (UseDistancePruning) {

      // lower bound

      value = VALUE_MATE(height+2); // does not work if the current position is mate
      if (value > alpha && board_is_mate(board)) value = VALUE_MATE(height);

      if (value > alpha) {
         alpha = value;
         if (value >= beta) return value;
      }

      // upper bound

      value = -VALUE_MATE(height+1);

      if (value < beta) {
         beta = value;
         if (value <= alpha) return value;
      }
   }

   // transposition table

   trans_move = MoveNone;

   if (UseTrans && depth >= TransDepth) {

      if (trans_retrieve(Trans,board->key,&trans_move,&trans_min_depth,&trans_max_depth,&trans_min_value,&trans_max_value)) {

         // trans_move is now updated

         if (node_type != NodePV) {

            if (UseMateValues) {

               if (trans_min_value > +ValueEvalInf && trans_min_depth < depth) {
                  trans_min_depth = depth;
               }

               if (trans_max_value < -ValueEvalInf && trans_max_depth < depth) {
                  trans_max_depth = depth;
               }
            }

            min_value = -ValueInf;

            if (DEPTH_MATCH(trans_min_depth,depth)) {
               min_value = value_from_trans(trans_min_value,height);
               if (min_value >= beta) return min_value;
            }

            max_value = +ValueInf;

            if (DEPTH_MATCH(trans_max_depth,depth)) {
               max_value = value_from_trans(trans_max_value,height);
               if (max_value <= alpha) return max_value;
            }

            if (min_value == max_value) return min_value; // exact match
         }
      }
   }

   // height limit

   if (height >= HeightMax-1) return eval(board, height);

   // more init

   old_alpha = alpha;
   best_value = ValueNone;
   best_move = MoveNone;
   played_nb = 0;
   quiet_nb = 0;

   attack_set(attack,board);
   in_check = ATTACK_IN_CHECK(attack);

   // static null move / beta pruning    

//   if (!in_check                                // old
//   && !value_is_mate(beta)
//   && do_null(board)
//   && !was_null
//   && node_type != NodePV
//   && depth <= 3) {
//   int sc = eval(board, height) - 120 * depth; // TODO: Tune me!
//   if (sc > beta) return sc;   }
  
   if (!in_check                                  // @ed
       && !value_is_mate(beta)
       && do_null(board)
       && !was_null
       && node_type != NodePV
       && depth <= 6) {
       int sc = eval(board, height) - 90 * depth; // TODO: Tune me!
       if (sc > beta) return sc;  }
  

   // null-move pruning

   if (UseNull
   && depth >= NullDepth
   && node_type != NodePV
   && !was_null) {

      if (!in_check
      && !value_is_mate(beta)
      && do_null(board)
      && (!UseNullEval || depth <= NullReduction+1 || eval(board, height) >= beta)) {

         // null-move search

 new_depth = depth - ((823 + 67 * depth) / 256); // calculate reduction - simplified Stockfish formula

         Nnue_Housekeeping(board, 0, undo, height); // @Chris
         move_do_null(board,undo);
         value = -full_search(board,-beta,-beta+1,new_depth,height+1,new_pv,NODE_OPP(node_type), 1);
         move_undo_null(board,undo);

         // verification search

         if (UseVer && depth > VerReduction) {

            if (value >= beta && (!UseVerEndgame || do_ver(board))) {

               new_depth = depth - VerReduction;
               ASSERT(new_depth>0);

               value = full_no_null(board,alpha,beta,new_depth,height,new_pv,NodeCut,trans_move,&move,MoveNone);

               if (value >= beta) {
                  ASSERT(move==new_pv[0]);
                  played[played_nb++] = move;
                  best_move = move;
                  best_value = value;
                  pv_copy(pv,new_pv);
                  goto cut;
               }
   else
   verification_fail_low = true;
            }
         }

         // pruning

         if (value >= beta) {

            if (value > +ValueEvalInf) value = +ValueEvalInf; // do not return unproven mates
            ASSERT(!value_is_mate(value));

            // pv_cat(pv,new_pv,MoveNull);

            best_move = MoveNone;
            best_value = value;
            goto cut;
         }
      }
   }

   // Razoring

   if (node_type != NodePV
   && !in_check
   && trans_move == MoveNone    
   && do_null(board)
   && !was_null
   && depth <= 3
   && !value_is_mate(beta)) {
   // TODO: no razoring in positions with pawns about to promote
   int threshold = beta - 300 - (depth - 1) * 60;
   if (eval(board, height) < threshold){
   value = full_quiescence(board, threshold - 1, threshold, 0, height, pv);
   if (value < threshold) // corrected - was < beta which is too risky at depth > 1
   return value;
   }
   }

   #if IIR==0
   // Internal Iterative Deepening
   if (UseIID && depth >= IIDDepth && node_type == NodePV && trans_move == MoveNone) {
      new_depth = depth - IIDReduction;
      ASSERT(new_depth>0);
      value = full_search(board,alpha,beta,new_depth,height,new_pv,node_type, 0);
      if (value <= alpha) value = full_search(board,-ValueInf,beta,new_depth,height,new_pv,node_type, 0);
      trans_move = new_pv[0]; }
   #endif

   #if IIR
   // Internal Iterative Reduction  
   if (UseIID && depth >= IIDDepth && trans_move == MoveNone)  depth--;
   #endif
  
   flag_singular = false;      
  
   if (    trans_move != MoveNone
       &&  ExtendSingleReply
   && !verification_fail_low
   &&  depth > 4
   &&  value_from_trans(trans_min_value,height) > alpha
   &&  value_from_trans(trans_min_value,height) - 20 - depth >  - ValueQueen
   &&  trans_min_depth >= depth - 3) {  
   int alpha_new = value_from_trans(trans_min_value,height) - 20 - depth;
   exclusion_value = full_no_null(board,alpha_new,alpha_new + 1,depth / 2,height,new_pv,NodeCut, trans_move, &move, trans_move);
   if (exclusion_value <= alpha_new)
   flag_singular = true;
  // new_depth++;
  // else if (exclusion_value >= beta) {
              //  ASSERT(move==new_pv[0]);
              //  played[played_nb++] = move;
              //  best_move = move;
              //  best_value = value;
              //  pv_copy(pv,new_pv);
              //  goto cut;
              // }
   } // Singular Extension

   // move generation

   sort_init(sort,board,attack,depth,height,trans_move);

   single_reply = false;
   if (in_check && LIST_SIZE(sort->list) == 1) single_reply = true; // HACK
   // if (LIST_SIZE(sort->list) == 1) single_reply = true; // HACK

   // move loop

   opt_value = +ValueInf;

   while ((move=sort_next(sort)) != MoveNone) {

      // extensions
  
  new_depth = full_new_depth(depth,move,board,single_reply,node_type==NodePV);
  
  if (move == trans_move && move != MoveNone && flag_singular)
  new_depth++;
  /*
  && !in_check
  && !single_reply
  &&  ExtendSingleReply
  && !verification_fail_low
  // &&  node_type!=NodePV
  // && !was_null
  // &&  LIST_SIZE(sort->list) != 1
  // &&  alpha - 200 - depth > - ValueQueen
  &&  new_depth < depth
  &&  new_depth > 4
  &&  value_from_trans(trans_min_value,height) > alpha
  &&  value_from_trans(trans_min_value,height) - 20 - depth >  - ValueQueen
  &&  trans_min_depth >= depth - 3) {
  
  int alpha_new = value_from_trans(trans_min_value,height) - 20 - depth;
  exclusion_value = full_no_null(board,alpha_new,alpha_new + 1,new_depth / 2,height,new_pv,NodeCut, trans_move, &move, MoveNone);
  if (exclusion_value <= alpha_new)
  new_depth++;
  // else if (exclusion_value >= beta) {
              //  ASSERT(move==new_pv[0]);
              //  played[played_nb++] = move;
              //  best_move = move;
              //  best_value = value;
              //  pv_copy(pv,new_pv);
              //  goto cut;
              // }
  } // Singular Extension
  if (new_depth >= depth)
  flag_extended = true;
  */
  
  

      // late move pruning

      if (!in_check
      && new_depth < depth
      && new_depth < 4
      && node_type != NodePV
      && !move_is_tactical(move, board)
      && !move_is_dangerous(move, board)) {

          ASSERT(!move_is_check(move, board));
          quiet_nb++;
          value = sort->value; // history score
          if (quiet_nb > depth / 4 + 1
  && value < HistoryValue) // useful
  continue;
      }

      // history pruning / late move reduction

      flag_reduced = false;
  reduction = 0;

      if (UseHistory
      && depth >= HistoryDepth
  && (move != trans_move)
  && (!move_is_tactical(move, board))
  && (!move_is_check(move, board))
      /*&& node_type != NodePV*/) {
         if (!in_check
         && played_nb >= HistoryMoveNb
         && new_depth < depth) {
            ASSERT(best_value!=ValueNone);
            ASSERT(played_nb>0);
            ASSERT(sort->pos>0&&move==LIST_MOVE(sort->list,sort->pos-1));
            //value = sort->value; // history score
            //if (value < HistoryValue) { // useless
               ASSERT(value>=0&&value<16384);
               ASSERT(move!=trans_move);
               ASSERT(!move_is_tactical(move,board));
               ASSERT(!move_is_check(move,board));
   if (node_type == NodePV) reduction = lmr_pv[depth][played_nb];
   else                     reduction = lmr_zw[depth][played_nb];
   new_depth -= reduction;
               if (reduction > 0) flag_reduced = true;
            //}
         }
      }

      // futility pruning

      if (depth <= 6 && node_type != NodePV) {

         if (!in_check
         && new_depth == depth-1
 && !move_is_check(move, board)
         && !move_is_tactical(move,board)
         && !move_is_dangerous(move,board)) {

            // optimistic evaluation

            if (opt_value == +ValueInf) {
               opt_value = eval(board, height) + 50 + 50 * depth;
               ASSERT(opt_value<+ValueInf);
            }

            value = opt_value;

            // pruning

            if (value <= alpha) {

               if (value > best_value) {
                  best_value = value;
                  PV_CLEAR(pv);
               }

               continue;
            }
         }
      }

      // recursive search
      Nnue_Housekeeping(board, move, undo, height); // @Chris
      move_do(board,move,undo);

      if (node_type != NodePV || best_value == ValueNone) { // first move
         value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NODE_OPP(node_type), 0);
      } else { // other moves
         value = -full_search(board,-alpha-1,-alpha,new_depth,height+1,new_pv,NodeCut, 0);
         if (value > alpha) { // && value < beta
 if (flag_singular && value > alpha + 10 && value < beta && new_depth < depth && depth > 10 && height < 10)
 value = -full_search(board,-beta,-alpha,new_depth+1,height+1,new_pv,NodePV, 0);
 else
 value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NodePV, 0);
         }
      }

      // late move reduction re-search

      if (HistoryReSearch
  && flag_reduced
  && value >= beta) {

         ASSERT(node_type!=NodePV);

         new_depth += reduction;
         ASSERT(new_depth==depth-1);

         value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NODE_OPP(node_type), 0);
      }

      move_undo(board,move,undo);

      played[played_nb++] = move;

  if (value > best_value) {
         best_value = value;
         pv_cat(pv,new_pv,move);
         if (value > alpha) {
            alpha = value;
            best_move = move;
            if (value >= beta) goto cut;
         }
      }

      if (node_type == NodeCut) node_type = NodeAll;
   }

   // ALL node

   if (best_value == ValueNone) { // no legal move
      if (in_check) {
         ASSERT(board_is_mate(board));
         return VALUE_MATE(height);
      } else {
         ASSERT(board_is_stalemate(board));
         return ValueDraw;
      }
   }

cut:

   ASSERT(value_is_ok(best_value));

   // move ordering

   if (best_move != MoveNone) {

      good_move(best_move,board,depth,height);

      if (best_value >= beta && !move_is_tactical(best_move,board)) {

         ASSERT(played_nb>0&&played[played_nb-1]==best_move);

         for (i = 0; i < played_nb-1; i++) {
            move = played[i];
            ASSERT(move!=best_move);
            history_bad(move,board);
         }

         history_good(best_move,board);
      }
   }

   // transposition table

   if (UseTrans && depth >= TransDepth) {

      trans_move = best_move;
      trans_depth = depth;
      trans_min_value = (best_value > old_alpha) ? value_to_trans(best_value,height) : -ValueInf;
      trans_max_value = (best_value < beta)      ? value_to_trans(best_value,height) : +ValueInf;

      trans_store(Trans,board->key,trans_move,trans_depth,trans_min_value,trans_max_value);
   }

   return best_value;
}

// full_no_null()

static int full_no_null(board_t * board, int alpha, int beta, int depth, int height, mv_t pv[], int node_type, int trans_move, int * best_move, int excluded_move) {

   int value, best_value;
   int move;
   int new_depth;
   attack_t attack[1];
   sort_t sort[1];
   undo_t undo[1];
   mv_t new_pv[HeightMax];

   ASSERT(board!=NULL);
   ASSERT(range_is_ok(alpha,beta));
   ASSERT(depth_is_ok(depth));
   ASSERT(height_is_ok(height));
   ASSERT(pv!=NULL);
   ASSERT(node_type==NodePV||node_type==NodeCut||node_type==NodeAll);
   ASSERT(trans_move==MoveNone||move_is_ok(trans_move));
   ASSERT(best_move!=NULL);

   ASSERT(board_is_legal(board));
   ASSERT(!board_is_check(board));
   ASSERT(depth>=1);

   // init

   SearchCurrent->node_nb++;
   SearchInfo->check_nb--;
   PV_CLEAR(pv);

   if (height > SearchCurrent->max_depth) SearchCurrent->max_depth = height;

   if (SearchInfo->check_nb <= 0) {
      SearchInfo->check_nb += SearchInfo->check_inc;
      search_check();
   }

   attack_set(attack,board);
   ASSERT(!ATTACK_IN_CHECK(attack));

   *best_move = MoveNone;
   best_value = ValueNone;

   // move loop

   sort_init(sort,board,attack,depth,height,trans_move);

   while ((move=sort_next(sort)) != MoveNone) {

      if (move == excluded_move)
  continue;
  else {
  new_depth = full_new_depth(depth,move,board,false,false);
  
  Nnue_Housekeeping(board, move, undo, height); // @Chris
  move_do(board,move,undo);
  value = -full_search(board,-beta,-alpha,new_depth,height+1,new_pv,NODE_OPP(node_type), 0);
  move_undo(board,move,undo);
  
  if (value > best_value) {
  best_value = value;
  if (excluded_move == MoveNone || value >= beta)
  pv_cat(pv,new_pv,move);
  if (value > alpha) {
  alpha = value;
  *best_move = move;
  if (value >= beta) goto cut;
  }
  }
  }
   }

   // ALL node

   if (best_value == ValueNone && excluded_move == MoveNone) { // no legal move => stalemate
      ASSERT(board_is_stalemate(board));
      best_value = ValueDraw;
   }

cut:

   ASSERT(value_is_ok(best_value));

   return best_value;
}

// full_quiescence()

static int full_quiescence(board_t * board, int alpha, int beta, int depth, int height, mv_t pv[]) {

   bool in_check;
   int old_alpha;
   int value, best_value;
   int best_move;
   int move;
   int opt_value;
   attack_t attack[1];
   sort_t sort[1];
   undo_t undo[1];
   mv_t new_pv[HeightMax];

   ASSERT(board!=NULL);
   ASSERT(range_is_ok(alpha,beta));
   ASSERT(depth_is_ok(depth));
   ASSERT(height_is_ok(height));
   ASSERT(pv!=NULL);

   ASSERT(board_is_legal(board));
   ASSERT(depth<=0);

   // init

   SearchCurrent->node_nb++;
   SearchInfo->check_nb--;
   PV_CLEAR(pv);

   if (height > SearchCurrent->max_depth) SearchCurrent->max_depth = height;

   if (SearchInfo->check_nb <= 0) {
      SearchInfo->check_nb += SearchInfo->check_inc;
      search_check();
   }

   // draw?

   if (board_is_repetition(board) || recog_draw(board)) return ValueDraw;

   // mate-distance pruning

   if (UseDistancePruning) {

      // lower bound

      value = VALUE_MATE(height+2); // does not work if the current position is mate
      if (value > alpha && board_is_mate(board)) value = VALUE_MATE(height);

      if (value > alpha) {
         alpha = value;
         if (value >= beta) return value;
      }

      // upper bound

      value = -VALUE_MATE(height+1);

      if (value < beta) {
         beta = value;
         if (value <= alpha) return value;
      }
   }

   // more init

   attack_set(attack,board);
   in_check = ATTACK_IN_CHECK(attack);

   if (in_check) {
      ASSERT(depth<0);
      depth++; // in-check extension
   }

   // height limit

   if (height >= HeightMax-1) return eval(board, height);

   // more init

   old_alpha = alpha;
   best_value = ValueNone;
   best_move = MoveNone;

   /* if (UseDelta) */ opt_value = +ValueInf;

   if (!in_check) {

      // lone-king stalemate?

      if (simple_stalemate(board)) return ValueDraw;

      // stand pat

      value = eval(board, height);

      ASSERT(value>best_value);
      best_value = value;
      if (value > alpha) {
         alpha = value;
         if (value >= beta) goto cut;
      }

      if (UseDelta) {
         opt_value = value + DeltaMargin;
         ASSERT(opt_value<+ValueInf);
      }
   }

   // move loop

   sort_init_qs(sort,board,attack,depth>=CheckDepth);

   while ((move=sort_next_qs(sort)) != MoveNone) {

      // delta pruning

      if (UseDelta
  && beta == old_alpha+1) { // non-pv node

         if (!in_check && !move_is_check(move,board) && !capture_is_dangerous(move,board)) {

            ASSERT(move_is_tactical(move,board));

            // optimistic evaluation

            value = opt_value;

            int to = MOVE_TO(move);
            int capture = board->square[to];

            if (capture != Empty) {
               value += VALUE_PIECE(capture);
            } else if (MOVE_IS_EN_PASSANT(move)) {
               value += ValuePawn;
            }

            if (MOVE_IS_PROMOTE(move)) value += ValueQueen - ValuePawn;

            // pruning

            if (value <= alpha) {

               if (value > best_value) {
                  best_value = value;
                  PV_CLEAR(pv);
               }

               continue;
            }
         }
      }

      Nnue_Housekeeping(board, move, undo, height); // @Chris
      move_do(board,move,undo);

      value = -full_quiescence(board,-beta,-alpha,depth-1,height+1,new_pv);
      move_undo(board,move,undo);

      if (value > best_value) {
         best_value = value;
         pv_cat(pv,new_pv,move);
         if (value > alpha) {
            alpha = value;
            best_move = move;
            if (value >= beta) goto cut;
         }
      }
   }

   // ALL node

   if (best_value == ValueNone) { // no legal move
      ASSERT(board_is_mate(board));
      return VALUE_MATE(height);
   }

cut:

   ASSERT(value_is_ok(best_value));

   return best_value;
}

// full_new_depth()

static int full_new_depth(int depth, int move, board_t * board, bool single_reply, bool in_pv) {

   int new_depth;

   ASSERT(depth_is_ok(depth));
   ASSERT(move_is_ok(move));
   ASSERT(board!=NULL);
   ASSERT(single_reply==true||single_reply==false);
   ASSERT(in_pv==true||in_pv==false);

   ASSERT(depth>0);

   new_depth = depth - 1;

   if ((single_reply && ExtendSingleReply)
    || (in_pv && MOVE_TO(move) == board->cap_sq // recapture
              && see_move(move,board) > 0)
    || (in_pv && PIECE_IS_PAWN(MOVE_PIECE(move,board))
              && PAWN_RANK(MOVE_TO(move),board->turn) == Rank7
              && see_move(move,board) >= 0)
    || move_is_check(move,board)) {
      new_depth++;
   }

   ASSERT(new_depth>=0&&new_depth<=depth);

   return new_depth;
}

// do_null()

static bool do_null(const board_t * board) {

   ASSERT(board!=NULL);

   // use null move if the side-to-move has at least one piece

   return board->piece_size[board->turn] >= 2; // king + one piece
}

// do_ver()

static bool do_ver(const board_t * board) {

   ASSERT(board!=NULL);

   // use verification if the side-to-move has at most one piece

   return board->piece_size[board->turn] <= 2; // king + one piece
}

// pv_fill()

static void pv_fill(const mv_t pv[], board_t * board) {

   int move;
   int trans_move, trans_depth, trans_min_value, trans_max_value;
   undo_t undo[1];

   ASSERT(pv!=NULL);
   ASSERT(board!=NULL);

   ASSERT(UseTrans);

   move = *pv;

   if (move != MoveNone && move != MoveNull) {

      move_do(board,move,undo);
      pv_fill(pv+1,board);
      move_undo(board,move,undo);

      trans_move = move;
      trans_depth = -127; // HACK
      trans_min_value = -ValueInf;
      trans_max_value = +ValueInf;

      trans_store(Trans,board->key,trans_move,trans_depth,trans_min_value,trans_max_value);
   }
}

// move_is_dangerous()

static bool move_is_dangerous(int move, const board_t * board) {

   int piece;

   ASSERT(move_is_ok(move));
   ASSERT(board!=NULL);

   ASSERT(!move_is_tactical(move,board));

   piece = MOVE_PIECE(move,board);

   if (PIECE_IS_PAWN(piece)
    && PAWN_RANK(MOVE_TO(move),board->turn) >= Rank7) {
      return true;
   }

   return false;
}

// capture_is_dangerous()

static bool capture_is_dangerous(int move, const board_t * board) {

   int piece, capture;

   ASSERT(move_is_ok(move));
   ASSERT(board!=NULL);

   ASSERT(move_is_tactical(move,board));

   piece = MOVE_PIECE(move,board);

   if (PIECE_IS_PAWN(piece)
    && PAWN_RANK(MOVE_TO(move),board->turn) >= Rank7) {
      return true;
   }

   capture = move_capture(move,board);

   if (PIECE_IS_QUEEN(capture)) return true;

   if (PIECE_IS_PAWN(capture)
    && PAWN_RANK(MOVE_TO(move),board->turn) <= Rank2) {
      return true;
   }

   return false;
}

// simple_stalemate()

static bool simple_stalemate(const board_t * board) {

   int me, opp;
   int king;
   int opp_flag;
   int from, to;
   int capture;
   const inc_t * inc_ptr;
   int inc;

   ASSERT(board!=NULL);

   ASSERT(board_is_legal(board));
   ASSERT(!board_is_check(board));

   // lone king?

   me = board->turn;
   if (board->piece_size[me] != 1 || board->pawn_size[me] != 0) return false; // no

   // king in a corner?

   king = KING_POS(board,me);
   if (king != A1 && king != H1 && king != A8 && king != H8) return false; // no

   // init

   opp = COLOUR_OPP(me);
   opp_flag = COLOUR_FLAG(opp);

   // king can move?

   from = king;

   for (inc_ptr = KingInc; (inc=*inc_ptr) != IncNone; inc_ptr++) {
      to = from + inc;
      capture = board->square[to];
      if (capture == Empty || FLAG_IS(capture,opp_flag)) {
         if (!is_attacked(board,to,opp)) return false; // legal king move
      }
   }

   // no legal move

   ASSERT(board_is_stalemate((board_t*)board));

   return true;
}

// end of search_full.cpp

Back to top Go down
Eelco

Eelco


Posts : 232
Join date : 2021-10-08

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptyMon Jan 31, 2022 9:23 am

I don't think it is very good yet, but at least I think it is actually calling an Exclusion Search, so it is actually doing something. It extends now very deep, and single_reply and other extensions are called even if there is a singular extension approved already by the search. Usually not a very good idea, double extensions. Stockfish does it now but I'm not a big fan, too many search explosions I have seen with double extensions in past versions of Toga etc..
Back to top Go down
Eelco

Eelco


Posts : 232
Join date : 2021-10-08

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptyMon Feb 07, 2022 6:27 pm

Off topic here but I do not want to post too much, but for those having problems with a too old computer to run Rebel SSE, and you might be considering a cheap PC upgrade, but little money I can recommend this Dell computer, well I got this one but it actually has a slightly older Haswell, ca. 2013, a i5 4440, not the i5 4590 that is supposed to be inside. The connections at the back do not entirely match the picture either, probably to do with the refurbishing, I connect my monitor with VESA not the most modern of connectors but it's okay. The computer has better connectors actually, two HDMI I think they are but my monitor a still good Samsung SyncMaster 2253 LW precedes HDMI. Edit: no the other two connectors are the original Display Ports which in theory should be better but it for obvous reasons is not the most recent version of Display Port and not every monitor can connect to that either.

I am very happy with it, once I got the Windows 10 updated to the latest versions and activated. Especially with the noise levels running Rebel  Visual Studio can't find file with long name 1f604  on several cores (several instances).

https://www.pcmagazijn.nl/winkel/refurbished-pcs/dell-optiplex/dell-optiplex-9020-sff/

There are only three left though, but several more recent ones for a higher price, or the mini versions.

Visual Studio can't find file with long name Dell-Optiplex-9020-SFF-4

TheSelfImprover likes this post

Back to top Go down
Eelco

Eelco


Posts : 232
Join date : 2021-10-08

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptyMon Feb 14, 2022 10:10 pm

This model is sold out, maybe somebody bought all three? You can't always trust that, sometimes a site may offer a sale for a limited time only, but it wasn't a special sale.

I did not continue my Rebel testing, I think it is going to be hard to improve Fruit and not simply change to a Toga search for instance, unless with NNUE everything is different. That may be the case. Because Eval is so different now. For instance, after a null move do you take the previous evaluation and just change the sign? That is different from just letting the Net make a new evaluation! How different it is and which is better, I don't know.

I just threw in a lot of changes, all at one time but it made Rebel weaker with at least a hundred points, up to two hundred possibly, so then you have to start throwing out things again, one by one and see if that improves things... It will take months and if Ed in the meantime switches to Toga instead of Fruit...

I was up to search_049U3 Laughing
Back to top Go down
Admin
Admin
Admin


Posts : 2608
Join date : 2020-11-17
Location : Netherlands

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptyTue Feb 15, 2022 11:50 am

Eelco wrote:
This model is sold out, maybe somebody bought all three? You can't always trust that, sometimes a site may offer a sale for a limited time only, but it wasn't a special sale.

I did not continue my Rebel testing, I think it is going to be hard to improve Fruit and not simply change to a Toga search for instance, unless with NNUE everything is different. That may be the case. Because Eval is so different now. For instance, after a null move do you take the previous evaluation and just change the sign? That is different from just letting the Net make a new evaluation! How different it is and which is better, I don't know.

I just threw in a lot of changes, all at one time but it made Rebel weaker with at least a hundred points, up to two hundred possibly, so then you have to start throwing out things again, one by one and see if that improves things... It will take months and if Ed in the meantime switches to Toga instead of Fruit...

I was up to search_049U3 Laughing

I might (no hard promise) do that in time. But there are some things I dislike on Toga IV. First of all it has lazy_eval but in the wrong way, secondly it makes all kind of search decisions based on unreliable hash table scores. The search might be stronger nevertheless. The only thing that would really matter are the extra multi-processing and multi-pv features.
Back to top Go down
http://rebel13.nl/
Eelco

Eelco


Posts : 232
Join date : 2021-10-08

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptySun Feb 20, 2022 3:22 am

Today marks the first time that Rebel 14.1 MOD could actually win a game (from Rebel 14.1)! Short match, just four games with the Shredder.abk opening book in Shredder GUI. 5 minutes per game, but that is not always very strict in Shredder, time losses are seldom (I can't remember any) Rebel 14.1 MOD sometimes almost seems to crash, for taking lots of time in its Singular Extensions, so not too strict timecontrol could be a small advantage. Also the opening (French, Winawer) from Rebel's scores seems very unbalanced but that also often is not quite what it seems; Stefan likes to throw those in, you seem to be lost or winning straight from book but real decided games from book are actually rare, but this was a bit won for White probably. Rebel did in fact win very conclusively in the first game, rather a humiliating defeat for MOD. But it won the return game!

The game that Rebel won:

[pgn][Event "5 minuten per partij"]
[Site "Engine Match"]
[Date "2022.02.20"]
[Round "1"]
[White "Rebel 14.1"]
[Black "Rebel 14.1 MOD"]
[Result "1-0"]

1. e4 {Boek 0s} e6 {Boek 0s} 2. d4 {Boek 0s} d5 {Boek 0s}
3. Nc3 {Boek 0s} Bb4 {Boek 0s} 4. e5 {Boek 0s} c5 {Boek 0s}
5. a3 {Boek 0s} Bxc3+ {Boek 0s} 6. bxc3 {Boek 0s} Ne7 {Boek
0s} 7. Qg4 {Boek 0s} O-O {Boek 0s} 8. Bd3 {Boek 0s} Qa5
{Boek 0s} 9. Ne2 {Boek 0s} Nbc6 {+0.34/19 6s} 10. Bg5 {Boek
0s} Ng6 {Boek 0s} 11. O-O {-0.03/19 7s} Qa4 {Boek 0s}
12. f4 {+0.60/20 9s} c4 {Boek 0s} 13. Bxg6 {+0.60/20 2s}
fxg6 {Boek 0s} 14. f5 {+1.32/22 8s} gxf5 {+0.68/19 6s}
15. Qg3 {+1.45/20 9s} Rf7 {+1.00/21 9s} 16. Nf4 {+2.00/19
6s} Qxc2 {+0.96/20 8s (Da5)} 17. Rf2 {+1.64/21 5s (h4)} Qb3
{+1.75/20 6s} 18. Nh5 {+2.95/21 6s} Ne7 {+3.18/19 11s
(Db6)} 19. Bxe7 {+3.12/19 6s} Rxe7 {+3.12/20 4s} 20. Nf6+
{+3.59/19 5s} Kf8 {+3.01/21 6s} 21. Nxh7+ {+2.84/19 7s} Ke8
{+3.18/22 6s} 22. Rff1 {+2.76/18 4s} Kd7 {+3.11/19 10s
(Db2)} 23. a4 {+2.74/17 9s (h4)} Kc6 {+2.77/19 7s (Dc2)}
24. Qg5 {+2.79/19 6s (a5)} Rf7 {+3.12/20 4s} 25. Qd8
{+6.94/19 7s (Dc1)} Rd7 {+7.58/20 6s} 26. Qe8 {+8.45/20 3s}
Qxc3 {+8.17/19 4s (Db6)} 27. Nf8 {+7.96/21 3s} Kc7
{+8.45/20 6s} 28. Kh1 {+7.91/21 5s} a5 {+8.15/20 6s}
29. Rfc1 {+7.80/21 5s} Qe3 {+10.03/21 21s} 30. Nxd7
{+11.17/21 5s} Qxd4 {+11.23/19 6s} 31. Rab1 {+11.73/21 4s}
Ra6 {+11.47/19 4s} 32. Nf8 {+11.48/21 3s} Qxe5 {+11.87/18
4s (Tc6)} 33. Qe7+ {+12.31/20 4s (Df7+)} Kc6 {+12.83/21
1:10m} 34. Re1 {+12.78/20 3s} Qd6 {+11.96/18 6s} 35. Qxg7
{+15.38/21 5s} b6 {+14.58/16 2s (Tb6)} 36. Qf7 {+17.66/18
3s (h4)} d4 {+22.38/19 33s (Ta8)} 37. Nxe6 {+23.62/18 4s}
Bd7 {+22.42/14 1s (Ta8)} 38. Qxf5 {+31.56/17 4s (Pd8+)} Kb7
{+41.28/15 7s} 39. Nc5+ {+39.32/16 4s} Kc7 {+M10/15 11s}
40. Nxa6+ {+M10/13 1s} Kc8 {+M9/15 0s} 41. Re8+ {+M9/13 2s}
Kb7 {+36.35/4 0s} 42. Nc5+ {+M8/14 0s} Kc7 {+M7/15 0s}
43. Nxd7 {+M7/15 1s} Qxd7 {+M6/16 0s} 44. Qe5+ {+M6/19 2s}
Kc6 {+M5/19 0s} 45. Qf6+ {+M5/33 2s (Te6+)} Qd6 {+M4/21 0s}
46. Rxb6+ {+M4/63 0s} Kxb6 {+M3/22 0s} 47. Qxd6+ {+M3/63
0s} Kb7 {+M2/63 0s} 48. Re7+ {+M2/63 0s} Kc8 {+M1/63 0s}
49. Qc7# {+M1/63 0s} 1-0[/pgn]

The game that MOD won:

[pgn][Event "5 minuten per partij"]
[Site "Engine Match"]
[Date "2022.02.20"]
[Round "2"]
[White "Rebel 14.1 MOD"]
[Black "Rebel 14.1"]
[Result "1-0"]

1. e4 {Boek 0s} e6 {Boek 0s} 2. d4 {Boek 0s} d5 {Boek 0s}
3. Nc3 {Boek 0s} Bb4 {Boek 0s} 4. e5 {Boek 0s} c5 {Boek 0s}
5. a3 {Boek 0s} Bxc3+ {Boek 0s} 6. bxc3 {Boek 0s} Ne7 {Boek
0s} 7. Qg4 {Boek 0s} O-O {Boek 0s} 8. Bd3 {Boek 0s} Qa5
{Boek 0s} 9. Ne2 {Boek 0s} Nbc6 {+0.05/19 12s} 10. Bg5
{Boek 0s} Ng6 {Boek 0s} 11. O-O {-0.31/18 6s} Qa4 {Boek 0s}
12. h3 {-0.21/19 6s} c4 {-0.15/20 8s} 13. Bxg6 {-0.38/21
6s} fxg6 {+0.20/19 7s} 14. Ra2 {-0.08/21 11s} b5 {-0.01/19
8s (Ld7)} 15. h4 {+0.64/20 5s} Bd7 {+0.06/19 7s (Tf7)}
16. Nf4 {+0.95/21 14s (Tfa1)} Qa5 {+1.63/20 15s (b4)}
17. h5 {+1.96/22 7s} Rf5 {+1.90/20 7s} 18. h6 {+1.93/20 5s
(Dg3)} Qxc3 {+1.84/19 7s} 19. Ne2 {+1.61/20 6s} Qa5
{+2.13/19 7s} 20. hxg7 {+1.68/19 5s} Rc8 {+2.00/18 5s
(Kxg7)} 21. Raa1 {+2.49/19 4s (Lf6)} Rf7 {+2.76/19 8s}
22. Qh4 {+2.60/19 5s} Qa4 {+2.78/19 5s} 23. c3 {+3.03/20
5s} Qc2 {+3.20/19 4s (Txg7)} 24. Rae1 {+2.96/20 7s} Rxg7
{+2.73/19 6s (a5)} 25. Bf6 {+3.09/20 8s (f4)} Rf7 {+3.62/19
4s (g5)} 26. f4 {+4.20/21 4s} Re8 {+4.05/18 4s} 27. f5
{+4.71/21 5s} exf5 {+4.76/19 4s} 28. Rf3 {+5.14/19 3s
(Pf4)} Qd2 {+4.46/16 3s} 29. Bg5 {+5.28/19 6s (Kf1)} Qb2
{+6.03/18 5s} 30. Nf4 {+5.64/18 4s} Qxa3 {+6.11/18 5s}
31. e6 {+6.96/17 9s (Pxd5)} Bxe6 {+6.90/17 3s} 32. Rfe3
{+7.84/17 4s} Qd6 {+10.71/19 8s (Tfe7)} 33. Rxe6 {+12.41/20
4s} Rxe6 {+13.74/21 10s} 34. Rxe6 {+13.54/17 3s} Qd7
{+14.89/21 3s} 35. Bh6 {+15.80/18 4s} b4 {+16.68/22 9s}
36. Rxc6 {+17.43/17 4s} b3 {+16.84/21 3s} 37. Re6
{+17.09/17 5s} b2 {+18.50/21 6s} 38. Re1 {+19.30/19 3s} Qd6
{+18.84/21 3s} 39. Re8+ {!, +M12/18 40s (Pxd5)} Rf8 {+12.98/18
2s} 40. Bxf8 {+M11/16 2s} b1=Q+ {+15.01/19 3s} 41. Kh2
{+M9/18 2s} Qb5 {+M8/15 7s (Dbb8)} 42. Bxd6+ {+M8/16 2s}
Qxe8 {+M7/19 2s} 43. Qf6 {+M7/17 2s (Pxd5)} g5 {+M6/26 2s}
44. Qxg5+ {+M6/17 0s} Kh8 {+M5/61 1s} 45. Be5+ {+M5/28 1s}
Qxe5 {+M4/4 0s} 46. dxe5 {+M4/49 1s} h6 {+M3/63 0s}
47. Qf6+ {+M3/63 0s} Kg8 {+M2/63 0s} 48. Ne6 {+M2/63 0s
(Ph5)} d4 {+M1/63 0s (a5)} 49. Qg7# {+M1/63 0s} 1-0[/pgn]

At 39. Re8+ Rebel 14.1 MOD announces a Mate in 12  bom , after just 40 seconds thinking.


Overall score after four games: Rebel 14.1 - Rebel 14.1 MOD 2 - 2 (4, +1, =2, -1)
Back to top Go down
Mclane

Mclane


Posts : 3022
Join date : 2020-11-17
Age : 57
Location : United States of Europe, Germany, Ruhr area

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptySun Feb 20, 2022 9:30 am

A any plans to make rebel (eds) and chris‘ nets running in a different engine with MP and endgame tablebases such as szyzgy ?!
Maybe a search that fits better ?!
Back to top Go down
http://www.thorstenczub.de
Chris Whittington




Posts : 1254
Join date : 2020-11-17
Location : France

Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name EmptySun Feb 20, 2022 9:50 am

Mclane wrote:
A any plans to make rebel (eds) and chris‘ nets running in a different engine with MP and endgame tablebases such as szyzgy ?!
Maybe a search that fits better ?!

Yea

Mclane likes this post

Back to top Go down
The author of this message was banned from the forum - See the message
Sponsored content





Visual Studio can't find file with long name Empty
PostSubject: Re: Visual Studio can't find file with long name   Visual Studio can't find file with long name Empty

Back to top Go down
 
Visual Studio can't find file with long name
Back to top 
Page 1 of 1
 Similar topics
-
» Not been able to make correct yet Toga with my Visual Studio 2022
» Long Live The King
» what is a ZST file?
» Eman.exp fıle
» Yes Fat Fritz 2 is a UCI engine. Here are the file locations.

Permissions in this forum:You can reply to topics in this forum
ProDeo :: Programmer Corner-
Post new topic   Reply to topicJump to: