PDP-11 Chess VI (Belle) By Ken Thompson (1973) ported

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

Moderator: Ras

User avatar
Jim Ablett
Posts: 2482
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: PDP-11 Chess VI (Belle) By Ken Thompson (1973) ported

Post by Jim Ablett »

Update:
Move encoding indices were sometimes getting reversed causing illegal moves.
Fixed buffer overrun causing heap corruption.
In console mode, board display not being updated between moves.
Fixed console mode play.
Fixed opening book bugs.
Proton link:
https://drive.proton.me/urls/SYXDFSN22W#s412WevZRDVY

Smash link:
https://fromsmash.com/PDP11Chess664JA

Jim.
User avatar
Tibono
Posts: 175
Joined: Sat Aug 01, 2015 6:16 pm
Location: France
Full name: Eric Bonneau

Re: PDP-11 Chess VI (Belle) By Ken Thompson (1973) ported

Post by Tibono »

Thank you, Jim. Much appreciated. :D
Eric
gepasi
Posts: 3
Joined: Sat Jan 17, 2026 6:03 am
Full name: Pedro Mendes

Re: PDP-11 Chess VI (Belle) By Ken Thompson (1973) ported

Post by gepasi »

Any chance to fix the promotion bug too?
when it promotes a pawn it sends "e2e1" on the xboard protocol instead of "e2e1q" and GUIs catch this as illegal move
Scientist, programmer, and general computer geek.
User avatar
Jim Ablett
Posts: 2482
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: PDP-11 Chess VI (Belle) By Ken Thompson (1973) ported

Post by Jim Ablett »

gepasi wrote: Sat May 16, 2026 4:17 am Any chance to fix the promotion bug too?
when it promotes a pawn it sends "e2e1" on the xboard protocol instead of "e2e1q" and GUIs catch this as illegal move
Hi Pedro,

Thanks for the bug report. Fixed now.

Code: Select all

/* ------------------------------------------------------------------ */
/* winboard_send_move — NOW HANDLES PROMOTIONS CORRECTLY             */
/* ------------------------------------------------------------------ */
void winboard_send_move(int move) {
    int from = (move >> 8) & 0xFF;
    int to   =  move       & 0xFF;
    int piece = board[from];

    last_engine_move = move;
    engine_has_moved = 1;

    /* Standard move */
    printf("move %c%c%c%c",
           'a' + (from % 8), '1' + (7 - from / 8),
           'a' + (to   % 8), '1' + (7 - to   / 8));

    /* Append promotion letter if it's a pawn promotion */
    if (piece == -1 && to < 8) {           /* White pawn promotes */
        printf("q");
    }
    else if (piece == 1 && to > 55) {      /* Black pawn promotes */
        printf("q");
    }

    printf("\n");
    fflush(stdout);
}

Update:
Proton link:
https://drive.proton.me/urls/SYXDFSN22W#s412WevZRDVY

Smash link:
https://fromsmash.com/PDP6ChessJA

Jim.
gepasi
Posts: 3
Joined: Sat Jan 17, 2026 6:03 am
Full name: Pedro Mendes

Re: PDP-11 Chess VI (Belle) By Ken Thompson (1973) ported

Post by gepasi »

Many thanks, Jim!

I just noticed what may be another bug (but I'm not sure). I found this with CuteChess but can reproduce it on the command line too (using -xboard option). When the engine is set to play white, in "force" mode, after receiving several usermove's (book moves sent by the GUI) and then it is told "go" when it is white's turn it does not go, because it believes it is playing black. If I send the command "white" before "go" then it works fine and makes a move.

Reading the Winboard protocol it seems that if it is in "force" mode, then it should take whatever side's turn it is when it is given "go" (ie if it is white's turn it should do the same as if it had received "white" followed by "go").

In this example it never moves after getting the "go" command:

Code: Select all

