To be clear, the tactical thread would still use the hash table to make cutoffs e.g. if the hash entry is upperbound at +10 and alpha is +mate, then you'd do a cutoff. It just wouldn't "push" it's search results to the hash table unless a genuine mate had been found. What you want avoid is the hash table being filled with practically useless entries that basically say "this position is less than mate".
Steve
Adding a mate searching thread to my engine
Moderator: Ras
-
- Posts: 1275
- Joined: Wed Mar 08, 2006 8:28 pm
- Location: Florida, USA
Re: Adding a mate searching thread to my engine
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine
-
- Posts: 10793
- Joined: Thu Mar 09, 2006 12:37 am
- Location: Tel-Aviv Israel
Re: Adding a mate searching thread to my engine
You also want to avoid searching the same position to the same depth twice by the mate search when there is no mate.Steve Maughan wrote: ↑Sat Apr 09, 2022 12:26 am To be clear, the tactical thread would still use the hash table to make cutoffs e.g. if the hash entry is upperbound at +10 and alpha is +mate, then you'd do a cutoff. It just wouldn't "push" it's search results to the hash table unless a genuine mate had been found. What you want avoid is the hash table being filled with practically useless entries that basically say "this position is less than mate".
Steve
I do not see how you do it if you do not store in the hash table an information like this position is less than a mate assuming you search to depth 9 plies or smaller.
-
- Posts: 161
- Joined: Tue Jan 23, 2018 10:18 am
- Location: Rotterdam
- Full name: Ronald Friederich
Re: Adding a mate searching thread to my engine
You could try to define a separate hashtable for the mate thread, look in both hashtables for the position, store regular positions in the separate table and store mate scores in both tables.
You can create a separate table fi by using one bit of the index as separator. Drawback is that you halved the space for regular search.
You can create a separate table fi by using one bit of the index as separator. Drawback is that you halved the space for regular search.
-
- Posts: 969
- Joined: Fri Mar 10, 2006 4:29 pm
- Location: Germany
- Full name: Jörg Oster
Re: Adding a mate searching thread to my engine
This https://github.com/joergoster/Stockfish/tree/huntsman simple approach shows quite some success.Cardoso wrote: ↑Fri Apr 08, 2022 12:14 amSo no heuristics that could possibly help?dangi12012 wrote: ↑Thu Apr 07, 2022 8:53 pm Let me answer this straightforward:
Return 0 at the leafs.
Remove all pruning.
You will end up with pure alphabeta which should be around 7 lines of code and will find forced wins for you.
If that recursion returns a win it is a forced win IE mate in X
You can still do iterative deepening when the number of open paths remain low
About pruning, maybe the only pruning I can make safely is mate distance pruning. I'm going to test that.
Maybe it can provide some hints for you.
Jörg Oster
-
- Posts: 1275
- Joined: Wed Mar 08, 2006 8:28 pm
- Location: Florida, USA
Re: Adding a mate searching thread to my engine
Yes — that should work!!Ronald wrote: ↑Sat Apr 09, 2022 10:05 am You could try to define a separate hashtable for the mate thread, look in both hashtables for the position, store regular positions in the separate table and store mate scores in both tables.
You can create a separate table fi by using one bit of the index as separator. Drawback is that you halved the space for regular search.
http://www.chessprogramming.net - Juggernaut & Maverick Chess Engine
-
- Posts: 363
- Joined: Thu Mar 16, 2006 7:39 pm
- Location: Portugal
- Full name: Alvaro Cardoso
Re: Adding a mate searching thread to my engine
I already had a separate a separate hashtable for the mate searcher, it just didn't occurred me I should store mate scores in both tables. Thanks Ronald.Ronald wrote: ↑Sat Apr 09, 2022 10:05 am You could try to define a separate hashtable for the mate thread, look in both hashtables for the position, store regular positions in the separate table and store mate scores in both tables.
You can create a separate table fi by using one bit of the index as separator. Drawback is that you halved the space for regular search.