Marco Costalba
65186e964b
Assorted renaming and document
2016-05-29 12:11:15 +02:00
Marco Costalba
f4a1b3ac77
Reset TB when ucinewgame
...
This unmaps all the memory mapped TB
freeing unsued memory.
2016-05-28 11:00:25 +02:00
Marco Costalba
551a5246f0
Send uci 'info' to std::out as standard behaviour
2016-05-27 12:39:55 +02:00
Marco Costalba
8e2adf3c4c
Move variable defintions where are used
2016-05-27 12:31:42 +02:00
Marco Costalba
ac65186fa9
Move 'wdl' and 'dtz' UCI commands under 'd'
2016-05-27 08:47:23 +02:00
Marco Costalba
c77a13ef4a
Retire old DTZ table
2016-05-26 23:33:12 +02:00
Marco Costalba
5bd859e1fa
Retire old DTZ probing code
2016-05-26 23:09:35 +02:00
Marco Costalba
1b00b426a0
Verify DTZ in hash is equivalent to current one
2016-05-26 23:09:32 +02:00
Marco Costalba
a12542cbaa
Attempt to init() just once
...
In case something goes wrong baseAddress is set to zero
and any further attempt to init() returns false.
This is a prerequisite for future work.
2016-05-26 23:09:25 +02:00
Marco Costalba
2e3412fdd0
Use hash table also for DTZ
2016-05-26 23:09:19 +02:00
Marco Costalba
3ea9928f55
Revert "Add DTZ to WDL hash table"
...
This reverts commit 19bc074c18
.
2016-05-26 18:57:57 +02:00
Marco Costalba
19bc074c18
Add DTZ to WDL hash table
...
A single hash table to store both pointers.
Greatly simplify code.
2016-05-26 18:51:25 +02:00
Marco Costalba
ff3165286c
Make DTZEntry init() thread safe
2016-05-26 10:48:26 +02:00
Marco Costalba
5ebd56ebd8
Retire pos_code()
2016-05-26 10:20:44 +02:00
Marco Costalba
32c1f1da26
Rearrange WDLEntry API
...
To avoid using temporaries like keys[]
2016-05-26 09:54:16 +02:00
Marco Costalba
107750279d
Move file name setup inside init()
2016-05-26 09:26:48 +02:00
Marco Costalba
ac136ea72b
De-templetize a couple of functions
...
Use simple overloads instead.
2016-05-26 09:12:50 +02:00
Marco Costalba
c920c6c807
Improve some comments
2016-05-25 11:31:01 +02:00
Marco Costalba
23a548feaa
Small tweak in probe_dtz()
2016-05-24 13:10:31 +02:00
Marco Costalba
09139d87cb
Fix an issue with only capture moves
...
When the only legal moves are captures, then
probe_wdl_table() returns a wrong score.
2016-05-24 10:10:22 +02:00
Marco Costalba
f852b0ed8f
Hanlde mate position in dtz probe
...
Stick to the original code behaviour.
2016-05-24 09:50:56 +02:00
Marco Costalba
36d6a1fd0a
Third attempt: hopefully the last one
2016-05-23 09:26:18 +02:00
Marco Costalba
de5a03ff0f
Second attempt at dtz loop
2016-05-22 15:53:57 +02:00
Marco Costalba
e9e9cfa9bf
Further simplify opponent side DTZ search
2016-05-22 10:24:44 +02:00
Marco Costalba
eb16759a48
Explicitly initialize 'ready' flag
2016-05-22 09:49:03 +02:00
Marco Costalba
0610a13789
Initialize result before probing
2016-05-22 07:28:54 +02:00
Marco Costalba
8925a28cf1
Fix ep move for real this time
2016-05-21 21:51:23 +02:00
Marco Costalba
db8112ec9e
Fix issue and rewrite search() flags
2016-05-21 21:39:04 +02:00
Marco Costalba
3731213994
Further simplify probe_dtz() loop conditions
2016-05-21 20:27:28 +02:00
Marco Costalba
6a6a7d2b22
Make probe_dtz_table() return correct dtz
2016-05-21 19:55:32 +02:00
Marco Costalba
96314cc971
Prefer readibility to (useless) optimization
2016-05-21 19:43:36 +02:00
Marco Costalba
de335433ea
Added 'wdl' and 'dtz' UI debug commands
...
Probe WDL and DTZ tables on current position.
2016-05-21 15:14:50 +02:00
Marco Costalba
0700912dc5
Further improve probe_dtz()
2016-05-21 10:58:09 +02:00
Marco Costalba
0b040243ba
Remove ep specific code from dtz probe
2016-05-21 10:43:34 +02:00
Marco Costalba
47e21c274d
More work in probe_dtz_no_ep()
2016-05-21 10:33:53 +02:00
Marco Costalba
bea98066a0
Integrate WIN_PAWN_MOVE into the search() loop
2016-05-21 09:53:47 +02:00
Marco Costalba
4b068d50f6
Strong type probe state
2016-05-21 08:30:46 +02:00
Marco Costalba
af95d27fd7
Fix enpassant case to handle 2 ep moves
2016-05-21 07:31:03 +02:00
Marco Costalba
6eb670ad37
Integrate ENPASSANT in the search
2016-05-20 19:01:48 +02:00
Marco Costalba
9a0f8b38c3
BENCH CHANGE! Switch to new loop cycle
...
Bench change is due to different move
generation order. But functionality
remains the same.
2016-05-19 19:11:38 +02:00
Marco Costalba
8634305cb9
Test new loop cycle in probe_ab()
...
Currently we return as soon as we reach
beta. This makes the bench signature to
depend on the move order in case we have
more than one possible capture and only
one of them reach beta then the nodes
searched are different in case we first
test one capture or the other.
Verify that the best value found by the
two move llops are the same. This check
will allow to remove old loop, replaced
by new one.
2016-05-19 18:56:25 +02:00
Marco Costalba
7dc41c7929
Document probe_ab()
2016-05-19 11:41:30 +02:00
Marco Costalba
b465f2b44a
Don't init second WDLEntry when symmetric
2016-05-18 22:20:43 +02:00
Marco Costalba
66456590d7
More stuff
2016-05-18 07:20:45 +02:00
Marco Costalba
6233830b9b
Assorted small stuff
2016-05-17 22:21:44 +02:00
Marco Costalba
8bedb19690
Sync with master
...
Verified against master with 4-men and
partially 5-men tables.
2016-05-17 13:56:51 +02:00
Marco Costalba
99458025ba
Fix sorting of leading pawns
...
Currently we sort leading pawns before
to flip. This is ok becuase MapPawns[] is
(almost) flip invariant apart for the case
of two symmetric non-leading pawns like the
case of d2, e2, h2.
After MapPawns[] sorting we have h2, d2, e2
with values 46, 11, 10. Then we flip because
leading pawns is in h2 -> a2,e2,d2 with values
46,10,11. So this is not sorted anymore.
The fix is to sort after flipping. And instead
of forst sorting just pick the leading pawn
directly.
2016-05-17 12:40:55 +02:00
Marco Costalba
28d497e00c
Some more additional doc on encoding
2016-05-16 23:21:57 +02:00
Marco Costalba
f5ac865866
Init MapToEdges[] with other tables
...
And simplify LeadPawnIdx[] usage.
2016-05-16 18:21:15 +02:00
Marco Costalba
1cbaaaef68
Document Pawnidx[] and Pfactor[]
2016-05-16 10:08:11 +02:00