new 
force
level 0 2 0 
post
easy
usermove e2e4
usermove e7e5
go
but if the input is this below then it does move (though this is not what CuteChess sends, as it seems the spec says that when go is received the engine should take that color's turn):

Code: Select all

new 
force
level 0 2 0 
post
easy
usermove e2e4
usermove e7e5
white
go
stat 0 0 0 0
1 -3 0 115 b1c3
2 77 0 2451 b1c3 b8c6 g1f3
3 -3 2 20112 b1c3 b8c6 g1f3
4 47 7 56416 g1f3 b8c6 f1d3 g8f6
5 5 41 248348 g1f3 g8f6 f1d3 f8d6 e1g1
move g1f3
If it is selected to play black, then there is no problem (as it assumes it is playing back from the start and therefore does not need the "black" command).

The funny thing is that if there is no book moves sent by the GUI, then it seems to understand that it is it's turn playing white:

Code: Select all

new
force
level 0 2 0
post
easy
time 12000
otim 12000
go
stat 0 0 0 0
1 -3 0 78 b1c3
2 77 0 1428 b1c3 b8c6 g1f3
3 -3 1 7041 b1c3 b8c6 g1f3
4 -3 2 23802 g1h3 b8c6 b1c3 g8f6
5 -3 11 89908 b1c3 g8f6 g1f3 b8c6 a2a3
6 32 86 743088 g1f3 g8f6 e2e3 e7e5 f1e2 b8c6
7 5 276 2016242 g1f3 g8f6 e2e3 e7e6 f1d3 f8d6 e1g1
move g1f3
In both cases it is in "force" mode but if no "usermove" were sent then it knows to play as white when it gets the "go" . So if the GUI does not use a book everything seems to work well, but when it uses one then it fails to play as white...

I'm trying to have it play in my engine tournaments to get a feeling for its strength and currently can only do so by not using a book

Thanks!
Scientist, programmer, and general computer geek.
User avatar
Jim Ablett
Posts: 2482
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: PDP-11 Chess VI (Belle) By Ken Thompson (1973) ported

Post by Jim Ablett »

gepasi wrote: Sat May 16, 2026 4:37 pm Many thanks, Jim!

I just noticed what may be another bug (but I'm not sure). I found this with CuteChess but can reproduce it on the command line too (using -xboard option). When the engine is set to play white, in "force" mode, after receiving several usermove's (book moves sent by the GUI) and then it is told "go" when it is white's turn it does not go, because it believes it is playing black. If I send the command "white" before "go" then it works fine and makes a move.

Reading the Winboard protocol it seems that if it is in "force" mode, then it should take whatever side's turn it is when it is given "go" (ie if it is white's turn it should do the same as if it had received "white" followed by "go").

In this example it never moves after getting the "go" command:

Code: Select all

new 
force
level 0 2 0 
post
easy
usermove e2e4
usermove e7e5
go
but if the input is this below then it does move (though this is not what CuteChess sends, as it seems the spec says that when go is received the engine should take that color's turn):

Code: Select all

new 
force
level 0 2 0 
post
easy
usermove e2e4
usermove e7e5
white
go
stat 0 0 0 0
1 -3 0 115 b1c3
2 77 0 2451 b1c3 b8c6 g1f3
3 -3 2 20112 b1c3 b8c6 g1f3
4 47 7 56416 g1f3 b8c6 f1d3 g8f6
5 5 41 248348 g1f3 g8f6 f1d3 f8d6 e1g1
move g1f3
If it is selected to play black, then there is no problem (as it assumes it is playing back from the start and therefore does not need the "black" command).

The funny thing is that if there is no book moves sent by the GUI, then it seems to understand that it is it's turn playing white:

Code: Select all

new
force
level 0 2 0
post
easy
time 12000
otim 12000
go
stat 0 0 0 0
1 -3 0 78 b1c3
2 77 0 1428 b1c3 b8c6 g1f3
3 -3 1 7041 b1c3 b8c6 g1f3
4 -3 2 23802 g1h3 b8c6 b1c3 g8f6
5 -3 11 89908 b1c3 g8f6 g1f3 b8c6 a2a3
6 32 86 743088 g1f3 g8f6 e2e3 e7e5 f1e2 b8c6
7 5 276 2016242 g1f3 g8f6 e2e3 e7e6 f1d3 f8d6 e1g1
move g1f3
In both cases it is in "force" mode but if no "usermove" were sent then it knows to play as white when it gets the "go" . So if the GUI does not use a book everything seems to work well, but when it uses one then it fails to play as white...

I'm trying to have it play in my engine tournaments to get a feeling for its strength and currently can only do so by not using a book

Thanks!
Engine works correctly in Winboard & Arena.

Code: Select all

1:level 0 2 2
1:new
1:random
1:level 0 2 2
1:post
1:hard
1:easy
1:ping 9
1:pong 9
1:computer
1:force
1:usermove d2d4
1:usermove g8f6
1:usermove c1g5
1:usermove e7e6
1:ping 11
1:pong 11
1:usermove b1d2
1:usermove h7h6
1:usermove g5h4
1:usermove b7b6
1:ping 12
1:pong 12
1:pong 14
1:ping 17
1:pong 17
1:time 12800
1:otim 12800
1:white
1:go
1:stat 0 0 0 0
1:1 17 0 237 h4f6
1:2 97 2 2515 h4f6 d8f6 g1f3
1:3 25 15 19502 h4f6 g7f6 g1f3
1:4 65 46 77292 h4f6 g7f6 g1f3 b8c6
Jim.