Psion Chess as a UCI engine

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

Moderator: Ras

Michel
Posts: 2318
Joined: Mon Sep 29, 2008 1:50 am

Psion Chess as a UCI engine

Post by Michel »

Psion Chess by Richard Lang (a DOS program) was the first chess engine I encountered that played somewhat strongly. For years I wanted to turn it into a UCI engine but I never found the time to do it. But finally this morning I asked Claude to do the job, and it did! There are a number of caveats which are listed in the README but a least you can play a game against Psion Chess in any GUI that supports UCI.

The GitHub repo does _not_ contain the Psion Chess files. You can download them e.g. from here https://www.dosgamesarchive.com/download/psion-chess . They should be dropped in the data directory (there are more precise instructions in data/README.md),

The Windows build has only been tested in Wine. It is a 32bit binary.

GitHub repo

https://github.com/vdbergh/psion-chess

Releases

https://github.com/vdbergh/psion-chess/ ... s/tag/v1.0
User avatar
towforce
Posts: 13403
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK
Full name: Graham Laight

Re: Psion Chess as a UCI engine

Post by towforce »

Very interesting. I have a Psion Organiser somewhere in my attic. At the time, it was incredible to have a pocket device that ran the Lotus 123 spreadsheet. I had no idea that Richard Lang had written a chess program for it.

Edit: I was given a Psion Series 3 clam-shell device by a work colleague who decided he didn't want it. Unlike the older models with a much smaller screen, it was not called "Organiser".

What did you start from? Were you provided with the source code, and if so, what language was it in?
Human chess is partly about tactics and strategy, but mostly about memory
Michel
Posts: 2318
Joined: Mon Sep 29, 2008 1:50 am

Re: Psion Chess as a UCI engine

Post by Michel »

No source code. The unaltered DOS binary is emulated by a stripped down headless dosbox. The UCI commands are translated into key presses which are interpreted by dosbox and the reply is read from the dosbox memory array.
Michel
Posts: 2318
Joined: Mon Sep 29, 2008 1:50 am

Re: Psion Chess as a UCI engine

Post by Michel »

BTW I would appreciate it if someone could confirm that the windows binary works indeed on a real windows. I have only tested it on wine on Linux.
User avatar
Jim Ablett
Posts: 2634
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Psion Chess as a UCI engine

Post by Jim Ablett »

Michel wrote: ↑Mon Oct 19, 2026 8:16 pm BTW I would appreciate it if someone could confirm that the windows binary works indeed on a real windows. I have only tested it on wine on Linux.
Hi Michel,

Just tested. It works. There's a bug with the castling moves though. When castling the bestmove line is displayed as part of the pv line so it is not sent to the gui so no move is played.

Jim.
Michel
Posts: 2318
Joined: Mon Sep 29, 2008 1:50 am

Re: Psion Chess as a UCI engine

Post by Michel »

Thanks for testing. However I am confused. The engine is not supposed to send a PV. This is not implemented (yet?). So you must be observing something else.

Currently the engine prints a lot of non-UCI garbage. Perhaps your GUI gets confused by this?
User avatar
Jim Ablett
Posts: 2634
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Psion Chess as a UCI engine

Post by Jim Ablett »

Michel wrote: ↑Mon Oct 19, 2026 8:43 pm Thanks for testing. However I am confused. The engine is not supposed to send a PV. This is not implemented (yet?). So you must be observing something else.

Currently the engine prints a lot of non-UCI garbage. Perhaps your GUI gets confused by this?
Here is the output when Psion chess castles
(game is ponder off) >

