Thanks so much! I couldn't hope for a better result. 100% move verification and excellent speed. I was forgetting that these days emulators are throttled back to avoid running too quickly (!?) so you were even able to answer my question about how much faster my modern translation is than the original Z80 version. 6000 times faster is much better than I hoped for. Credit for Intel (and AMD I suppose), my understanding is that many of the Z80 instructions translate to old fashioned 16 bit 8086 instructions that are kept around only for backwards compatibility and are implemented in microcode rather than in hardware. Still pretty damn quick.Tibono wrote: ↑Tue Jun 02, 2020 4:14 pm Hi Bill,
no worries, the gift you made us with this UCI port deserves feedback...
Here is a comparison table;
- UCI version running with Arena on my old laptop HP620, CPU T4500 @2,3Ghz (dual core), Win7 64bits, CPU & RAM win perf index = 5.8; time per move is the one reported by the Arena GUI
- TRS-80 version running with TRS32 emulator v1.27 (c) Matthew Reed http://www.trs-80emulators.com ; TRS-80 model 1 (Z80@1,77Mhz) but for this test I set it to x10 speed-up, so 17,74Mhz. Time per move manually measured with a (nice!) vintage mechanical stopwatch, 1/10s measurement accuracy, reported times already multiplied by 10 (so 1s accuracy or so).100% moves fit!Code: Select all
Sargon I UCI lv2 Sargon I TRS-80 lv2 move time(s) move time(s) 1.e2e4 e7e5 0,000 e7e5 0 2.g1f3 Nb8c6 0,006 Nb8c6 27,5 ..... 19.Ra1d1 Be6c4 0,025 Be6c4 162 20.Rf1e1 Rh8e8 0,014 Rh8e8 157,5 Total time 0,265 1833 Average time 0,013 91,7 Speed ratio 6917 Sargon I UCI lv3 Sargon I TRS-80 lv3 move time(s) move time(s) 1.e2e4 e7e5 0,000 e7e5 0 2.g1f3 Nb8c6 0,095 Nb8c6 646 ... 18.c2c3 d4xc3 0,216 d4xc3 1349 19.Bd2xc3 b7b5 0,455 b7b5 2718 20.a4xb5 a6xb5 0,236 a6xb5 1431 Total time 3,289 20144 Average time 0,164 1007,2 Speed ratio 6125
The original Sargon ran on a Jupiter III - faster than a TRS-80 model I, but I am not sure of its original speed - I found references with 2 or 4.3Mhz. Mame emulates it @4Mhz.
Should you like a fast check of moves similarity, you can get this light emulator. It is not throttled for reference speed, and plays in few seconds at lv3. I replayed the fist ten moves from my above test at level 3, no move deviation as well
Cheers,
Tibono
This result almost makes the dozens of hours I spent debugging, wondering why the program was spiralling out of control (as inevitably happens until you get every last detail right) worthwhile by itself. It's a shame that even a 6000 times speed up is insufficient to make Sargon 1978 strong. There is a theory that throwing speed and memory at even the most primitive engine is sufficient to do that, and I was kind of hoping to confirm this theory. I think the problem is the inherent weakness of the Shannon type A strategy, even with SOMA. Maybe things would be different with a slightly later version of Sargon. Oh well.
I am impressed that you had the patience to hand time these moves, which took serious time at level 3 (even accounting for the 10 times correction that you made - run emulator at 10x speed, so multiply hand measured times by 10 to compensate). Thank you.
One thing I regret in my implementation is that in normal mode (when my FixedDepth parameter is set to the default of 0) I run Sargon at depths 3,4,5... until I judge that I've used enough time for one move. I did this because I judged depth 3 to be essentially instantaneous. But it's really not. I should have gone depths 1,2,3,4,5... which would hardly affect things normally - but would allow Sargon to play these whole game in a second or two matches I've been reading about here.
Finally, I tried out the Jupiter emulation you linked to. I played quick a FixedDepth=4 game against Sargon with my Tarrasch GUI (below - Sargon almost demonstrates that my previous assertion that it could never beat me is wrong), then tried to reproduce with the Jupiter Emulator. Everything seems great for a while. As expected the emulator is about one order of magnitude slower than the native code (10 secs v 1 sec at level 4, approx). But sadly, the emulator (reliably/repeatedly) crashes after 14. g3, failing to produce 14... O-O-O. The provenance of the Jupiter code is the same as my code, I used Andre Adrian's transcription as one of my inputs. I might see if I can check my Git logs to see if there's a fix I made somewhere that could account for this.
[pgn]
[Event "Test game, Sargon FixedDepth=4"]
[Site "?"]
[Date "2020.06.03"]
[Round "?"]
[White "Bill"]
[Black "Sargon 1978 V1.00"]
[Result "1-0"]
1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4 5. d4 Nxd4 6. Nxd4 exd4 7. Re1 f5 8.
f3 c6 9. Bf1 d5 10. fxe4 dxe4 11. c3 Be6 12. Qxd4 Qxd4+ 13. cxd4 Bd6 14. g3
O-O-O 15. Be3 Kc7 16. Nc3 Rhf8 17. Rac1 f4 18. Nb5+ Kb6 19. Nxd6 fxe3 20. Nxe4
Rxd4 21. Rxe3 Bxa2 22. Bg2 h6 23. Rce1 Bc4 24. Nc3 Rd2 25. b4 Rd4 26. Rd1 Rxd1+
27. Nxd1 Rd8 28. Nb2 Kb5 29. Nxc4 Kxc4 30. Re7 Rd1+ 31. Kf2 Rd2+ 32. Kf3 g5 33.
Rxb7 g4+ 34. Kxg4 Rxg2 35. h4 Ra2 36. Rh7 Kxb4 37. Rxh6 Ra4 38. Rf6 Kc5+ 39.
Kg5 Ra2 40. h5 Rd2 41. h6 Rd5+ 42. Kg6 Rd6 43. Rxd6 Kxd6 44. h7 Kc7 45. h8=Q a6
46. Qa1 Kb6 47. Kf6 a5 48. g4 Kb5 49. g5 a4 50. g6 Kb4 51. g7 a3 52. g8=Q c5
53. Qga2 c4 54. Qxa3+ Kb5 55. Qe5+ Kc6 56. Qa6+ Kd7 57. Qe7# 1-0
[/pgn]