ANS Forth Chess
Page updated 09/18/02

Ian Osgood's ANS Forth Chess program was released 10/4/01 in a form that runs under Tom Zimmer's win32Forth, as TSCP after the C version. It and has been improved several times since then. The latest version 0.A was uploaded 09/14/02 It is available for ftp download at this site as the source file TSCP.F and in zip compressed source form as TSCP.ZIP. However Ian's program has diverged enough from the original TSCP to warrant a new name. FCP.F and FCP.ZIP were posted 9/19/02 and has a null-move heuristic and enhanced check extension.

F21chess 1997 - 2000

I have been interested in implementing a computer chess program for F21 for a long time. Chess is an example of a problem in logic that does not require floating point math, is naturally parallel, and is understood by the public. It is interesting that 1997 is the year that a machine called Deeper Blue defeated the current world's chess champion. It is also interesting that Deeper Blue uses a simple brute force approach to the problem and simply leverages off of its high speed and wide parallelism.

I asked in the internet newsgroup comp.lang.forth if there were any Chess programs in Forth. I heard about Schaakprogramma V1.0 in Dutch for F-PC by Lennart Benschop and got a copy from the author. The comments in Dutch were not useful to me so I had the comments translated to English and began porting the program from F-PC which is a 16 bit byte addressing Forth environment to ANS cell based Forth requiring at least 16 bit cells. I then compiled the ANS version for the F21 and added two windows for the chessboard and list of moves, and added a graphic display of the chessboard.

The source code to the version in Dutch for FPC, and an English language version in ANS Forth are all available in the CHESS.ZIP file at this site.

This is copy of the display from the Windows Simulator for F21. Tt looks very much like the display on a TV monitor by F21Chess running on F21 in low res color video mode.

chess game image with two windows

The program is very simple and does not play a strong game of Chess. It has no library of opening or closing games, it does make a simple strategy switch for end game, but uses a simple brute force search approach. It uses a very simple method for evaluating the value of the board after a move. It is interesting to see just how many moves it must search to play such a poor game.

The present version is high level threaded Forth with stacks in memory on F21 and a few words converted to CODE. Because it was used to test prototype chips with known bugs it is not the optimal code for a fully functional machine.

A version in Machine Forth should be at least ten times faster. If run in SRAM on F21 instead of DRAM on a node that is not generating video it would run ten times faster again than on the present DRAM only board. So even this very weak chess program could easily be made 100 times as powerful on F21. A program with a better strategy might easily play a 10 times more powerful game. And of course if we run on 1000 nodes searching in parallel we get another 1000x. That would be 1000000x more powerful that what I have run on the old F21Chess demos on the old board and that has beaten me before at chess.

Then we have the new 2001 chip implemenations. We could redo F21 in a .18u design like Chuck's present x18 and 25x designs. F21 and x18 and 25x use the same instruction set and mostly only differ by 3 bits in width.

Since F21 loads 20 bits rather than 18 on a memory fetch it can load four rather than three five bit instructions in each 1ns memory fetch in .18u. This would give a .18u F21 today a maximum throughput of about 2700 MIPS with some on-chip RAM and ROM like x18. That gives another 10x over the old .8u stuff with external memory that we were doing a few years ago.

With today's (10/4/01) state of the art fab we could move from the .18u that Mosis currently offers and that Chuck has been designing for to .13u or .10u or .07u. were we could get another 3x or 4x speedup or 10800 MIPS per CPU.

There has been some interest in chips larger than Chuck's $1 and 60,000 MIP 25x design. We could do an F2100 with an 100x100 or maybe a 1000x1000 array of 10800 Forth MIP processors on each cluster chip and build a processor with a bunch of clusters. With 100 clusters that would be 1080000000000000000 Forth instructions per second.

That would enough power for a pretty mean game of chess, but the machine could handle not only chess but many other programs that could benefit from the massive parallelism of tiny high level language processors. For a number of classes of AI, and engineering problems these 100,000 MIP/$ highly tuned machines could make a lot of things possible that just are not practical today.

I have been running the old F21Chess ROM on different boards since 1997. In 1999 I ran a version of F21Chess on the first small F21 test board using a low res B/W video display mode.
image of the first f21d board

The CHESS.ZIP file contains

CHESS    F          24,724  01-08-00  4:05a chess.f     \ ANS Forth Chess
CHESS    REF         4,715  12-18-99  7:20a chess.ref   \ some internal docs
CHESS    SEQ        23,015  01-06-00 10:36p chess.seq   \ FPC Chess (Dutch)
CHESS    HTM         4,102  01-11-00  7:40p chess.htm   \ this file
I21CH16  GIF        20,247  08-11-97 10:02a I21CH16.GIF \ graphic from simulator
I21CZ16  GIF         6,995  08-11-97  9:58a I21CZ16.GIF \ graphic from simulator
F21DTEST JPG        14,269  05-27-99 11:51p f21dtest.jpg \ jpeg graphic
CHSBW    JPG        14,266  01-02-00  3:10p chsbw.jpg    \ jpeg graphic
F21BRD2  JPG        19,007  01-02-00  3:08p F21BRD2.JPG  \ jpeg graphic
CHESSBRD ZIP        12,941  12-18-99  3:46p CHESSBRD.ZIP \ clipboard from simulator

UltraTechnology Homepage

2512 10th Street Berkeley, CA 94710