2026-10-19 20:19:47.176-->1:position startpos moves e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5 d2e3 d8d1 a1d1 b8c6 g1f3 a8d8
2026-10-19 20:19:47.177-->1:go wtime 192823 btime 162682 winc 2000 binc 2000
2026-10-19 20:19:55.086<--1:DOSBox version SVN
2026-10-19 20:19:55.102<--1:Copyright 2002-2013 DOSBox Team, published under GNU GPL.
2026-10-19 20:19:55.119<--1:Psion Chess (1985)
2026-10-19 20:19:55.134<--1:Copyright Richard Lang.
2026-10-19 20:19:55.150<--1:Psion's data segment is 0B2E
2026-10-19 20:19:55.152<--1:Synchronized at ply 0, White to move
2026-10-19 20:19:55.166<--1:e2e4
2026-10-19 20:19:55.166<--1:rnbqkbnr
2026-10-19 20:19:55.181<--1:pppppppp
2026-10-19 20:19:55.196<--1:........
2026-10-19 20:19:55.196<--1:........
2026-10-19 20:19:55.197<--1:....P...
2026-10-19 20:19:55.199<--1:........
2026-10-19 20:19:55.200<--1:PPPP.PPP
2026-10-19 20:19:55.212<--1:RNBQKBNR
2026-10-19 20:19:55.227<--1:Ply 1, Black to move
2026-10-19 20:19:55.228<--1:e2e4 d7d6
2026-10-19 20:19:55.243<--1:rnbqkbnr
2026-10-19 20:19:55.244<--1:ppp.pppp
2026-10-19 20:19:55.246<--1:...p....
2026-10-19 20:19:55.259<--1:........
2026-10-19 20:19:55.274<--1:....P...
2026-10-19 20:19:55.290<--1:........
2026-10-19 20:19:55.306<--1:PPPP.PPP
2026-10-19 20:19:55.321<--1:RNBQKBNR
2026-10-19 20:19:55.321<--1:Ply 2, White to move
2026-10-19 20:19:55.337<--1:e2e4 d7d6 b1c3
2026-10-19 20:19:55.338<--1:rnbqkbnr
2026-10-19 20:19:55.353<--1:ppp.pppp
2026-10-19 20:19:55.369<--1:...p....
2026-10-19 20:19:55.370<--1:........
2026-10-19 20:19:55.384<--1:....P...
2026-10-19 20:19:55.400<--1:..N.....
2026-10-19 20:19:55.415<--1:PPPP.PPP
2026-10-19 20:19:55.431<--1:R.BQKBNR
2026-10-19 20:19:55.432<--1:Ply 3, Black to move
2026-10-19 20:19:55.446<--1:e2e4 d7d6 b1c3 g8f6
2026-10-19 20:19:55.462<--1:rnbqkb.r
2026-10-19 20:19:55.478<--1:ppp.pppp
2026-10-19 20:19:55.494<--1:...p.n..
2026-10-19 20:19:55.509<--1:........
2026-10-19 20:19:55.525<--1:....P...
2026-10-19 20:19:55.526<--1:..N.....
2026-10-19 20:19:55.541<--1:PPPP.PPP
2026-10-19 20:19:55.556<--1:R.BQKBNR
2026-10-19 20:19:55.572<--1:Ply 4, White to move
2026-10-19 20:19:55.587<--1:e2e4 d7d6 b1c3 g8f6 f2f4
2026-10-19 20:19:55.603<--1:rnbqkb.r
2026-10-19 20:19:55.619<--1:ppp.pppp
2026-10-19 20:19:55.621<--1:...p.n..
2026-10-19 20:19:55.634<--1:........
2026-10-19 20:19:55.649<--1:....PP..
2026-10-19 20:19:55.665<--1:..N.....
2026-10-19 20:19:55.681<--1:PPPP..PP
2026-10-19 20:19:55.696<--1:R.BQKBNR
2026-10-19 20:19:55.711<--1:Ply 5, Black to move
2026-10-19 20:19:55.712<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5
2026-10-19 20:19:55.727<--1:rnbqkb.r
2026-10-19 20:19:55.742<--1:ppp.pppp
2026-10-19 20:19:55.757<--1:.....n..
2026-10-19 20:19:55.774<--1:...p....
2026-10-19 20:19:55.790<--1:....PP..
2026-10-19 20:19:55.805<--1:..N.....
2026-10-19 20:19:55.806<--1:PPPP..PP
2026-10-19 20:19:55.821<--1:R.BQKBNR
2026-10-19 20:19:55.836<--1:Ply 6, White to move
2026-10-19 20:19:55.852<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5
2026-10-19 20:19:55.867<--1:rnbqkb.r
2026-10-19 20:19:55.867<--1:ppp.pppp
2026-10-19 20:19:55.883<--1:.....n..
2026-10-19 20:19:55.898<--1:...pP...
2026-10-19 20:19:55.900<--1:.....P..
2026-10-19 20:19:55.914<--1:..N.....
2026-10-19 20:19:55.929<--1:PPPP..PP
2026-10-19 20:19:55.945<--1:R.BQKBNR
2026-10-19 20:19:55.961<--1:Ply 7, Black to move
2026-10-19 20:19:55.978<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4
2026-10-19 20:19:55.978<--1:rnbqkb.r
2026-10-19 20:19:55.994<--1:ppp.pppp
2026-10-19 20:19:55.995<--1:.....n..
2026-10-19 20:19:56.010<--1:....P...
2026-10-19 20:19:56.025<--1:...p.P..
2026-10-19 20:19:56.041<--1:..N.....
2026-10-19 20:19:56.057<--1:PPPP..PP
2026-10-19 20:19:56.072<--1:R.BQKBNR
2026-10-19 20:19:56.088<--1:Ply 8, White to move
2026-10-19 20:19:56.089<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6
2026-10-19 20:19:56.103<--1:rnbqkb.r
2026-10-19 20:19:56.119<--1:ppp.pppp
2026-10-19 20:19:56.135<--1:.....P..
2026-10-19 20:19:56.136<--1:........
2026-10-19 20:19:56.151<--1:...p.P..
2026-10-19 20:19:56.167<--1:..N.....
2026-10-19 20:19:56.182<--1:PPPP..PP
2026-10-19 20:19:56.183<--1:R.BQKBNR
2026-10-19 20:19:56.198<--1:Ply 9, Black to move, pondering
2026-10-19 20:19:56.199<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3
2026-10-19 20:19:56.201<--1:rnbqkb.r
2026-10-19 20:19:56.202<--1:ppp.pppp
2026-10-19 20:19:56.203<--1:.....P..
2026-10-19 20:19:56.214<--1:........
2026-10-19 20:19:56.230<--1:.....P..
2026-10-19 20:19:56.246<--1:..p.....
2026-10-19 20:19:56.262<--1:PPPP..PP
2026-10-19 20:19:56.262<--1:R.BQKBNR
2026-10-19 20:19:56.263<--1:Ply 10, White to move
2026-10-19 20:19:56.278<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7
2026-10-19 20:19:56.293<--1:rnbqkb.r
2026-10-19 20:19:56.295<--1:ppp.ppPp
2026-10-19 20:19:56.309<--1:........
2026-10-19 20:19:56.310<--1:........
2026-10-19 20:19:56.324<--1:.....P..
2026-10-19 20:19:56.340<--1:..p.....
2026-10-19 20:19:56.356<--1:PPPP..PP
2026-10-19 20:19:56.357<--1:R.BQKBNR
2026-10-19 20:19:56.358<--1:Ply 11, Black to move, pondering
2026-10-19 20:19:56.371<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2
2026-10-19 20:19:56.386<--1:rnbqkb.r
2026-10-19 20:19:56.402<--1:ppp.ppPp
2026-10-19 20:19:56.403<--1:........
2026-10-19 20:19:56.418<--1:........
2026-10-19 20:19:56.434<--1:.....P..
2026-10-19 20:19:56.450<--1:........
2026-10-19 20:19:56.451<--1:PPPp..PP
2026-10-19 20:19:56.466<--1:R.BQKBNR
2026-10-19 20:19:56.482<--1:Ply 12, White to move
2026-10-19 20:19:56.498<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2
2026-10-19 20:19:56.513<--1:rnbqkb.r
2026-10-19 20:19:56.529<--1:ppp.ppPp
2026-10-19 20:19:56.544<--1:........
2026-10-19 20:19:56.545<--1:........
2026-10-19 20:19:56.559<--1:.....P..
2026-10-19 20:19:56.575<--1:........
2026-10-19 20:19:56.590<--1:PPPB..PP
2026-10-19 20:19:56.606<--1:R..QKBNR
2026-10-19 20:19:56.622<--1:Ply 13, Black to move, pondering
2026-10-19 20:19:56.638<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7
2026-10-19 20:19:56.639<--1:rnbqk..r
2026-10-19 20:19:56.654<--1:ppp.ppbp
2026-10-19 20:19:56.669<--1:........
2026-10-19 20:19:56.685<--1:........
2026-10-19 20:19:56.701<--1:.....P..
2026-10-19 20:19:56.717<--1:........
2026-10-19 20:19:56.733<--1:PPPB..PP
2026-10-19 20:19:56.734<--1:R..QKBNR
2026-10-19 20:19:56.748<--1:Ply 14, White to move
2026-10-19 20:19:56.764<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3
2026-10-19 20:19:56.780<--1:rnbqk..r
2026-10-19 20:19:56.780<--1:ppp.ppbp
2026-10-19 20:19:56.795<--1:........
2026-10-19 20:19:56.811<--1:........
2026-10-19 20:19:56.827<--1:.....P..
2026-10-19 20:19:56.828<--1:..P.....
2026-10-19 20:19:56.843<--1:PP.B..PP
2026-10-19 20:19:56.859<--1:R..QKBNR
2026-10-19 20:19:56.859<--1:Ply 15, Black to move, pondering
2026-10-19 20:19:56.874<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8
2026-10-19 20:19:56.890<--1:rnbq.rk.
2026-10-19 20:19:56.905<--1:ppp.ppbp
2026-10-19 20:19:56.921<--1:........
2026-10-19 20:19:56.922<--1:........
2026-10-19 20:19:56.936<--1:.....P..
2026-10-19 20:19:56.952<--1:..P.....
2026-10-19 20:19:56.968<--1:PP.B..PP
2026-10-19 20:19:56.968<--1:R..QKBNR
2026-10-19 20:19:56.983<--1:Ply 16, White to move
2026-10-19 20:19:56.999<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4
2026-10-19 20:19:57.015<--1:rnbq.rk.
2026-10-19 20:19:57.016<--1:ppp.ppbp
2026-10-19 20:19:57.031<--1:........
2026-10-19 20:19:57.047<--1:........
2026-10-19 20:19:57.062<--1:..B..P..
2026-10-19 20:19:57.078<--1:..P.....
2026-10-19 20:19:57.093<--1:PP.B..PP
2026-10-19 20:19:57.109<--1:R..QK.NR
2026-10-19 20:19:57.110<--1:Ply 17, Black to move, pondering
2026-10-19 20:19:57.125<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5
2026-10-19 20:19:57.140<--1:rn.q.rk.
2026-10-19 20:19:57.157<--1:ppp.ppbp
2026-10-19 20:19:57.172<--1:........
2026-10-19 20:19:57.187<--1:.....b..
2026-10-19 20:19:57.203<--1:..B..P..
2026-10-19 20:19:57.205<--1:..P.....
2026-10-19 20:19:57.206<--1:PP.B..PP
2026-10-19 20:19:57.219<--1:R..QK.NR
2026-10-19 20:19:57.234<--1:Ply 18, White to move
2026-10-19 20:19:57.235<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5 d2e3
2026-10-19 20:19:57.236<--1:rn.q.rk.
2026-10-19 20:19:57.238<--1:ppp.ppbp
2026-10-19 20:19:57.239<--1:........
2026-10-19 20:19:57.240<--1:.....b..
2026-10-19 20:19:57.250<--1:..B..P..
2026-10-19 20:19:57.265<--1:..P.B...
2026-10-19 20:19:57.281<--1:PP....PP
2026-10-19 20:19:57.296<--1:R..QK.NR
2026-10-19 20:19:57.297<--1:Ply 19, Black to move, pondering
2026-10-19 20:19:57.311<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5 d2e3 d8d1
2026-10-19 20:19:57.312<--1:rn...rk.
2026-10-19 20:19:57.327<--1:ppp.ppbp
2026-10-19 20:19:57.328<--1:........
2026-10-19 20:19:57.343<--1:.....b..
2026-10-19 20:19:57.359<--1:..B..P..
2026-10-19 20:19:57.360<--1:..P.B...
2026-10-19 20:19:57.374<--1:PP....PP
2026-10-19 20:19:57.389<--1:R..qK.NR
2026-10-19 20:19:57.390<--1:Ply 20, White to move
2026-10-19 20:19:57.405<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5 d2e3 d8d1 a1d1
2026-10-19 20:19:57.421<--1:rn...rk.
2026-10-19 20:19:57.436<--1:ppp.ppbp
2026-10-19 20:19:57.437<--1:........
2026-10-19 20:19:57.453<--1:.....b..
2026-10-19 20:19:57.469<--1:..B..P..
2026-10-19 20:19:57.484<--1:..P.B...
2026-10-19 20:19:57.486<--1:PP....PP
2026-10-19 20:19:57.500<--1:...RK.NR
2026-10-19 20:19:57.515<--1:Ply 21, Black to move, pondering
2026-10-19 20:19:57.530<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5 d2e3 d8d1 a1d1 b8c6
2026-10-19 20:19:57.546<--1:r....rk.
2026-10-19 20:19:57.562<--1:ppp.ppbp
2026-10-19 20:19:57.563<--1:..n.....
2026-10-19 20:19:57.578<--1:.....b..
2026-10-19 20:19:57.579<--1:..B..P..
2026-10-19 20:19:57.594<--1:..P.B...
2026-10-19 20:19:57.610<--1:PP....PP
2026-10-19 20:19:57.625<--1:...RK.NR
2026-10-19 20:19:57.641<--1:Ply 22, White to move
2026-10-19 20:19:57.657<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5 d2e3 d8d1 a1d1 b8c6 g1f3
2026-10-19 20:19:57.673<--1:r....rk.
2026-10-19 20:19:57.673<--1:ppp.ppbp
2026-10-19 20:19:57.674<--1:..n.....
2026-10-19 20:19:57.688<--1:.....b..
2026-10-19 20:19:57.703<--1:..B..P..
2026-10-19 20:19:57.719<--1:..P.BN..
2026-10-19 20:19:57.734<--1:PP....PP
2026-10-19 20:19:57.750<--1:...RK..R
2026-10-19 20:19:57.766<--1:Ply 23, Black to move, pondering
2026-10-19 20:19:57.767<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5 d2e3 d8d1 a1d1 b8c6 g1f3 a8d8
2026-10-19 20:19:57.781<--1:...r.rk.
2026-10-19 20:19:57.796<--1:ppp.ppbp
2026-10-19 20:19:57.812<--1:..n.....
2026-10-19 20:19:57.827<--1:.....b..
2026-10-19 20:19:57.860<--1:...RK..R
2026-10-19 20:19:57.874<--1:Ply 24, White to move
2026-10-19 20:19:57.890<--1:e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 fbestmove e1g1

