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 2:14 pmHi 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
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.