Sargon 1978 UCI Available

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

Moderators: hgm, Rebel, chrisw

mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Sargon 1978 UCI Available

Post by mwyoung »

mwyoung wrote: Sat Oct 17, 2020 1:47 am
lkaufman wrote: Sat Oct 17, 2020 1:32 am
Laskos wrote: Sat Oct 17, 2020 12:59 am
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?

Maybe that helps:

http://talkchess.com/forum3/viewtopic.p ... 1&start=12
OK, as best as I can figure out from all the posts, the elo rating of Sargon 1 in 1978 was about 1400, and its estimated elo vs. humans on an i7 now is around 1700. The hardware speedup is either 50 to 1 or 6000+ to 1 depending on which post you believe; if it is 50 to 1 this all makes sense, since 1700 elo is not too far out of line with 1254 CCRL Blitz if you contract rating differences by a third or so. I get 52knps on my very fast i7 which means about 40k on a typical one, so if there is some evidence that the original hardware got around 800 nps then everything fits. The 6000 to 1 figure is hard to credit, especially since it referred to using some old hardware, not an i7, so an i7 might be 10000 to 1 which means the original Sargon got 4 nodes per second?? That seems impossibly low.
I note that the 1700 elo mentioned was based on Shredder and SF versions set to 1600, but does anyone know whether those ratings were themselves based on human games or on games with CCRL rated engines?
You can estimate the speed up. The level times 1ply meaning level 1, 2 to 2..... level 6 for 6 ply took an average of 4 hours. Sargon did not have time controls only levels. Take a few positions and see how long your Sargon takes to search 6 ply. And compare that to 4 hours.This will give you a speed ratio compared to a TRS-80 computer.
I took 7 position from the opening no end game or middle game positions. So the worse case. This averaged to 10.2 seconds. 14400 (4 hours) seconds divided by 10.2 seconds = 1,411.76 times faster then Sargon running on a TRS-80.

""It has been so long since I owned Sargon. Or a TRS-80, or as I called it the Trash-80. I looked up the instructions.

Hardware needed: one TRS-80 level II with 32k of memory minimum. :lol:

Levels of Play (time per move average)

0 - Immediate response
1 - 20 seconds
2 - 1 minutes
3 - 2 minutes
4 - 6 minutes
5 - 40 minutes
6 - 4 hours ""
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.
lkaufman
Posts: 5960
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA

Re: Sargon 1978 UCI Available

Post by lkaufman »

mwyoung wrote: Sat Oct 17, 2020 1:47 am
lkaufman wrote: Sat Oct 17, 2020 1:32 am
Laskos wrote: Sat Oct 17, 2020 12:59 am
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?

Maybe that helps:

http://talkchess.com/forum3/viewtopic.p ... 1&start=12
OK, as best as I can figure out from all the posts, the elo rating of Sargon 1 in 1978 was about 1400, and its estimated elo vs. humans on an i7 now is around 1700. The hardware speedup is either 50 to 1 or 6000+ to 1 depending on which post you believe; if it is 50 to 1 this all makes sense, since 1700 elo is not too far out of line with 1254 CCRL Blitz if you contract rating differences by a third or so. I get 52knps on my very fast i7 which means about 40k on a typical one, so if there is some evidence that the original hardware got around 800 nps then everything fits. The 6000 to 1 figure is hard to credit, especially since it referred to using some old hardware, not an i7, so an i7 might be 10000 to 1 which means the original Sargon got 4 nodes per second?? That seems impossibly low.
I note that the 1700 elo mentioned was based on Shredder and SF versions set to 1600, but does anyone know whether those ratings were themselves based on human games or on games with CCRL rated engines?
You can estimate the speed up. The level times 1ply meaning level 1, 2 to 2..... level 6 for 6 ply took an average of 4 hours. Sargon did not have time controls only levels. Take a few positions and see how long your Sargon takes to search 6 ply. And compare that to 4 hours.This will give you a speed ratio compared to a TRS-80 computer.
I get anywhere from 3 to 36 seconds with depth set to 6, maybe 15 seconds or so average, which would give a 960 to 1 ratio. That implies that Sargon got about 50 nodes per second on the TRS-80. Was it really that slow, or could it perhaps be nonlinear, maybe the ratio is much lower for a 4 ply search than for a six ply search for example?
Komodo rules!
mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Sargon 1978 UCI Available

Post by mwyoung »

lkaufman wrote: Sat Oct 17, 2020 2:21 am
mwyoung wrote: Sat Oct 17, 2020 1:47 am
lkaufman wrote: Sat Oct 17, 2020 1:32 am
Laskos wrote: Sat Oct 17, 2020 12:59 am
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?

Maybe that helps:

http://talkchess.com/forum3/viewtopic.p ... 1&start=12
OK, as best as I can figure out from all the posts, the elo rating of Sargon 1 in 1978 was about 1400, and its estimated elo vs. humans on an i7 now is around 1700. The hardware speedup is either 50 to 1 or 6000+ to 1 depending on which post you believe; if it is 50 to 1 this all makes sense, since 1700 elo is not too far out of line with 1254 CCRL Blitz if you contract rating differences by a third or so. I get 52knps on my very fast i7 which means about 40k on a typical one, so if there is some evidence that the original hardware got around 800 nps then everything fits. The 6000 to 1 figure is hard to credit, especially since it referred to using some old hardware, not an i7, so an i7 might be 10000 to 1 which means the original Sargon got 4 nodes per second?? That seems impossibly low.
I note that the 1700 elo mentioned was based on Shredder and SF versions set to 1600, but does anyone know whether those ratings were themselves based on human games or on games with CCRL rated engines?
You can estimate the speed up. The level times 1ply meaning level 1, 2 to 2..... level 6 for 6 ply took an average of 4 hours. Sargon did not have time controls only levels. Take a few positions and see how long your Sargon takes to search 6 ply. And compare that to 4 hours.This will give you a speed ratio compared to a TRS-80 computer.
I get anywhere from 3 to 36 seconds with depth set to 6, maybe 15 seconds or so average, which would give a 960 to 1 ratio. That implies that Sargon got about 50 nodes per second on the TRS-80. Was it really that slow, or could it perhaps be nonlinear, maybe the ratio is much lower for a 4 ply search than for a six ply search for example?
Yes, I was remember numbers lower then 50 nps, 35 nps is what I keep remembering. But it has been so long ago.

Here is something a bit more formal. Data recorded with BanksiaGUI. A 2 game Sargon (2950x cpu) average time to depth to 6 ply of 5.9 seconds. This gives a speed up of 2,440.67 times faster then Sargon running on a TRS-80 II. This give a NPS on a TRS-80 II 14.58 NPS.

And you should be even faster then this. If I remember your CPU correctly.

Code: Select all

TRS-80 Model II
Manufacturer	Tandy Corporation
Type	Personal computer
Release date	October 1979; 41 years ago[3]
Introductory price	US$3,450 (equivalent to $12,153 in 2019) (32KB)
US$3,899 (equivalent to $13,735 in 2019) (64KB)
Operating system	TRSDOS, Microsoft Basic
CPU	Z-80A @ 4.00 MHz
Memory	either 32 or 64k of RAM
Storage	singled-sided Shugart 500k 8" floppy drive
Display	80x25 text
Input	detachable keyboard
Dimensions	14 x 21 1/4 x 23 1/2 inch

