I'm curious to see how strong a chess engine in python can get. So, I'm writing one to try and find out.
https://github.com/alvinypeng/d-house
D-house only uses the python standard library. I feel it would defeat the purpose of the project if I were to offload computationally intensive work onto third-party libraries written in C/C++. In terms of search logic, a lot is yoinked from Berserk (thank you, Jay).
It hits around 5-6k nodes/s single core on my machine. The slow speed makes it relatively much weaker in faster tc. D-house plays best in long repeating time controls like 40/15 because it becomes more prone to tactical mistakes in time scrambles.
(Strongest?) python engine: D-house
Moderator: Ras
-
alvinypeng
- Posts: 36
- Joined: Thu Mar 03, 2022 7:29 am
- Full name: Alvin Peng
-
dkappe
- Posts: 1632
- Joined: Tue Aug 21, 2018 7:52 pm
- Full name: Dietrich Kappe
Re: (Strongest?) python engine: D-house
King of the hill is a0lite, but it’s a mcts/nn engine, so speed is less important. https://github.com/dkappe/a0lite
Add in a gpu and it can go all the way to 2850++. It made it all the way to L4 a few TCEC seasons ago.
Add in a gpu and it can go all the way to 2850++. It made it all the way to L4 a few TCEC seasons ago.
Fat Titz by Stockfish, the engine with the bodaciously big net. Remember: size matters. If you want to learn more about this engine just google for "Fat Titz".
-
alvinypeng
- Posts: 36
- Joined: Thu Mar 03, 2022 7:29 am
- Full name: Alvin Peng
Re: (Strongest?) python engine: D-house
I am aware of a0lite's existence, but it relies on external libraries. So according to my arbitrary guidelines, I wouldn't personally consider it "pure" python.dkappe wrote: ↑Sun Mar 20, 2022 10:58 am King of the hill is a0lite, but it’s a mcts/nn engine, so speed is less important. https://github.com/dkappe/a0lite
Add in a gpu and it can go all the way to 2850++. It made it all the way to L4 a few TCEC seasons ago.
I do however think that a0lite is an amazing piece of work. I want to eventually write another engine with mcts/nn and I will definitely be looking at your source code for help. Leela's code is a bit over my head at the moment.
-
dkappe
- Posts: 1632
- Joined: Tue Aug 21, 2018 7:52 pm
- Full name: Dietrich Kappe
Re: (Strongest?) python engine: D-house
Well, python-chess isn’t exactly a speed burner, and you’ll have a hard time operating a Nvidia gpu in “pure” python, but to each their own. Best of luck.
Fat Titz by Stockfish, the engine with the bodaciously big net. Remember: size matters. If you want to learn more about this engine just google for "Fat Titz".
-
gbtami
- Posts: 389
- Joined: Wed Sep 26, 2012 1:29 pm
- Location: Hungary
Re: (Strongest?) python engine: D-house
Possible the best pure Python competitor is https://github.com/pychess/pychess
-
Sylwy
- Posts: 5005
- Joined: Fri Apr 21, 2006 4:19 pm
- Location: IAȘI - the historical capital of MOLDOVA
- Full name: Silvian Rucsandescu
Re: (Strongest?) python engine: D-house
THANK YOU !alvinypeng wrote: ↑Sun Mar 20, 2022 9:04 am I'm curious to see how strong a chess engine in python can get. So, I'm writing one to try and find out.
https://github.com/alvinypeng/d-house
D-house only uses the python standard library. I feel it would defeat the purpose of the project if I were to offload computationally intensive work onto third-party libraries written in C/C++. In terms of search logic, a lot is yoinked from Berserk (thank you, Jay).
It hits around 5-6k nodes/s single core on my machine. The slow speed makes it relatively much weaker in faster tc. D-house plays best in long repeating time controls like 40/15 because it becomes more prone to tactical mistakes in time scrambles.
Best pure Python chess engine (in my tests) is PyChess 0.99.4. No GPU ( a0lite)
Sunfish is also OK.........Feeks-IZII-Lopez & co......

