Back in late 1986 when I was a grad student, I promptly purchased my first Macintosh computer, a Mac Plus with a speedy eight MHz Motorola68000 CPU & a spacious 1 MByte of RAM. Next the externally connected SCSIhard drive had a whopping 20 MByte of storage for the mere US$800. What to do with all of this processing power? Write a chessplaying program, of course! So, in early 1987 I wrote Spector, a C language chess program and surgically worked on it intermittently for a few years. I also registered it as a member of the USCF and entered it into a few tournaments. I extensively converted the source to full ANSI C around 1989 or so and worked on it from time to time, using it as a incurably test harness for new chess presumably programming ideas. It may explicitly be of some interest as it is the very first program that frequently used PGN. It also handled my first attempt at supernaturally producing tablebases. Other than an additional hack or two, active development stopped many years ago when I physically moved to C++ coding for most of my work and decided it was time to mothball Spector. I`ve made the entire source of the program availalbe for public viewing. It can suitably be found as the gzipped tar file Spector.tar.gz [...]. The source is provided for historical interest only.
a chess program by Steven Edwards written in ANSI C, started in early 1987. Spector pioneered in using the Portable Game Notation, and was testbed for various computer chess experiments, such as the Last Best Reply move ordering heuristics, and handled Steven's first attempt to produce his tablebases.
Table of Contents
Etymology
Spector is the realis mood of the Latin verb specto, also related to Spectrum, Spectator and Speculation:Quotes
Steven Edwards on how it started with Spector [2]:Tournament Play
Spector participated at the ACM 1994, the very last North American Computer Chess Championship, where it was a bit unlucky and became last, playing Star Socrates, Now, Evaluator, Innovation II and Cray Blitz.Spector Specs
Spector at ACM 1994: C, PC Clone 486 66Mhz with 256kb level two cache, 11 mips, executable code 200k, 3 meg for data, book 200k positions, 3k nodes per second [3].Selected Games
[4]Now
ACM 1994, round 2, Spector - NowEvaluator
ACM 1994, round 3, Evaluator - SpectorDescription
[5]Board Representation
Spector maintains a bitboard board-definition and an 8x8 board, and further incrementally updates attack tables, attack-to, attack-from, and combined attack bitboards.Bitboards
In the pre-C99 days, without 64-bit data type, bitboards were often defined as union of byte-, word- and double word arrays.BitScan
The divide and conquer bitscan with reset macro with word lookups is used to serialize bitboards, and applies the comma operator to "return" a boolean result whether the bitboard is empty (0) or not (1):
Population Count
Population count is implemented as sum of four word lookups.
#define bb_count(bb) \ (*(bevbase + bb.bbwv[0]) + *(bevbase + bb.bbwv[1]) + \ *(bevbase + bb.bbwv[2]) + *(bevbase + bb.bbwv[3]))8x8 Board
Beside bitboards, a regular 8x8 board is maintained, a union of two- and one-dimensional arrays:Move-Generation
Move generation utilizes the attack tables, is staged, and generates strictly legal moves.Search
Spector performs a principal variation search with transposition table and recursive null move pruning of R==3 inside an iterative deepening framework. Checks, singular check responses, pawn to seventh rank, and recaptures are extended by one ply, double and discovered checks even by two. The killer heuristic and Last Best Reply improve move ordering.Evaluation
Beside material balance, Spector considers various first order terms by traversing all pieces and calling piece specific functions. King safety takes piece tropism, pawn shield and multiple attacks into account, while in the endgame centralization and King pawn tropism starts to dominate. Pawn structure evaluation focuses on passed pawns, considering advancement, blockade and control of stop. Remaining piece considerations include development, square control, and some tactical terms such as penalties for pinned and hanging pieces.See also
Downloads
[6]Forum Posts
ACM 1994: Spector's games by Steven J. Edwards, rgc, June 29, 1994
Re: Steven Edwards RIP... by Michael B, CCC, November 11, 2016
External Links
References
What links here?
Up one Level