Code: Select all

Result:
-------------------------------------------------------------------------------
  #  name               games    wins   draws  losses   score    los%  elo+/-
  1. Sargon 1978 V1.00      2       1       0       1     1.0    50.0    -0.0
  2. Stockfish 141020       2       1       0       1     1.0    50.0    -0.0

Cross table:
-------------------------------------------------------------------------------
  #  name                  score   games         1         2
  1. Sargon 1978 V1.00       1.0       2         x        01
  2. Stockfish 141020        1.0       2        10         x

Tech:
-------------------------------------------------------------------------------

Tech (average nodes, depths, time/m per move, others per game), counted for computing moves only, ignored moves with zero nodes:
  #  name                 nodes/m         NPS  depth/m   time/m    moves     time
  1. Sargon 1978 V1.00       209K       35585      6.0      5.9     50.5    296.3
  2. Stockfish 141020         21K     1206701      6.0      0.0     50.5      0.9
     all ---                 112K       39025      6.0      2.9     50.5    148.6
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.
mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Sargon 1978 UCI Available

Post by mwyoung »

mwyoung wrote: Sat Oct 17, 2020 2:49 am
lkaufman wrote: Sat Oct 17, 2020 2:21 am
mwyoung wrote: Sat Oct 17, 2020 1:47 am
lkaufman wrote: Sat Oct 17, 2020 1:32 am
Laskos wrote: Sat Oct 17, 2020 12:59 am
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?

Maybe that helps:

http://talkchess.com/forum3/viewtopic.p ... 1&start=12
OK, as best as I can figure out from all the posts, the elo rating of Sargon 1 in 1978 was about 1400, and its estimated elo vs. humans on an i7 now is around 1700. The hardware speedup is either 50 to 1 or 6000+ to 1 depending on which post you believe; if it is 50 to 1 this all makes sense, since 1700 elo is not too far out of line with 1254 CCRL Blitz if you contract rating differences by a third or so. I get 52knps on my very fast i7 which means about 40k on a typical one, so if there is some evidence that the original hardware got around 800 nps then everything fits. The 6000 to 1 figure is hard to credit, especially since it referred to using some old hardware, not an i7, so an i7 might be 10000 to 1 which means the original Sargon got 4 nodes per second?? That seems impossibly low.
I note that the 1700 elo mentioned was based on Shredder and SF versions set to 1600, but does anyone know whether those ratings were themselves based on human games or on games with CCRL rated engines?
You can estimate the speed up. The level times 1ply meaning level 1, 2 to 2..... level 6 for 6 ply took an average of 4 hours. Sargon did not have time controls only levels. Take a few positions and see how long your Sargon takes to search 6 ply. And compare that to 4 hours.This will give you a speed ratio compared to a TRS-80 computer.
I get anywhere from 3 to 36 seconds with depth set to 6, maybe 15 seconds or so average, which would give a 960 to 1 ratio. That implies that Sargon got about 50 nodes per second on the TRS-80. Was it really that slow, or could it perhaps be nonlinear, maybe the ratio is much lower for a 4 ply search than for a six ply search for example?
Yes, I was remember numbers lower then 50 nps, 35 nps is what I keep remembering. But it has been so long ago.

Here is something a bit more formal. Data recorded with BanksiaGUI. A 2 game Sargon (2950x cpu) average time to depth to 6 ply of 5.9 seconds. This gives a speed up of 2,440.67 times faster then Sargon running on a TRS-80 II. This give a NPS on a TRS-80 II 14.58 NPS.

And you should be even faster then this. If I remember your CPU correctly.

Code: Select all

TRS-80 Model II
Manufacturer	Tandy Corporation
Type	Personal computer
Release date	October 1979; 41 years ago[3]
Introductory price	US$3,450 (equivalent to $12,153 in 2019) (32KB)
US$3,899 (equivalent to $13,735 in 2019) (64KB)
Operating system	TRSDOS, Microsoft Basic
CPU	Z-80A @ 4.00 MHz
Memory	either 32 or 64k of RAM
Storage	singled-sided Shugart 500k 8" floppy drive
Display	80x25 text
Input	detachable keyboard
Dimensions	14 x 21 1/4 x 23 1/2 inch

Code: Select all

Result:
-------------------------------------------------------------------------------
  #  name               games    wins   draws  losses   score    los%  elo+/-
  1. Sargon 1978 V1.00      2       1       0       1     1.0    50.0    -0.0
  2. Stockfish 141020       2       1       0       1     1.0    50.0    -0.0

Cross table:
-------------------------------------------------------------------------------
  #  name                  score   games         1         2
  1. Sargon 1978 V1.00       1.0       2         x        01
  2. Stockfish 141020        1.0       2        10         x

Tech:
-------------------------------------------------------------------------------

Tech (average nodes, depths, time/m per move, others per game), counted for computing moves only, ignored moves with zero nodes:
  #  name                 nodes/m         NPS  depth/m   time/m    moves     time
  1. Sargon 1978 V1.00       209K       35585      6.0      5.9     50.5    296.3
  2. Stockfish 141020         21K     1206701      6.0      0.0     50.5      0.9
     all ---                 112K       39025      6.0      2.9     50.5    148.6
I found this information. And It looks like we got pretty close to what was expected in our calculations.

"I expect this to be between two and three orders of magnitude faster than the original Z80 machine, so I don't imagine many users set the search depth to maximum!"

Code: Select all

How Well does it Work?
Potential users/tinkerers should have realistic expectations, the program dates from an era when the humblest club player could beat chess programs running on consumer grade hardware. This was the very first version of Sargon, a project that went through many more versions, becoming much stronger during the product's lifecycle. Sargon was an important product in computer chess history, and I still think the surprising decision the Spracklen's made to make the source code of their nascent commercial product available is important and worth celebrating (by bringing that code back to life).

This version of Sargon used fixed depth, full width search. In other words it did not prune its search tree, considering every single move out to a fixed depth. The depth was a user selectable option, with 6 (ply) being the maximum setting. On my (cheap, aging) commodity laptop, sargon-engine.exe might take something like 30 seconds to perform the 6 ply search in a typical middlegame position. I expect this to be between two and three orders of magnitude faster than the original Z80 machine, so I don't imagine many users set the search depth to maximum!