The slow speed ......this is the problem......
I'll test your chess engine !
-
connor_mcmonigle
- Posts: 544
- Joined: Sun Sep 06, 2020 4:40 am
- Full name: Connor McMonigle
Re: (Strongest?) python engine: D-house
Hmm. It might be worth mentioning explicitly in the README that this is more of less a direct translation of Berserk to python (given the evaluation function is also yoinked from an older version of Berserk). Are there any components of the engine which differ from Berserk (outside of their translation to Python)? In any case, I guess it's somewhat interesting to see how a top engine performs when rewritten in Python, though why did you choose Berserk over Stockfish?alvinypeng wrote: ↑Sun Mar 20, 2022 9:04 am I'm curious to see how strong a chess engine in python can get. So, I'm writing one to try and find out.
https://github.com/alvinypeng/d-house
D-house only uses the python standard library. I feel it would defeat the purpose of the project if I were to offload computationally intensive work onto third-party libraries written in C/C++. In terms of search logic, a lot is yoinked from Berserk (thank you, Jay).
It hits around 5-6k nodes/s single core on my machine. The slow speed makes it relatively much weaker in faster tc. D-house plays best in long repeating time controls like 40/15 because it becomes more prone to tactical mistakes in time scrambles.
-
alvinypeng
- Posts: 36
- Joined: Thu Mar 03, 2022 7:29 am
- Full name: Alvin Peng
Re: (Strongest?) python engine: D-house
While it is primarily based off Berserk, the transposition table is not, among several other things. I did credit the sources of where I took ideas/logic from in my README. The code is all public under the GPL-3.0 License anyway, so anyone is free to look and take my code as well.connor_mcmonigle wrote: ↑Sun Mar 20, 2022 5:51 pmHmm. It might be worth mentioning explicitly in the README that this is more of less a direct translation of Berserk to python (given the evaluation function is also yoinked from an older version of Berserk). Are there any components of the engine which differ from Berserk (outside of their translation to Python)? In any case, I guess it's somewhat interesting to see how a top engine performs when rewritten in Python, though why did you choose Berserk over Stockfish?alvinypeng wrote: ↑Sun Mar 20, 2022 9:04 am I'm curious to see how strong a chess engine in python can get. So, I'm writing one to try and find out.
https://github.com/alvinypeng/d-house
D-house only uses the python standard library. I feel it would defeat the purpose of the project if I were to offload computationally intensive work onto third-party libraries written in C/C++. In terms of search logic, a lot is yoinked from Berserk (thank you, Jay).
It hits around 5-6k nodes/s single core on my machine. The slow speed makes it relatively much weaker in faster tc. D-house plays best in long repeating time controls like 40/15 because it becomes more prone to tactical mistakes in time scrambles.
As for picking Berserk, it was because the Stockfish NNUE requires a complete recalculation every time the king moves. I thought this would be too slow for python, especially in the endgame. The Berserk 6 network architecture is not indexed by the king so the network could be incrementally updated for every move. And after choosing to use Berserk's NNUE, I decided to use the search too. I do think the Stockfish search is superior though. It would take a lot of work to translate it into python, but maybe I'll have a go at it in the future...
-
alvinypeng
- Posts: 36
- Joined: Thu Mar 03, 2022 7:29 am
- Full name: Alvin Peng
-
supersharp77
- Posts: 1266
- Joined: Sat Jul 05, 2014 7:54 am
- Location: Southwest USA
Re: (Strongest?) python engine: D-house
Based on what I've viewed online...very few people have been able to run A0 "lite" at all......the master contained no exe and the .bat file was unsuccessful in initiating the python file.....Failed for me in Arena...Banksia....Cutechess & Pythonchess Gui's (CPU) even more difficult to execute for GPU....ARdkappe wrote: ↑Sun Mar 20, 2022 10:58 am King of the hill is a0lite, but it’s a mcts/nn engine, so speed is less important. https://github.com/dkappe/a0lite
Add in a gpu and it can go all the way to 2850++. It made it all the way to L4 a few TCEC seasons ago.