Improving Carballo Chess Engine the hard way  

torneo_ajedrezOne year ago my Carballo Chess Engine ( was stuck: all the improvements that I was trying were not working, and I detected the main problem: I am a poor chess player so I will never be a good chess engine developer. I thought that the main chess programming skill was statistical analysis and not chess knowledge, but I was wrong.

So, I took the decision of starting to learn and play chess. I joined the local chess club Xadrez Ramiro Sabell ( and I was so lucky that in this club teaches chess the International Master Yudania Hernández Estevez. It’s quite curious the amazing people that you can find in a small city like Ponteareas. I also try to help the club in the tournaments organization and with a small Mobialia sponsorship. Now I am playing the Galician Chess League (in third division) and all the tournaments that I can.

My chess level is improving fast (ok, I’m under 1600 ELO yet:, but the real deal is that the Carballo Chess Engine strength is improving much faster, climbing positions in the CCRL list ( Learning chess helps me to diagnose the flaws and to understand better what’s going on under the hood.

Finally,  playing chess also helps me to detect the chess player needs, so I realized the main missing feature from Mobialia Chess: a chess database to review historic games and to analyze your own games searching statistics for each position. This year I worked to implement this feature and starting today you can access a Beta version of the database in Mobialia Chess Web (

Chess for Blusens WebTV 2

I released a chess app for the Blusens Web:TV device. This chess app is based on my chess engine Carballo and on the GWT interface by Lukas Laag ( I changed some parts of the Lukas interface to make it work on this device:

  • Control by keyboard
  • Adapted for remote keys
  • Many speed optimizations on the chess engine loading
  • Removed FEN and movable panels (no mouse on the app)

The app is controlled with the remote keys (UP, DOWN, LEFT, RIGHT and OK). With the MODE key you can change the mode (white vs computer, black vs computer…) and with the BLUE circle the thinking time. FORWARD and BACKWARD keys undo/redo moves and with STOP you can start a new game.

You can also test this interface on the web browser:

All the modified code is on the Carballo Sourceforge SVN, under the folder webtv.

To install the app uncompress the webtvchess.tgz file on the applications/ folder of an USB stick and plug the stick to the WebTV.

Blusens apps developers forum link:

Tales of a chess engine developer 1

Chess engine development is one of the most brain-crushing activities I’ve been involved on the last years. Last nigths I was working again on my Carballo Chess Engine with some advances.

First of all I decided to leave Negamax and go with Principal Variation Search (PVS). Also decided to implement separate methods for root nodes, PV nodes and null window searches. On previous experiments PVS was performing worse than Negamax, but I discovered the reason: the aspiration window has some implementation issues with PVS: when the search for a move fails low at the root node the move must be researched enlarging the window.

I was very stranged of why Futiliy Pruning was not working for me, but finally discovered the reason: a simple sign change after evaluation was the reason! Also implemented to store the evaluation values on the Transposition Table (TT).

The next step: why Carballo searched much less depths than other engines, it was due to quiescence search. I was generating checks for the first 4 PLY’s of quiescence, but some other engines not, so this was the reason. I decide to generate only checks on the first PLY of quiescence and only for PV nodes. Also modified a bit the move generation to optimize for quiescence.

During this time also found many interesting bugs, I was storing on the TT the bound and not the score when failing high/low, also on PV nodes is better to use only the TT for ordering and not to return scores from it, this helps avoiding draws. Also found a serious bugs involving time management (was taking as reference opponent’s time) and with contempt factor on IID searches corrupting TT entries. Finally added a Pawn Push Extension and removed the Recapture Extension and now some extensions now depend of the node type.

Running some test tournaments, I hope to get some good results soon and add the improved engine to my Mobialia Chess.

Mobialia Chess for Android 2

The new version 2.0 adds the support to play online on (FICS). You can play against people all around the world and compare your chess knowledge. Thousands of hours of entertainment with this new version.

Also has many improvements on the interface and gameplay, which makes Mobialia Chess 2.0 the best chess app for Android.

Try it! The LITE version is free, and the complete version is avaiable for only 1.99 EUR at the Android Market.

Check all the Mobialia Chess for Android features at

Great GWT UI for Carballo Chess Engine

libgwtsvg-chessLukas Laag has written me about his new  GUI for the Carballo Chess Engine  using the Google Web Toolkit (GWT) and his SVG Graphics Library for GWT, libgwtsvg.

GWT is provided from Google to develop applications in Javascript programming in Java. It conterts the Java code to Javascript, and the application is run on the browser, without any additional plugin.

This interface is quite better than the sample Applet from Carballo, it has move history, legal move hightlighting, and SVN graphics. It can be used from:

He also wrote an article explaining the difficulties of his project. Thanks Lukas for your work.

Carballo Chess Engine 0.3 2

pawnAt last, the first “stable” release of my chess engine. The main new features are:

  • Static Exchange Evaluator (SEE): the biggest change,  affects move ordering introducing more move generation phases, also affects LMR, etc.
  • New “experimental” evaluation function, with King Safety, X-Ray attacks and improved mobility
  • Recapture extension, also changed a lot the extension mechanics adding fractional extensions
  • Quiescense search now only generate checks the first 4 PLYs and follows only good captures
  • UCI Options: can configure Hash Size, Book, LRM, IID, extensions, the evaluator to use, etc.
  • Bugs with draw detection by the 50 move rule (I was doing at 50 PLY), and lots of other small bugs solved

Finally the Negascout code did not improve results at tournaments, so all the Negascout code is commented in the SearchEngine. I’ll continue to investigate.

With this release I include an package to run the program from chess GUIs like Arena, so now it can be included in “official” tournaments.

ELO at tests had a big increase from last version. Now scores over 2330 ELO points at BT2630 test (from the 2100 of Carballo 0.2). Also the positions solved of the “win at chess” test are now 275 of 300 (from the previous 237/300), well, also helped that the EPD parser had a bug and didn’t work well with positions with more than one solution. In LCT II also scores 2300 ELO. All the tests results are in the SVN, at the folder “testresults”.

But at tournament (playing against other java chess engines), the improvement is not so much. Now I think is over BrembroCE, but remains behind Jonathan Pettersson’s Mediocre, Alf and Frank Walter chess engines. I will center the next testing in tournament play.

Play Against Carballo Chess Engine

Carballo Chess Engine

pawnTwo months ago I read a post about Toledo Nanochess in Microsiervos, and remembered my failed attemps to make a chess program in Pascal/Assembler when I was younger. So 13 years later I wrote my chess program from scratch in Java. I did it in two months at after-hours, reading a lot at the Chess Programming Wiki, and here is the result:

Play Against Carballo Chess Engine

It is a work-in progress, but a good framework to test some ideas in chess programming and good enought to play some interesting games against it (well, actually I am not able to win it, but I am a very poor chess player).

Now I’m mounting my kitchen from Ikea, so I haven’t time to improve Carballo, but in a near future I’ll continue working on it.