One improvement I have been able to make without changing any of Sargon's core code is to extend the maximum search depth from 6 to 20 (because I am not limited to a few K of memory) and to make the search depth dynamic rather than fixed. I use an iterative approach. When the GUI asks the engine to analyse a position I start with depth=3 (which is essentially instantaneous), present the results, then move to depth=4, and so on. If the GUI wants the engine to analyse indefinitely (kibitzing) I just continue iterating all the way up to depth=20. It's important to understand though that the time required increases exponentially. Seconds for depth 4, minutes by depth 7, hours by depth 9, days (10), weeks (11), years probably (13 or so). Basically it will never get to 20. Theoretically the minimax algorithm (which Sargon implements effectively - not quite perfectly because it doesn't consider under-promotion) can 'solve chess perfectly'. But in fact chess will never be absolutely solved unless we can somehow turn every atom in the universe into a computer co-operating on solving the problem (and not even then). This is why we can't have nice things.

During human v engine or engine v engine operation the GUI tells sargon-engine the time left for the game and I use a simple adaptive algorithm to decide when to stop iterating and present the best move discovered to date.

I have implemented a FixedDepth engine parameter which allows emulation of the original Sargon program's behaviour. If FixedDepth is set to a non-zero number then sargon-engine doesn't iterate at all when playing a game, it just goes straight to the assigned depth. This actually has some efficiency advantages, since iterating from depth 5 (say) to depth 6 was not contemplated in the original Sargon code at all, so when I do that I am in effect discarding all of the depth 5 information and starting again. That sounds terrible, but remember the exponential growth means that the depth 6 required time will far exceed the sum of depth 3,4 and 5 required time, so relatively speaking it's not wasting that much time. Iteration works well and is very pragmatic and effective in this Sargon implementation.

It might sound that extending Sargon's search depth well beyond 6 hasn't been very useful because the exponential growth makes levels beyond 8 or so inaccessible in practice. This would be true if chess stopped in the middlegame, but as more and more pieces come off the board, there are less moves to look at in each position, and Sargon can see deeper in a reasonable time. This is the real beauty of adaptive rather than fixed depth. As a simple example consider the position with White (to play) king on e4, pawn on d4, Black king on d7. A serious human player will instantaneously play Kd5 here, knowing that this is the only way to eventually force pawn promotion. Sargon, with absolutely no chess knowledge, just the ability to calculate variations in search of extra material or board control, plays Kd5 at depth 13 (or more). The PV associated with this move features the pawn queening triumphantly right at the end of the line. It takes 3 minutes and 30 seconds to make the calculation on my computer. It's hardly world shattering but it's vastly beyond the capacity of the original Z80 implementation, and shows what a faster CPU and more memory can do to an otherwise fixed chess calculation algorithm.

However there's no doubt that in general the horizon effect, as it is called, is a massive limitation on the strength of an engine that does a full width, fixed depth search with no pruning. Sargon runs well enough. It plays ugly anti-positional chess, but it does try to mobilise it's pieces and it's pretty decent at tactics and will sometimes tear you apart in a complex middlegame if you don't pay attention. But then it might not be able to finish you off. Despite being able to search deeper it still doesn't understand endgames because promoting pawns takes so many ply. And even winning with say K+Q v K is beyond its horizon unless the opponent's king is already corralled with Sargon's king nearby. I am tempted to add a simple "king in a decreasing sized box" type heuristic to the scoring function to fix that - but that's not really software archaeology is it? A similar problem, probably fixable in the same way is that Sargon will sometimes drift and concede a draw by repeating moves even in an overwhelming position. This is a reflection of Sargon's scoring function, which doesn't have any positional knowledge. Sargon just tries to win material, and if that's not possible control more squares than the opponent. This was typical of the era, in the early days of chess programming the pioneers were delighted to find that minimax plus alpha beta and a simple material plus board control scoring function was sufficient to play at least reasonable chess. But it was only a starting point for real progress.
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.
lkaufman
Posts: 5960
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA

Re: Sargon 1978 UCI Available

Post by lkaufman »

mwyoung wrote: Sat Oct 17, 2020 4:03 am
mwyoung wrote: Sat Oct 17, 2020 2:49 am
lkaufman wrote: Sat Oct 17, 2020 2:21 am
mwyoung wrote: Sat Oct 17, 2020 1:47 am
lkaufman wrote: Sat Oct 17, 2020 1:32 am
Laskos wrote: Sat Oct 17, 2020 12:59 am
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?

Maybe that helps:

http://talkchess.com/forum3/viewtopic.p ... 1&start=12
OK, as best as I can figure out from all the posts, the elo rating of Sargon 1 in 1978 was about 1400, and its estimated elo vs. humans on an i7 now is around 1700. The hardware speedup is either 50 to 1 or 6000+ to 1 depending on which post you believe; if it is 50 to 1 this all makes sense, since 1700 elo is not too far out of line with 1254 CCRL Blitz if you contract rating differences by a third or so. I get 52knps on my very fast i7 which means about 40k on a typical one, so if there is some evidence that the original hardware got around 800 nps then everything fits. The 6000 to 1 figure is hard to credit, especially since it referred to using some old hardware, not an i7, so an i7 might be 10000 to 1 which means the original Sargon got 4 nodes per second?? That seems impossibly low.
I note that the 1700 elo mentioned was based on Shredder and SF versions set to 1600, but does anyone know whether those ratings were themselves based on human games or on games with CCRL rated engines?
You can estimate the speed up. The level times 1ply meaning level 1, 2 to 2..... level 6 for 6 ply took an average of 4 hours. Sargon did not have time controls only levels. Take a few positions and see how long your Sargon takes to search 6 ply. And compare that to 4 hours.This will give you a speed ratio compared to a TRS-80 computer.
I get anywhere from 3 to 36 seconds with depth set to 6, maybe 15 seconds or so average, which would give a 960 to 1 ratio. That implies that Sargon got about 50 nodes per second on the TRS-80. Was it really that slow, or could it perhaps be nonlinear, maybe the ratio is much lower for a 4 ply search than for a six ply search for example?
Yes, I was remember numbers lower then 50 nps, 35 nps is what I keep remembering. But it has been so long ago.

Here is something a bit more formal. Data recorded with BanksiaGUI. A 2 game Sargon (2950x cpu) average time to depth to 6 ply of 5.9 seconds. This gives a speed up of 2,440.67 times faster then Sargon running on a TRS-80 II. This give a NPS on a TRS-80 II 14.58 NPS.

And you should be even faster then this. If I remember your CPU correctly.

Code: Select all

TRS-80 Model II
Manufacturer	Tandy Corporation
Type	Personal computer
Release date	October 1979; 41 years ago[3]
Introductory price	US$3,450 (equivalent to $12,153 in 2019) (32KB)
US$3,899 (equivalent to $13,735 in 2019) (64KB)
Operating system	TRSDOS, Microsoft Basic
CPU	Z-80A @ 4.00 MHz
Memory	either 32 or 64k of RAM
Storage	singled-sided Shugart 500k 8" floppy drive
Display	80x25 text
Input	detachable keyboard
Dimensions	14 x 21 1/4 x 23 1/2 inch

Code: Select all

Result:
-------------------------------------------------------------------------------
  #  name               games    wins   draws  losses   score    los%  elo+/-
  1. Sargon 1978 V1.00      2       1       0       1     1.0    50.0    -0.0
  2. Stockfish 141020       2       1       0       1     1.0    50.0    -0.0

Cross table:
-------------------------------------------------------------------------------
  #  name                  score   games         1         2
  1. Sargon 1978 V1.00       1.0       2         x        01
  2. Stockfish 141020        1.0       2        10         x

Tech:
-------------------------------------------------------------------------------

Tech (average nodes, depths, time/m per move, others per game), counted for computing moves only, ignored moves with zero nodes:
  #  name                 nodes/m         NPS  depth/m   time/m    moves     time
  1. Sargon 1978 V1.00       209K       35585      6.0      5.9     50.5    296.3
  2. Stockfish 141020         21K     1206701      6.0      0.0     50.5      0.9
     all ---                 112K       39025      6.0      2.9     50.5    148.6
I found this information. And It looks like we got pretty close to what was expected in our calculations.

"I expect this to be between two and three orders of magnitude faster than the original Z80 machine, so I don't imagine many users set the search depth to maximum!"

Code: Select all

How Well does it Work?
Potential users/tinkerers should have realistic expectations, the program dates from an era when the humblest club player could beat chess programs running on consumer grade hardware. This was the very first version of Sargon, a project that went through many more versions, becoming much stronger during the product's lifecycle. Sargon was an important product in computer chess history, and I still think the surprising decision the Spracklen's made to make the source code of their nascent commercial product available is important and worth celebrating (by bringing that code back to life).

This version of Sargon used fixed depth, full width search. In other words it did not prune its search tree, considering every single move out to a fixed depth. The depth was a user selectable option, with 6 (ply) being the maximum setting. On my (cheap, aging) commodity laptop, sargon-engine.exe might take something like 30 seconds to perform the 6 ply search in a typical middlegame position. I expect this to be between two and three orders of magnitude faster than the original Z80 machine, so I don't imagine many users set the search depth to maximum!

One improvement I have been able to make without changing any of Sargon's core code is to extend the maximum search depth from 6 to 20 (because I am not limited to a few K of memory) and to make the search depth dynamic rather than fixed. I use an iterative approach. When the GUI asks the engine to analyse a position I start with depth=3 (which is essentially instantaneous), present the results, then move to depth=4, and so on. If the GUI wants the engine to analyse indefinitely (kibitzing) I just continue iterating all the way up to depth=20. It's important to understand though that the time required increases exponentially. Seconds for depth 4, minutes by depth 7, hours by depth 9, days (10), weeks (11), years probably (13 or so). Basically it will never get to 20. Theoretically the minimax algorithm (which Sargon implements effectively - not quite perfectly because it doesn't consider under-promotion) can 'solve chess perfectly'. But in fact chess will never be absolutely solved unless we can somehow turn every atom in the universe into a computer co-operating on solving the problem (and not even then). This is why we can't have nice things.

During human v engine or engine v engine operation the GUI tells sargon-engine the time left for the game and I use a simple adaptive algorithm to decide when to stop iterating and present the best move discovered to date.

I have implemented a FixedDepth engine parameter which allows emulation of the original Sargon program's behaviour. If FixedDepth is set to a non-zero number then sargon-engine doesn't iterate at all when playing a game, it just goes straight to the assigned depth. This actually has some efficiency advantages, since iterating from depth 5 (say) to depth 6 was not contemplated in the original Sargon code at all, so when I do that I am in effect discarding all of the depth 5 information and starting again. That sounds terrible, but remember the exponential growth means that the depth 6 required time will far exceed the sum of depth 3,4 and 5 required time, so relatively speaking it's not wasting that much time. Iteration works well and is very pragmatic and effective in this Sargon implementation.

It might sound that extending Sargon's search depth well beyond 6 hasn't been very useful because the exponential growth makes levels beyond 8 or so inaccessible in practice. This would be true if chess stopped in the middlegame, but as more and more pieces come off the board, there are less moves to look at in each position, and Sargon can see deeper in a reasonable time. This is the real beauty of adaptive rather than fixed depth. As a simple example consider the position with White (to play) king on e4, pawn on d4, Black king on d7. A serious human player will instantaneously play Kd5 here, knowing that this is the only way to eventually force pawn promotion. Sargon, with absolutely no chess knowledge, just the ability to calculate variations in search of extra material or board control, plays Kd5 at depth 13 (or more). The PV associated with this move features the pawn queening triumphantly right at the end of the line. It takes 3 minutes and 30 seconds to make the calculation on my computer. It's hardly world shattering but it's vastly beyond the capacity of the original Z80 implementation, and shows what a faster CPU and more memory can do to an otherwise fixed chess calculation algorithm.

However there's no doubt that in general the horizon effect, as it is called, is a massive limitation on the strength of an engine that does a full width, fixed depth search with no pruning. Sargon runs well enough. It plays ugly anti-positional chess, but it does try to mobilise it's pieces and it's pretty decent at tactics and will sometimes tear you apart in a complex middlegame if you don't pay attention. But then it might not be able to finish you off. Despite being able to search deeper it still doesn't understand endgames because promoting pawns takes so many ply. And even winning with say K+Q v K is beyond its horizon unless the opponent's king is already corralled with Sargon's king nearby. I am tempted to add a simple "king in a decreasing sized box" type heuristic to the scoring function to fix that - but that's not really software archaeology is it? A similar problem, probably fixable in the same way is that Sargon will sometimes drift and concede a draw by repeating moves even in an overwhelming position. This is a reflection of Sargon's scoring function, which doesn't have any positional knowledge. Sargon just tries to win material, and if that's not possible control more squares than the opponent. This was typical of the era, in the early days of chess programming the pioneers were delighted to find that minimax plus alpha beta and a simple material plus board control scoring function was sufficient to play at least reasonable chess. But it was only a starting point for real progress.
It seems that its blindness to repetition draws makes any ratings or results it obtains rather questionable; probably it would have a significantly higher CCRL blitz rating with this one bug fixed. I imagine it was fixed with a later Sargon version, although I don't know this. I don't think of this as a question of evaluation, it is just not knowing the rules of the game.
Komodo rules!
mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Sargon 1978 UCI Available

Post by mwyoung »

lkaufman wrote: Sat Oct 17, 2020 4:53 am
mwyoung wrote: Sat Oct 17, 2020 4:03 am
mwyoung wrote: Sat Oct 17, 2020 2:49 am
lkaufman wrote: Sat Oct 17, 2020 2:21 am
mwyoung wrote: Sat Oct 17, 2020 1:47 am
lkaufman wrote: Sat Oct 17, 2020 1:32 am
Laskos wrote: Sat Oct 17, 2020 12:59 am
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?

Maybe that helps:

http://talkchess.com/forum3/viewtopic.p ... 1&start=12
OK, as best as I can figure out from all the posts, the elo rating of Sargon 1 in 1978 was about 1400, and its estimated elo vs. humans on an i7 now is around 1700. The hardware speedup is either 50 to 1 or 6000+ to 1 depending on which post you believe; if it is 50 to 1 this all makes sense, since 1700 elo is not too far out of line with 1254 CCRL Blitz if you contract rating differences by a third or so. I get 52knps on my very fast i7 which means about 40k on a typical one, so if there is some evidence that the original hardware got around 800 nps then everything fits. The 6000 to 1 figure is hard to credit, especially since it referred to using some old hardware, not an i7, so an i7 might be 10000 to 1 which means the original Sargon got 4 nodes per second?? That seems impossibly low.
I note that the 1700 elo mentioned was based on Shredder and SF versions set to 1600, but does anyone know whether those ratings were themselves based on human games or on games with CCRL rated engines?
You can estimate the speed up. The level times 1ply meaning level 1, 2 to 2..... level 6 for 6 ply took an average of 4 hours. Sargon did not have time controls only levels. Take a few positions and see how long your Sargon takes to search 6 ply. And compare that to 4 hours.This will give you a speed ratio compared to a TRS-80 computer.
I get anywhere from 3 to 36 seconds with depth set to 6, maybe 15 seconds or so average, which would give a 960 to 1 ratio. That implies that Sargon got about 50 nodes per second on the TRS-80. Was it really that slow, or could it perhaps be nonlinear, maybe the ratio is much lower for a 4 ply search than for a six ply search for example?
Yes, I was remember numbers lower then 50 nps, 35 nps is what I keep remembering. But it has been so long ago.

Here is something a bit more formal. Data recorded with BanksiaGUI. A 2 game Sargon (2950x cpu) average time to depth to 6 ply of 5.9 seconds. This gives a speed up of 2,440.67 times faster then Sargon running on a TRS-80 II. This give a NPS on a TRS-80 II 14.58 NPS.

And you should be even faster then this. If I remember your CPU correctly.

Code: Select all

TRS-80 Model II
Manufacturer	Tandy Corporation
Type	Personal computer
Release date	October 1979; 41 years ago[3]
Introductory price	US$3,450 (equivalent to $12,153 in 2019) (32KB)
US$3,899 (equivalent to $13,735 in 2019) (64KB)
Operating system	TRSDOS, Microsoft Basic
CPU	Z-80A @ 4.00 MHz
Memory	either 32 or 64k of RAM
Storage	singled-sided Shugart 500k 8" floppy drive
Display	80x25 text
Input	detachable keyboard
Dimensions	14 x 21 1/4 x 23 1/2 inch

Code: Select all

Result:
-------------------------------------------------------------------------------
  #  name               games    wins   draws  losses   score    los%  elo+/-
  1. Sargon 1978 V1.00      2       1       0       1     1.0    50.0    -0.0
  2. Stockfish 141020       2       1       0       1     1.0    50.0    -0.0

Cross table:
-------------------------------------------------------------------------------
  #  name                  score   games         1         2
  1. Sargon 1978 V1.00       1.0       2         x        01
  2. Stockfish 141020        1.0       2        10         x

Tech:
-------------------------------------------------------------------------------

Tech (average nodes, depths, time/m per move, others per game), counted for computing moves only, ignored moves with zero nodes:
  #  name                 nodes/m         NPS  depth/m   time/m    moves     time
  1. Sargon 1978 V1.00       209K       35585      6.0      5.9     50.5    296.3
  2. Stockfish 141020         21K     1206701      6.0      0.0     50.5      0.9
     all ---                 112K       39025      6.0      2.9     50.5    148.6
I found this information. And It looks like we got pretty close to what was expected in our calculations.

"I expect this to be between two and three orders of magnitude faster than the original Z80 machine, so I don't imagine many users set the search depth to maximum!"

Code: Select all

How Well does it Work?
Potential users/tinkerers should have realistic expectations, the program dates from an era when the humblest club player could beat chess programs running on consumer grade hardware. This was the very first version of Sargon, a project that went through many more versions, becoming much stronger during the product's lifecycle. Sargon was an important product in computer chess history, and I still think the surprising decision the Spracklen's made to make the source code of their nascent commercial product available is important and worth celebrating (by bringing that code back to life).

This version of Sargon used fixed depth, full width search. In other words it did not prune its search tree, considering every single move out to a fixed depth. The depth was a user selectable option, with 6 (ply) being the maximum setting. On my (cheap, aging) commodity laptop, sargon-engine.exe might take something like 30 seconds to perform the 6 ply search in a typical middlegame position. I expect this to be between two and three orders of magnitude faster than the original Z80 machine, so I don't imagine many users set the search depth to maximum!

One improvement I have been able to make without changing any of Sargon's core code is to extend the maximum search depth from 6 to 20 (because I am not limited to a few K of memory) and to make the search depth dynamic rather than fixed. I use an iterative approach. When the GUI asks the engine to analyse a position I start with depth=3 (which is essentially instantaneous), present the results, then move to depth=4, and so on. If the GUI wants the engine to analyse indefinitely (kibitzing) I just continue iterating all the way up to depth=20. It's important to understand though that the time required increases exponentially. Seconds for depth 4, minutes by depth 7, hours by depth 9, days (10), weeks (11), years probably (13 or so). Basically it will never get to 20. Theoretically the minimax algorithm (which Sargon implements effectively - not quite perfectly because it doesn't consider under-promotion) can 'solve chess perfectly'. But in fact chess will never be absolutely solved unless we can somehow turn every atom in the universe into a computer co-operating on solving the problem (and not even then). This is why we can't have nice things.

During human v engine or engine v engine operation the GUI tells sargon-engine the time left for the game and I use a simple adaptive algorithm to decide when to stop iterating and present the best move discovered to date.

I have implemented a FixedDepth engine parameter which allows emulation of the original Sargon program's behaviour. If FixedDepth is set to a non-zero number then sargon-engine doesn't iterate at all when playing a game, it just goes straight to the assigned depth. This actually has some efficiency advantages, since iterating from depth 5 (say) to depth 6 was not contemplated in the original Sargon code at all, so when I do that I am in effect discarding all of the depth 5 information and starting again. That sounds terrible, but remember the exponential growth means that the depth 6 required time will far exceed the sum of depth 3,4 and 5 required time, so relatively speaking it's not wasting that much time. Iteration works well and is very pragmatic and effective in this Sargon implementation.

It might sound that extending Sargon's search depth well beyond 6 hasn't been very useful because the exponential growth makes levels beyond 8 or so inaccessible in practice. This would be true if chess stopped in the middlegame, but as more and more pieces come off the board, there are less moves to look at in each position, and Sargon can see deeper in a reasonable time. This is the real beauty of adaptive rather than fixed depth. As a simple example consider the position with White (to play) king on e4, pawn on d4, Black king on d7. A serious human player will instantaneously play Kd5 here, knowing that this is the only way to eventually force pawn promotion. Sargon, with absolutely no chess knowledge, just the ability to calculate variations in search of extra material or board control, plays Kd5 at depth 13 (or more). The PV associated with this move features the pawn queening triumphantly right at the end of the line. It takes 3 minutes and 30 seconds to make the calculation on my computer. It's hardly world shattering but it's vastly beyond the capacity of the original Z80 implementation, and shows what a faster CPU and more memory can do to an otherwise fixed chess calculation algorithm.

However there's no doubt that in general the horizon effect, as it is called, is a massive limitation on the strength of an engine that does a full width, fixed depth search with no pruning. Sargon runs well enough. It plays ugly anti-positional chess, but it does try to mobilise it's pieces and it's pretty decent at tactics and will sometimes tear you apart in a complex middlegame if you don't pay attention. But then it might not be able to finish you off. Despite being able to search deeper it still doesn't understand endgames because promoting pawns takes so many ply. And even winning with say K+Q v K is beyond its horizon unless the opponent's king is already corralled with Sargon's king nearby. I am tempted to add a simple "king in a decreasing sized box" type heuristic to the scoring function to fix that - but that's not really software archaeology is it? A similar problem, probably fixable in the same way is that Sargon will sometimes drift and concede a draw by repeating moves even in an overwhelming position. This is a reflection of Sargon's scoring function, which doesn't have any positional knowledge. Sargon just tries to win material, and if that's not possible control more squares than the opponent. This was typical of the era, in the early days of chess programming the pioneers were delighted to find that minimax plus alpha beta and a simple material plus board control scoring function was sufficient to play at least reasonable chess. But it was only a starting point for real progress.
It seems that its blindness to repetition draws makes any ratings or results it obtains rather questionable; probably it would have a significantly higher CCRL blitz rating with this one bug fixed. I imagine it was fixed with a later Sargon version, although I don't know this. I don't think of this as a question of evaluation, it is just not knowing the rules of the game.
It may not have been a mistake programming wise. It could not see the 3 fold repetition anyway with a fixed depth minimax search. Back in the day. And the GUI knows the rule. So it does not bomb out the game. I have had no issues. I don't remember what it did in that situation back in the day. I guess it would play back and forth forever, until the human stopped the game. Did it know the 50 move rule.

And I am sure not being able to promote to anything but a queen. That should not be much of a concern in most cases.

My guess is with a almost correct minimax search. This chart will hold up some what.

Code: Select all

P4	P5	P6	P7	P8	P9	Ratings	Improvement
P4		5	½	0	0	0	1235	-
P5	15		3½	3	½	0	1570	235
P6	19½	16½		4	1½	1½	1826	256
P7	20	17	16		5	4	2031	205
P8	20	19½	18½	15		5½	2208	167
P9	20	20	18½	16	14½		2328	120
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.
mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Sargon 1978 UCI Available

Post by mwyoung »

mwyoung wrote: Sat Oct 17, 2020 5:21 am
lkaufman wrote: Sat Oct 17, 2020 4:53 am
mwyoung wrote: Sat Oct 17, 2020 4:03 am
mwyoung wrote: Sat Oct 17, 2020 2:49 am
lkaufman wrote: Sat Oct 17, 2020 2:21 am
mwyoung wrote: Sat Oct 17, 2020 1:47 am
lkaufman wrote: Sat Oct 17, 2020 1:32 am
Laskos wrote: Sat Oct 17, 2020 12:59 am
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?

Maybe that helps:

http://talkchess.com/forum3/viewtopic.p ... 1&start=12
OK, as best as I can figure out from all the posts, the elo rating of Sargon 1 in 1978 was about 1400, and its estimated elo vs. humans on an i7 now is around 1700. The hardware speedup is either 50 to 1 or 6000+ to 1 depending on which post you believe; if it is 50 to 1 this all makes sense, since 1700 elo is not too far out of line with 1254 CCRL Blitz if you contract rating differences by a third or so. I get 52knps on my very fast i7 which means about 40k on a typical one, so if there is some evidence that the original hardware got around 800 nps then everything fits. The 6000 to 1 figure is hard to credit, especially since it referred to using some old hardware, not an i7, so an i7 might be 10000 to 1 which means the original Sargon got 4 nodes per second?? That seems impossibly low.
I note that the 1700 elo mentioned was based on Shredder and SF versions set to 1600, but does anyone know whether those ratings were themselves based on human games or on games with CCRL rated engines?
You can estimate the speed up. The level times 1ply meaning level 1, 2 to 2..... level 6 for 6 ply took an average of 4 hours. Sargon did not have time controls only levels. Take a few positions and see how long your Sargon takes to search 6 ply. And compare that to 4 hours.This will give you a speed ratio compared to a TRS-80 computer.
I get anywhere from 3 to 36 seconds with depth set to 6, maybe 15 seconds or so average, which would give a 960 to 1 ratio. That implies that Sargon got about 50 nodes per second on the TRS-80. Was it really that slow, or could it perhaps be nonlinear, maybe the ratio is much lower for a 4 ply search than for a six ply search for example?
Yes, I was remember numbers lower then 50 nps, 35 nps is what I keep remembering. But it has been so long ago.

Here is something a bit more formal. Data recorded with BanksiaGUI. A 2 game Sargon (2950x cpu) average time to depth to 6 ply of 5.9 seconds. This gives a speed up of 2,440.67 times faster then Sargon running on a TRS-80 II. This give a NPS on a TRS-80 II 14.58 NPS.

And you should be even faster then this. If I remember your CPU correctly.

Code: Select all

TRS-80 Model II
Manufacturer	Tandy Corporation
Type	Personal computer
Release date	October 1979; 41 years ago[3]
Introductory price	US$3,450 (equivalent to $12,153 in 2019) (32KB)
US$3,899 (equivalent to $13,735 in 2019) (64KB)
Operating system	TRSDOS, Microsoft Basic
CPU	Z-80A @ 4.00 MHz
Memory	either 32 or 64k of RAM
Storage	singled-sided Shugart 500k 8" floppy drive
Display	80x25 text
Input	detachable keyboard
Dimensions	14 x 21 1/4 x 23 1/2 inch

Code: Select all

Result:
-------------------------------------------------------------------------------
  #  name               games    wins   draws  losses   score    los%  elo+/-
  1. Sargon 1978 V1.00      2       1       0       1     1.0    50.0    -0.0
  2. Stockfish 141020       2       1       0       1     1.0    50.0    -0.0

Cross table:
-------------------------------------------------------------------------------
  #  name                  score   games         1         2
  1. Sargon 1978 V1.00       1.0       2         x        01
  2. Stockfish 141020        1.0       2        10         x

Tech:
-------------------------------------------------------------------------------

Tech (average nodes, depths, time/m per move, others per game), counted for computing moves only, ignored moves with zero nodes:
  #  name                 nodes/m         NPS  depth/m   time/m    moves     time
  1. Sargon 1978 V1.00       209K       35585      6.0      5.9     50.5    296.3
  2. Stockfish 141020         21K     1206701      6.0      0.0     50.5      0.9
     all ---                 112K       39025      6.0      2.9     50.5    148.6
I found this information. And It looks like we got pretty close to what was expected in our calculations.

"I expect this to be between two and three orders of magnitude faster than the original Z80 machine, so I don't imagine many users set the search depth to maximum!"

Code: Select all

How Well does it Work?
Potential users/tinkerers should have realistic expectations, the program dates from an era when the humblest club player could beat chess programs running on consumer grade hardware. This was the very first version of Sargon, a project that went through many more versions, becoming much stronger during the product's lifecycle. Sargon was an important product in computer chess history, and I still think the surprising decision the Spracklen's made to make the source code of their nascent commercial product available is important and worth celebrating (by bringing that code back to life).

This version of Sargon used fixed depth, full width search. In other words it did not prune its search tree, considering every single move out to a fixed depth. The depth was a user selectable option, with 6 (ply) being the maximum setting. On my (cheap, aging) commodity laptop, sargon-engine.exe might take something like 30 seconds to perform the 6 ply search in a typical middlegame position. I expect this to be between two and three orders of magnitude faster than the original Z80 machine, so I don't imagine many users set the search depth to maximum!

One improvement I have been able to make without changing any of Sargon's core code is to extend the maximum search depth from 6 to 20 (because I am not limited to a few K of memory) and to make the search depth dynamic rather than fixed. I use an iterative approach. When the GUI asks the engine to analyse a position I start with depth=3 (which is essentially instantaneous), present the results, then move to depth=4, and so on. If the GUI wants the engine to analyse indefinitely (kibitzing) I just continue iterating all the way up to depth=20. It's important to understand though that the time required increases exponentially. Seconds for depth 4, minutes by depth 7, hours by depth 9, days (10), weeks (11), years probably (13 or so). Basically it will never get to 20. Theoretically the minimax algorithm (which Sargon implements effectively - not quite perfectly because it doesn't consider under-promotion) can 'solve chess perfectly'. But in fact chess will never be absolutely solved unless we can somehow turn every atom in the universe into a computer co-operating on solving the problem (and not even then). This is why we can't have nice things.

During human v engine or engine v engine operation the GUI tells sargon-engine the time left for the game and I use a simple adaptive algorithm to decide when to stop iterating and present the best move discovered to date.

I have implemented a FixedDepth engine parameter which allows emulation of the original Sargon program's behaviour. If FixedDepth is set to a non-zero number then sargon-engine doesn't iterate at all when playing a game, it just goes straight to the assigned depth. This actually has some efficiency advantages, since iterating from depth 5 (say) to depth 6 was not contemplated in the original Sargon code at all, so when I do that I am in effect discarding all of the depth 5 information and starting again. That sounds terrible, but remember the exponential growth means that the depth 6 required time will far exceed the sum of depth 3,4 and 5 required time, so relatively speaking it's not wasting that much time. Iteration works well and is very pragmatic and effective in this Sargon implementation.

It might sound that extending Sargon's search depth well beyond 6 hasn't been very useful because the exponential growth makes levels beyond 8 or so inaccessible in practice. This would be true if chess stopped in the middlegame, but as more and more pieces come off the board, there are less moves to look at in each position, and Sargon can see deeper in a reasonable time. This is the real beauty of adaptive rather than fixed depth. As a simple example consider the position with White (to play) king on e4, pawn on d4, Black king on d7. A serious human player will instantaneously play Kd5 here, knowing that this is the only way to eventually force pawn promotion. Sargon, with absolutely no chess knowledge, just the ability to calculate variations in search of extra material or board control, plays Kd5 at depth 13 (or more). The PV associated with this move features the pawn queening triumphantly right at the end of the line. It takes 3 minutes and 30 seconds to make the calculation on my computer. It's hardly world shattering but it's vastly beyond the capacity of the original Z80 implementation, and shows what a faster CPU and more memory can do to an otherwise fixed chess calculation algorithm.

However there's no doubt that in general the horizon effect, as it is called, is a massive limitation on the strength of an engine that does a full width, fixed depth search with no pruning. Sargon runs well enough. It plays ugly anti-positional chess, but it does try to mobilise it's pieces and it's pretty decent at tactics and will sometimes tear you apart in a complex middlegame if you don't pay attention. But then it might not be able to finish you off. Despite being able to search deeper it still doesn't understand endgames because promoting pawns takes so many ply. And even winning with say K+Q v K is beyond its horizon unless the opponent's king is already corralled with Sargon's king nearby. I am tempted to add a simple "king in a decreasing sized box" type heuristic to the scoring function to fix that - but that's not really software archaeology is it? A similar problem, probably fixable in the same way is that Sargon will sometimes drift and concede a draw by repeating moves even in an overwhelming position. This is a reflection of Sargon's scoring function, which doesn't have any positional knowledge. Sargon just tries to win material, and if that's not possible control more squares than the opponent. This was typical of the era, in the early days of chess programming the pioneers were delighted to find that minimax plus alpha beta and a simple material plus board control scoring function was sufficient to play at least reasonable chess. But it was only a starting point for real progress.
It seems that its blindness to repetition draws makes any ratings or results it obtains rather questionable; probably it would have a significantly higher CCRL blitz rating with this one bug fixed. I imagine it was fixed with a later Sargon version, although I don't know this. I don't think of this as a question of evaluation, it is just not knowing the rules of the game.
It may not have been a mistake programming wise. It could not see the 3 fold repetition anyway with a fixed depth minimax search. Back in the day. And the GUI knows the rule. So it does not bomb out the game. I have had no issues. I don't remember what it did in that situation back in the day. I guess it would play back and forth forever, until the human stopped the game. Did it know the 50 move rule.

And I am sure not being able to promote to anything but a queen. That should not be much of a concern in most cases.

My guess is with a almost correct minimax search. This chart will hold up some what.

Code: Select all

P4	P5	P6	P7	P8	P9	Ratings	Improvement
P4		5	½	0	0	0	1235	-
P5	15		3½	3	½	0	1570	235
P6	19½	16½		4	1½	1½	1826	256
P7	20	17	16		5	4	2031	205
P8	20	19½	18½	15		5½	2208	167
P9	20	20	18½	16	14½		2328	120
You should be a go!. Sargon lost the 3 ply match to SF 12 by 100 Elo, but won the Sargon 4 ply vs SF 12 3 ply by 31.4 Elo. For a 1 ply gain of 131.4 Elo. In a quick and dirty test of 100 games for each match.

Code: Select all

Result:
-------------------------------------------------------------------------------
  #  name               games    wins   draws  losses   score    los%  elo+/-
  1. Stockfish 141020     100      58      12      30    64.0    99.9   100.0
  2. Sargon 1978 V1.00    100      30      12      58    36.0     0.1  -100.0

Cross table:
-------------------------------------------------------------------------------
  #  name                  score   games                                                                                                    1                                                                                                    2
  1. Stockfish 141020       64.0     100                                                                                                    x 1010001010110==1=1101010111101110101111=1=11011111=11=1=111100=101001110=0111110=10010110110101=0011
  2. Sargon 1978 V1.00      36.0     100 0101110101001==0=0010101000010001010000=0=00100000=00=0=000011=010110001=1000001=01101001001010=1100                                                                                                    x

Tech:
-------------------------------------------------------------------------------

Tech (average nodes, depths, time/m per move, others per game), counted for computing moves only, ignored moves with zero nodes:
  #  name                 nodes/m         NPS  depth/m   time/m    moves     time
  1. Stockfish 141020          0K       13110      3.0      0.0     36.0      0.6
  2. Sargon 1978 V1.00         2K       36320      3.0      0.1     35.9      2.2
     all ---                   1K       31491      3.0      0.0     36.0      1.4

Tournament finished! Elapsed: 9:16

Code: Select all

Result:
-------------------------------------------------------------------------------
  #  name               games    wins   draws  losses   score    los%  elo+/-
  1. Sargon 1978 V1.00    100      40      29      31    54.5    85.7    31.4
  2. Stockfish 141020     100      31      29      40    45.5    14.3   -31.4

Cross table:
-------------------------------------------------------------------------------
  #  name                  score   games                                                                                                    1                                                                                                    2
  1. Sargon 1978 V1.00      54.5     100                                                                                                    x 11010=11001=1=1011=11011001=1=0=010==1===11=1110=0=01=01=1110111=1=010==0==0000==0=001101=011=0=1100
  2. Stockfish 141020       45.5     100 00101=00110=0=0100=00100110=0=1=101==0===00=0001=1=10=10=0001000=0=101==1==1111==1=110010=100=1=0011                                                                                                    x

Tech:
-------------------------------------------------------------------------------

Tech (average nodes, depths, time/m per move, others per game), counted for computing moves only, ignored moves with zero nodes:
  #  name                 nodes/m         NPS  depth/m   time/m    moves     time
  1. Sargon 1978 V1.00        10K       36666      4.0      0.3     39.3     11.2
  2. Stockfish 141020          0K       14873      3.0      0.0     39.4      0.5
     all ---                   5K       35658      3.5      0.1     39.3      5.9

Tournament finished! Elapsed: 25:17
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.
Leo
Posts: 1078
Joined: Fri Sep 16, 2016 6:55 pm
Location: USA/Minnesota
Full name: Leo Anger

Re: Sargon 1978 UCI Available

Post by Leo »

Image TSR 80
Advanced Micro Devices fan.
Leo
Posts: 1078
Joined: Fri Sep 16, 2016 6:55 pm
Location: USA/Minnesota
Full name: Leo Anger

Re: Sargon 1978 UCI Available

Post by Leo »

Sargon Chess. Image
Advanced Micro Devices fan.
Bill Forster
Posts: 76
Joined: Mon Sep 21, 2015 7:47 am
Location: New Zealand

Re: Sargon 1978 UCI Available

Post by Bill Forster »

I missed this at the time;
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?
When Larry Kaufman takes an interest in your project you should definitely take note! So when I saw this around a month ago I decided to fill the gap myself by playing 3+2 Blitz and 15+5 Rapid matches against Sargon 1978 V1.0 to try to measure Sargon's "Human" Elo. It's computer Elo seems to be about 1300. I am a capable player, I even have a FIDE CM title, although I am getting old and it's some time since I was even 2000 FIDE. My current FIDE ratings are 1858 (Classical), 1924 (Rapid). No Blitz rating unfortunately. I am definitely weak at Blitz, I maintain around 1700 on chess.com and 1900 on lichess.org. So let's estimate my Blitz rating at 1700. The results of the match were;

Blitz: Sargon scored 12/16, according to FIDE's calculator that translates to 1860 (vs a 1700).
Rapid: Sargon scored 4.5/10, according to FIDE's calculator that translates to 1888 (vs a 1924).

A PGN of the match is available here https://triplehappy.com/downloads/Bill ... n 1978.pgn. I used this resource https://www.sp-cc.de/unbalanced-human-openings.htm to provide interesting starting positions.

Embarrassed by my own performance I sat on the results, thinking I would try again, treat the first match as a training match / take it more seriously / force myself to play anti-computer tactics / skip the blitz and focus on rapid etc. etc. But who has time. So I decided to swallow my pride and publish the raw results, in the hope that Larry sees this and is still interested.

I had previously stated that I didn't think Sargon 1978 could beat me if I paid attention. That was based on innumerable "games" played while I wrestled the project into life. But in those games I never put myself on the clock, and I suppose I just abandoned them if my slow burning sacrificial attacks (normal fun approach) didn't draw the horizon effect slaughter I was going for. I didn't use an opening book then either for obvious reasons, and using a book in the match definitely helped Sargon as it is poor in the opening and this way it gets something to work with in the middle game (definitely its happy place).

Sargon 1978's positional wisdom is limited to "try to castle early" and "try to control squares". In the endgame it suffers horribly from the horizon effect, since it's SOMA boost doesn't help with passed pawn advances. It also has a bad repetition issue (indeed like a scoundrel I got many draws in games I deserved to lose because of this), and would very rarely be able to convert even very advantageous endings since even the Q+K v K elementary mate is beyond it because controlling squares misses the point and its unpruned search without a transposition cache is too shallow to brute force the mate unless the K is already cornered.

Despite this, Sargon 1978 running on a modern PC is capable of beating weak humans like me, especially at blitz, simply because it doesn't offer or miss simple tactical opportunities.

Some other things that came up that I can answer authoritatively if required were;

A) TIMING
lkaufman wrote: Sat Oct 17, 2020 2:21 am
mwyoung wrote: Sat Oct 17, 2020 1:47 am
lkaufman wrote: Sat Oct 17, 2020 1:32 am
Laskos wrote: Sat Oct 17, 2020 12:59 am
lkaufman wrote: Fri Oct 16, 2020 11:35 pm Have any rated human players played games against Sargon on a modern computer to provide any data on the human rating it might earn today? If so at what time control?
Maybe that helps:

http://talkchess.com/forum3/viewtopic.p ... 1&start=12
OK, as best as I can figure out from all the posts, the elo rating of Sargon 1 in 1978 was about 1400, and its estimated elo vs. humans on an i7 now is around 1700. The hardware speedup is either 50 to 1 or 6000+ to 1 depending on which post you believe; if it is 50 to 1 this all makes sense, since 1700 elo is not too far out of line with 1254 CCRL Blitz if you contract rating differences by a third or so. I get 52knps on my very fast i7 which means about 40k on a typical one, so if there is some evidence that the original hardware got around 800 nps then everything fits. The 6000 to 1 figure is hard to credit, especially since it referred to using some old hardware, not an i7, so an i7 might be 10000 to 1 which means the original Sargon got 4 nodes per second?? That seems impossibly low.
I note that the 1700 elo mentioned was based on Shredder and SF versions set to 1600, but does anyone know whether those ratings were themselves based on human games or on games with CCRL rated engines?
You can estimate the speed up. The level times 1ply meaning level 1, 2 to 2..... level 6 for 6 ply took an average of 4 hours. Sargon did not have time controls only levels. Take a few positions and see how long your Sargon takes to search 6 ply. And compare that to 4 hours.This will give you a speed ratio compared to a TRS-80 computer.
I get anywhere from 3 to 36 seconds with depth set to 6, maybe 15 seconds or so average, which would give a 960 to 1 ratio. That implies that Sargon got about 50 nodes per second on the TRS-80. Was it really that slow, or could it perhaps be nonlinear, maybe the ratio is much lower for a 4 ply search than for a six ply search for example?
I estimated 2 or 3 orders of magnitude speedup, but measured a 6000 times speed up. This measurement was fairly robust and the details are up-thread. I am surprised you measure "only" a 1000 times speed up on your much faster computer. Although all those thread-ripper threads will make no difference, this is strictly single threaded stuff. A possible source of trouble is the way I measure Nodes (I didn't give this much attention, I just count the position evaluations). I am willing to dig deeper if necessary to answer this more authoritatively.

(Actually I just did a different type of measurement - one of my regression test suites checks 33 positions in about 50 seconds, 20 of those are at depth 5 (the rest run essentially instantaneously), so this means an average of 2.5 seconds for a depth 5 calculation compared to 40 minutes from the TRS-80 version manual kindly provided by mwyoung upthread. 40x60 = 2400, so very close to a 1000 times speedup by this alternative approach too.)

And

B) The repetition problem.
lkaufman wrote: Sat Oct 17, 2020 4:53 am It seems that its blindness to repetition draws makes any ratings or results it obtains rather questionable; probably it would have a significantly higher CCRL blitz rating with this one bug fixed. I imagine it was fixed with a later Sargon version, although I don't know this. I don't think of this as a question of evaluation, it is just not knowing the rules of the game.
It's true Sargon 1978 doesn't know anything about this rule, I think this was entirely normal at the time. Later versions of Sargon undoubtedly addressed this problem, as that became normal practice. I thought that this problem was of about the same magnitude as Sargon's inability to complete elementary K+Q (or K+R) v K mates. For my match I planned to use these holes to seek shelter and get undeserved draws if necessary. The elementary mates problem never arose, but the repetition problem did keep coming up (and I used it shamelessly). Conveniently, I can fix the repetition problem in the UCI wrapper, without altering the core Sargon code at all. I can create a new API call, basically "Calculate best move - but this list of moves (which create repetition) are off limits". Then in pseudo code;

Calculate best move
If Sargon is better and best move repeats
Calculate best move excluding repetition moves
If Sargon is still better use new best move else use the original best move

If anyone shows any interest (maybe even if nobody does :-) I shall go ahead and implement this, resulting in a new Sargon 1978 V1.01 to replace the existing Sargon 1978 V1.00.