CLASH, a new chess program for the PDP-8

John Comeau’s CHEKMO-II has been the chess program for the PDP-8 since he gave it to the DECUS library in 1974: a complete game of chess in 4K words, on a machine with no multiply and no stack.

I’ve written a second chess program for the same machine, CLASH, as an experiment: would fifty years of chess programming knowledge, learned on far faster computers, translate back to the PDP-8 at its own speed?

CLASH is PDP-8 assembly, 16K words, and loads standalone from the BIN loader. It uses iterative deepening, alpha-beta with principal variation search, quiescence search, null-move pruning, pondering and repetition awareness. Its console follows CHEKMO-II’s two-letter commands (PW, BD, MV and the rest), as a nod to the program that came first.

Three ways to try it:

  • On lichess, with nothing to download: challenge PDP8-CLASH, or PDP8-CHEKMO for Comeau’s program. Both accept games at 5 minutes and slower, and both run as their real binaries under SIMH throttled to PDP-8/e speed.
  • On a PiDP-8/I or under SIMH: CLASH.BN and CLASH.ini are on the GitHub release. CLASH needs 16K (fields 0-3), doesn’t use the EAE, and starts at 200; the .ini has the rest.
  • On Windows: the release also has a zip with both programs. Double-click either one for its Teletype console, or load it into Arena or Cute Chess as a UCI engine.

Everything is here, with a README about both programs:

I’d be very interested to hear from anyone who runs it on a PiDP-8/I or real iron.

Chris Peters

3 Likes

Very impressive - thanks for sharing. Very much shows what algorithmic advances can do, isolated from hardware advances.

1 Like

The BN file seems not to have a common format. I’ve quickly tested it on an online emulator. I think same for the pal file. so needs a conversion or special PAL assembler.
BINLDR : [26970] Incorrect checksum, calculated 3170 received 3211. Maybe just the header missing. Maybe it will run. I’m too busy for a closer check.

Hi Tom, thanks for giving it a try!

The .BN is standard DEC BIN format. The unusual part is that CLASH is bigger than 4K and spans fields 0–3, so the tape has field-change frames in it. Plenty of loaders never see those, which is probably where things went wrong.

Your emulator’s numbers actually tell the story. The checksum it received, 3211, is the correct DEC sum for the file. The 3170 it calculated is exactly that sum minus one word: the last data word before the first field change (0021 at 0/7556). That looks like a loader that loses the word it’s holding back when a field-change frame comes along. It’s an easy one to get wrong, because the last word on the tape is the checksum and has to be treated differently.

Unfortunately that also means “maybe it will run” probably won’t work. That word is the last entry of a table CLASH uses, so if it’s missing from memory the program would load and then misbehave later in hard-to-predict ways. The same file loads cleanly with the DEC BIN loader on a real 8/E (AC=0000 at the end), OS/8 ABSLDR, SIMH, and Bernhard Baehr’s Mac simulator.

So it needs an emulator with at least 16K and a BIN loader that handles field changes. If you remember which online emulator it was, let me know. It might be worth a note to its author.

The .pal is PAL-8 syntax and I build it with palbart. I haven’t tried it with OS/8 PAL8 itself, so the .BN is the file to use.

Thanks again,

Chris.

Compiling the source from Release Chess Programs for the PDP-8 · dream-build-create/pdp8-chess using palbart (pal-2.14, 07 Mar 2023) produced a CLASH.bin identical to CLASH.bn in the Release folder.

Running it with pdp8 from Open SIMH gave me:

$ ~/Documents/src/simh/BIN/pdp8 ./CLASH.ini 

PDP-8 simulator Open SIMH V4.1-0 Current        git commit id: 87eb7d5e
CLASH - A New Chess Program for the PDP-8
Version 1.02

8  rb nb bb qb kb bb nb rb 
7  pb pb pb pb pb pb pb pb 
6  .. -- .. -- .. -- .. -- 
5  -- .. -- .. -- .. -- .. 
4  .. -- .. -- .. -- .. -- 
3  -- .. -- .. -- .. -- .. 
2  PW PW PW PW PW PW PW PW 
1  RW NW BW QW KW BW NW RW 

   a  b  c  d  e  f  g  h

W> 

As the World’s Worst Chess Player™, this is about as far as I’d want to go. But it does work!

1 Like

You have to try PW (play white), then PB (play black), then it will autoplay until you hit a key!