Jim.
Michel
Posts: 2318
Joined: Mon Sep 29, 2008 1:50 am

Re: Psion Chess as a UCI engine

Post by Michel »

Thanks!

Which GUI produces this log?

The log seems to be the non-UCI communication from the engine to the GUI. I.e. almost all bestmove replies are missing (currently the engine does not send info lines, only a bestmove).

In the last line there is a bestmove reply but it is mixed with some non-UCI output (the engine repeating the move sequence leading to the current board).

This suggests multiple threads are writing to stdout. Or perhaps the engine writes both to stdout and stderr and the GUI mixes those streams.

I will ask Claude to look into it.
Michel
Posts: 2318
Joined: Mon Sep 29, 2008 1:50 am

Re: Psion Chess as a UCI engine

Post by Michel »

Hmm. No this is the full communication. The engine really produces all this garbage as a reply to the initial

2026-10-19 20:19:47.176-->1:position startpos moves e2e4 d7d6 b1c3 g8f6 f2f4 d6d5 e4e5 d5d4 e5f6 d4c3 f6g7 c3d2 c1d2 f8g7 c2c3 e8g8 f1c4 c8f5 d2e3 d8d1 a1d1 b8c6 g1f3 a8d8
2026-10-19 20:19:47.177-->1:go wtime 192823 btime 162682 winc 2000 binc 2000

(only the initial "uci" command appears to be missing).
Michel
Posts: 2318
Joined: Mon Sep 29, 2008 1:50 am

Re: Psion Chess as a UCI engine

Post by Michel »

Hi Jim,

Claude claims to have fixed the issues... Can you try the binary again?

https://github.com/vdbergh/psion-chess/ ... s/tag/v1.1

Thanks!