thomasahle / sunfish

Sunfish: a Python Chess Engine in 111 lines of code
https://www.chessprogramming.org/Sunfish
Other
2.95k stars 543 forks source link

Update sunfish_nnue_color.py #94

Closed scs-ben closed 1 year ago

scs-ben commented 1 year ago

this is a probably flawed way to respect your think time by not shooting past it in a deep search

thomasahle commented 1 year ago

The thing is, this really shouldn't make much of a difference, since it's already checking for time-out every time it yields... I suggest TCEC uses sunfish classic (I emailed Aloril) for now, and I'll figure out what regression I introduced to the nnue since I actually tested it properly :(

scs-ben commented 1 year ago

But it doesn't yield frequently at larger depths, in my testing it took around 55 seconds after the time cut to yield a move.

thomasahle commented 1 year ago

I'm just saying, in this patch, you're only doing one time check for each yield. And since there's already a time check for each yield, I'm worried that this won't fix things...

These are my current test runs for classic and nnue. Nnue has a pretty bad score due to connection-stalls and timeouts. I haven't tested your patch though, but this is why I suggested just using classic for now.

Screen Shot 2022-12-26 at 6 34 42 PM
scs-ben commented 1 year ago

I modified my PR slightly to return what might be the most recent search information. I respect whatever decision you make for the competition. You do have some hours to test things out now though.

scs-ben commented 1 year ago

Well, that returns a score MATE_UPPER.. I don't know. But I guess this is my best effort, sorry

scs-ben commented 1 year ago

I modified the PR again to bypass the MATE_UPPER score.

Also:

There seems to be a significant issue with NNUE, look at the these evals:

position startpos moves d2d4 d6d5 g1f3 b8c6 g2g3 c8g4 f1g2 g8f6
go wtime 1800000 btime 36000000 winc 3000 binc 1000
info depth 1 score cp 43
info depth 1 score cp 62
info depth 1 score cp 51
info depth 2 score cp 46
info depth 2 score cp 24
info depth 2 score cp 39
info depth 3 score cp 42
info depth 3 score cp -256
info depth 3 score cp -22
info depth 3 score cp 13
info depth 3 score cp 36
info depth 4 score cp 39
info depth 4 score cp 369
info depth 4 score cp 79
info depth 4 score cp 58
info depth 4 score cp 48
info depth 5 score cp 43
info depth 5 score cp -506
info depth 5 score cp -117
info depth 5 score cp -37
info depth 5 score cp 3
info depth 5 score cp 23
info depth 5 score cp 33
info depth 6 score cp 33
bestmove d1d3
thomasahle commented 1 year ago

These look like normal upper/lower bound values from MTD search to me. But I do agree that the problem may be related to an NNUE issue. Maybe evals gone rye could make the over ordering weird leading to very long QS searches...