Skip to content
EgonMadsen edited this page Aug 12, 2024 · 45 revisions

Welcome to the PL-SQL-Chess wiki.


Here You can read about and download the (to my knowledge) first and only Chess Engine coded in the ORACLE pl/sql language. It's a full-blown Chess Engine, playing real chess with support of the major chess data formats.

NOTE: the complete v1.01 source is placed under Release 1.01

TECHNICAL (Oracle PL/SQL)

PL/SQL is a really good and fast language when used with ORACLE SQL as it is made for. For a Chess Engine, PL/SQL is a quite restricted and slow language though, not the perfect choice as we need 64 bit integer and bit-operations. If You want top strength, don't use PL-PIG-Chess, but go for Stockfish, one of the strongest Chess Engines.

Fair Performance is reached by intensive use of VARRAYS, SIMPLE_INTEGER and INLINE'able SET operators. And by NOT using SQL features. By using Compile Native and Optimizer level even more speed is reachable. But still more than 50 times slower than more traditional compiled languages like Modula2 or C.

My wishes to PL/SQL would be more datatypes: 1 bit integer (SIMPLE_BOOLEAN), 8 bit integer (SIMPLE_BYTE) , 64 bit integer datatype (SIMPLE_LONGINT) and static arrays of SIMPLE datatypes (including RAW). A real CAST.

TECHNICAL (Chess)

  • Opening books (Polyglot format supported)
  • Static evaluation (inaccurate, but fast method, using diverse nudging techniques)
  • quiescence deepening minimax algorithm with alpha/beta cut-off and sort for better pruning
  • Q-search (deeper selective search on killer-moves like check, pinnings, null-moves, hash-tables)
  • Leaf evaluation (with static deepening, inaccurate, but fast method)
  • Single CPU only
  • Supports 8 levels (from less than a second to several minutes pr move).
  • Rating: up to 1600 (on a good day...) NEW: Release 1.01 rating is probably up to 2000, even on a gray day.
  • PGN, FEN and EPD is supported (standard formats for positions).
  • primitive text-based interface included for playing and executing different test-suites, like: bkTest, ColditzTest, ReinfeldTest, IQ6Test, SSM45 and many other test-suites.
  • Full working web GUI included. including two piecesets. NEW: Release 1.01 has sounds and a chess-clock.
  • Fisherandom (from v0.97).
  • Obstacle-chess (introduces the 'Obstacle' piece. A complete unknown chess-variant.

Required:

  • Knowledge about Oracle databases (would be nice if you are Oracle DBA or developer)
  • Access to a Oracle database (did You know, you can get one for free!)
  • Access to create pls/sql packages and tables on the database
  • The GUI needs a web-server using mod_plsql or ORDS with PL/SQL gateway and ACL.

Recommended:

  • Packages ENGINE + ENGINE_EVAL should be compiled native as the code is optimized for that.

HISTORY

Migrated from the Engine of PIGbase4 v2.8, I coded with M2Amiga Modula-2 v4.2 (in the mid 90ties). November 2019/ April 2020 / Mar 2021 (released jul 2021) /august 2024: improved versions 0.95/0.97/1.0/1.01, with a GUI:

August 2024: improved version 1.01 :

  • rating improved (+200 ELO vs v1.0)

July 2021: improved version 1.0 :

  • 20% faster than v0.97 due to handtuned bottelenecks and more caching.
  • rating improved (+150 ELO vs v0.97) as a result of a new ramp-pruning technique combined with more complex ordering techniques. Especially on higher levels it gives a huge improvement. You find this new version 1.0 under 'Releases' in GitHub.

April 2020: improved version 0.97 :

  • 30% faster than v0.95
  • stronger (+70 ELO)
  • Fisherandom
  • Rare unstability is fixed
  • Improvements to the support of PGN, FEN and EPD formats. You find version 0.97 under 'Releases' in GitHub.

November 2019: improved version 0.95 :, now with a GUI:

  • a bit stronger
  • speed is doubled
  • support of pgn format.
  • tree-time repetition detect.
  • transposition table
  • support of polyglot format (opening books).
  • enhanced (automated) self-test and debugging framework.
  • Two different sets of graphics (including piecesets), released for free use in any way.
  • New web GUI based on PL/SQL using HTML, JAVASCRIPT and CANVAS. You find version 0.95 under 'Releases' in GitHub.

Testbench (v1.0)

tests

image

References (new versions)

Future

I now have made a working PL/SQL Chess Engine and a PL/SQL based web-GUI. That was my ambition, so v0.95 was expected to be the final version. The Corona situation gave some spare time though, so v0.97, v1.0 and v1.01 is here.