Sargon 1978 UCI Available

Discussion of anything and everything relating to chess playing software and machines.

Moderators: Harvey Williamson, bob, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Bill Forster
Posts: 34
Joined: Mon Sep 21, 2015 5:47 am
Location: New Zealand
Contact:

Re: Sargon 1978 UCI Available

Post by Bill Forster » Wed Jun 03, 2020 12:20 am

Tibono wrote:
Tue Jun 02, 2020 2: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).

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
100% moves fit!
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 :D

Cheers,
Tibono
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.

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.


Vinvin
Posts: 4766
Joined: Thu Mar 09, 2006 8:40 am
Full name: Vincent Lejeune

Re: Sargon 1978 UCI Available

Post by Vinvin » Wed Jun 03, 2020 1:39 am

Bill Forster wrote:
Wed Jun 03, 2020 12:20 am
... 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.
In your opinion, how faster would it run if you rewrite (with the same logic) the engine with modern ASM instructions ?
Bill Forster wrote:
Wed Jun 03, 2020 12:20 am
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.
We should set a 100 games match against a 1800 rated engine using a time control to match level 5 or 6. ;-)

Bill Forster
Posts: 34
Joined: Mon Sep 21, 2015 5:47 am
Location: New Zealand
Contact:

Re: Sargon 1978 UCI Available

Post by Bill Forster » Wed Jun 03, 2020 11:28 pm

Vinvin wrote:
Wed Jun 03, 2020 1:39 am
In your opinion, how faster would it run if you rewrite (with the same logic) the engine with modern ASM instructions ?
I think a 2X speed up would be a reasonably modest effort, basically rewriting the hotspots. I think reworking the whole thing with idiomatic X86 assembly and 32 bit (or 64 bit) pointers instead of artificial 16 bit pointer emulation would likely top out at something like 4 or 5X maybe, after tons of work. I might do the former (it would be fun), but the latter is too much work for too little gain. Even a 5X speedup is only half a ply or something and with Shannon A plus SOMA I don't think this is much of a strength boost at all. If 6000X speed up only increases strength modestly, 30000X speed up is not going to be earth shattering.
Vinvin wrote:
Wed Jun 03, 2020 1:39 am
We should set a 100 games match against a 1800 rated engine using a time control to match level 5 or 6. ;-)
I don't think Sargon would do well. I don't usually dabble with engine matches at all, but I did try and test Sargon with Arena. It got totally hammered by Hermann and one of the other bundled engines (can't remember off the top of my head). Then I tried it with my own Tarrasch Toy Engine V0.906. This engine is rated by CCRL as Elo 1492
http://ccrl.chessdom.com/ccrl/404/cgi/e ... gine_0_906

It also beat up Sargon pretty badly, although Sargon scored a few points (a big problem was that I didn't know what I was doing with Arena, and I kept getting duplicate games, and effectively many less games than I was specifying). Sargon did better against V0.905 which is a bit weaker mainly because it doesn't use its time as well (making it more fun to play). Maybe my 1200 Elo estimate is a little conservative and 1300 is possible, but not a lot more than that.

User avatar
AdminX
Posts: 5515
Joined: Mon Mar 13, 2006 1:34 pm
Location: Acworth, GA
Contact:

Re: Sargon 1978 UCI Available

Post by AdminX » Thu Jun 04, 2020 9:12 am

From my observations Tarrasch Toy would be a good opponent to satrt out with for a match. Here are two games played at default depth 0. I would also look a Cdrill, but I think that might me to strong for Sargon.



"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers

User avatar
AdminX
Posts: 5515
Joined: Mon Mar 13, 2006 1:34 pm
Location: Acworth, GA
Contact:

Re: Sargon 1978 UCI Available

Post by AdminX » Thu Jun 04, 2020 9:37 am

Or maybe not ... :D At depth 6 it crushed Tarrasch Toy. Appeared to be more tactically alert.

"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers

User avatar
AdminX
Posts: 5515
Joined: Mon Mar 13, 2006 1:34 pm
Location: Acworth, GA
Contact:

Re: Sargon 1978 UCI Available

Post by AdminX » Thu Jun 04, 2020 10:18 am

Confirmed, Cdrill is just to strong for Sargon v.1

"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers

Ras
Posts: 1471
Joined: Tue Aug 30, 2016 6:19 pm
Full name: Rasmus Althoff
Contact:

Re: Sargon 1978 UCI Available

Post by Ras » Thu Jun 04, 2020 10:27 am

Bill Forster wrote:
Wed Jun 03, 2020 12:20 am
It's a shame that even a 6000 times speed up is insufficient to make Sargon 1978 strong.
I have tested the UCI version of Sargon against my CT800 engine which allows node rate throttling. Sargon gives about 30 kNPS on my PC. The CT800 (CCRL 2390 or so) typically has around 1500 kNPS on my machine. Now I throttled my engine to 30 kNPS, and it still crushes Sargon although Sargon gets 50 times more computing power. Incidentally, 30 kNPS is what my engine has on a Cortex-M4 microcontroller, so that's still a lot stronger than Sargon on a PC.

However, Sargon would run on its original hardware while my engine requires about 256k ROM and 175k RAM as minimum.
Rasmus Althoff
https://www.ct800.net

ThatsIt
Posts: 971
Joined: Thu Mar 09, 2006 1:11 pm
Contact:

Re: Sargon 1978 UCI Available

Post by ThatsIt » Thu Jun 04, 2020 1:11 pm

Sargon is clueless regarding the 3-fold-repetition!
One example out of many:



Best wishes,
G.S.
(CEGT team)

Chessqueen
Posts: 1078
Joined: Wed Sep 05, 2018 12:16 am
Full name: Nancy M Pichardo

Re: Sargon 1978 UCI Available

Post by Chessqueen » Thu Jun 04, 2020 1:16 pm

rcmaddox wrote:
Wed May 27, 2020 2:58 am
Bill Forster, author of the Tarrasch GUI, has released a UCI version of Sargon, the well known program from the Spracklens.

I had a copy of Sargon in the early 80's running on my Commodore VIC-20, using a black and white television for a monitor! It was my first chess software that wasn't in a dedicated chess computer.

So here ya go:

Main Tarrasch GUI Website ---->> http://www.triplehappy.com/
Link to Releveant Blog Post ---->> https://triplehappy.wordpress.com/
Does it run in IBM compatible computers ?

rcmaddox
Posts: 180
Joined: Mon Oct 14, 2013 6:59 pm
Location: Winder, GA
Full name: Robert C. Maddox

Re: Sargon 1978 UCI Available

Post by rcmaddox » Thu Jun 04, 2020 4:49 pm

Chessqueen wrote:
Thu Jun 04, 2020 1:16 pm
rcmaddox wrote:
Wed May 27, 2020 2:58 am
Bill Forster, author of the Tarrasch GUI, has released a UCI version of Sargon, the well known program from the Spracklens.

I had a copy of Sargon in the early 80's running on my Commodore VIC-20, using a black and white television for a monitor! It was my first chess software that wasn't in a dedicated chess computer.

So here ya go:

Main Tarrasch GUI Website ---->> http://www.triplehappy.com/
Link to Releveant Blog Post ---->> https://triplehappy.wordpress.com/
Does it run in IBM compatible computers ?
Yes.

Post Reply