Jacobi: Fairy Chess Helpgame Solver
by François Labelle
Launch the latest version
About
Jacobi is a program to solve fairy chess proof game problems. Here's an example:
Dirk Borst
Nunspeet 2005
2nd place
Proof game in 9.5 moves (15+16)
Circe Rex Inclusive
The solution is 1.g3 d5 2.Bg2 d4 3.Bc6+ Kd7 4.Sf3 d3 5.OO dxe2 6.d3 exf1=R [+wRh1] 7.Sbd2 Rxg1 [+wKe1]+ 8.Sf1 Rxg3 [+wPg2] 9.Se3 e5 10.OO.
Jacobi solves this in a few minutes:
 814s with v0.1 in Firefox 52 on an i76700 CPU @ 3.40GHz
Jacobi's strengths:
 solves fairy proof games faster than Popeye in most cases,
 solves proof games with undefined pieces (letter X),
 supports special proof game options like AddPieces and ColorThePieces,
 supports chaining multiple stipulations together.
Jacobi can also solve some ordinary help stipulations but there is very little reason to do that because Jacobi is on average 5x slower than Popeye for this type of problem. In addition, Popeye and WinChloe support more stipulations, fairy conditions, and fairy pieces. One reason, though, would be for conditions exclusive to Jacobi.
Jacobi can also solve orthodox proof games, but there is very little reason to do that because Jacobi should be slower than Natch or Euclide which are optimized for the orthodox case.
It cannot solve stipulations containing defensive moves, like directmates or selfmate, which is why the subtitle calls it a "helpgame solver". As an exception, Jacobi will accept one defensive halfmove at the very end of the problem.
Documentation
See the separate documentation page. Sorry for the extra click, but the welcome page was getting too big.
How to quickly try Jacobi
 Find an example problem that interests you from the documentation page.
 Click on the corresponding "Load in solver" button.
 On the solver page, click "Start".
Feel free to experiment by modifying the "Text representation" box, but keep in mind that each time you change something, you have to click on "Set problem from text" and then "Start".
Offline use
Method 1
Just bookmark the latest version page so you can get to it directly. This page contains an AppCache manifest which tells your browser to store every file needed by Jacobi on your computer/device so that the page still "loads" when offline in that particular browser. Some browsers even offer the option "Add to homescreen", which will turn Jacobi into a Web App that you can launch by clicking on an icon (as long as the browser remains installed and its application cache is not cleared).
Method 2
Zip archives of Jacobi are available. Updated irregularly.
Upcoming features
Here are the features I'm planning to add soon, so don't bother suggesting them! Jacobi will reach v1.0 when they are all implemented.
 Add a graphical editor for diagrams.
 Add an editor for stipulations with dropdown menus to select from available stipulations and aims.
 Add a graphical viewer for solutions.
Add a few more aims (%, 00, ep).
Add a few more fairy conditions (Chess960, FollowMyLeader, Duelist, Chameleon).
Warn of selfcheck in the initial position instead of crashing.
Teach the PG solver that doubled pawns imply a capture nearby when the fairy conditions are close to orthodox.
 Teach the PG solver that the path traversed by a pawn appearing in the goal diagram can't be vertically crossed in some cases when fairy conditions are close to orthodox.
 Rewrite the PGdemolitionmode code, hopefully making it faster.
Add a WebAssembly version of the chess engine for a speed increase of maybe 50% in modern browsers, with fallback to asm.js for the rest.
 Document the "elementary commands".
License
Jacobi is freeware, which means that you are free to use it and make a copy for personal use, but not to redistribute copies as I retain the Copyright on it.
The code for the interface is unobfuscated JavaScript, feel free to look at it and propose patches to me. On the other hand, the Chess engine is obfuscated JavaScript, having been compiled from C with Emscripten. I'm keeping the C source code private.
Privacy
The problems that you enter are solved on your own computer using WebAssembly or JavaScript, and are not transmitted over the Internet.
Version history
Here I keep links to old versions. Useful to you if I break something with an update.

v0.5.2 RC1 (20180916)
 Improved the dialog error box. The old dialog sometimes had the prefix "wismuth.com says" or a checkbox labeled "Prevent this page from creating additional dialogs".
 In Allin Chess, forbid castling with the opponent's pieces if the mover's king is in check.
 Added the condition Duelist (also known as Single Combat).
 Added the condition WhiteFollowMyLeader.
 Added the condition BlackFollowMyLeader.
 Added some material to the documentation.

v0.5.1 (20180831)
 Fixed a crash with FaceToFace + BackHome.
 Fixed a crash when solving OscillatingKings PGs.
 Added the condition GrowingMen.
 Added the condition ShrinkingMen.
 Added the condition Madrasi PawnExclusive.
 Modified the condition NoImmediateRepetition to compare only the diagrams, not the positions, so that AllInChess + GrowingMen works as expected.
 Fixed the stipulation parser to accept HS# written in uppercase. It stopped working in v0.2.3.
 Use Service Workers for offline support instead of AppCache when loading over https. (Firefox's implementation of AppCache seems to be buggy over https.)

v0.5 (20180826)
 Moved the documentation to a separate page, added some material.
 Added "Load in solver" buttons next to examples.
 Added a menu button in the topleft corner of the solver to access the documentation from there, available offline.
 Fixed a crash when solving OscillatingKings + Circe PGs.
 Improved the performance of the PG option "Add" for some problems.
 Theoretically improved the solving speed of PGs with Bicapture, Cannibal, and Circe Assassin.
 Improved PG demolition mode performance for #R Chess.
 Fixed page load error on iOS after adding to homescreen.
 Accept and ignore the command "protocol" instead of complaining.
 Reject repeated or misplaced "forsyth" and "pieces" commands, to prevent misunderstandings.
 Report errors caused by bad inputs in a popup dialog instead of the crash box.

v0.4.8 (20180804)
 Changed the application order of Masand, OscillatingKings, #R Chess, #C Chess, and Kk Chess.
 Fixed a crash with #C Chess and Bicapture.
 Fixed a crash with Kk Chess and Circe variants where a rebirth can promote.
 Added the PG option "Add" to add specific pieces.
See the example in the "Special proof games" section above. See the documentation.

v0.4.7 (20180626)
 Fixed a crash with Knightmate.
 Added the condition #R Chess.
 Added the condition #C Chess.
 Added the condition Kk Chess. These were introduced in feenschach 212 (2015). Definitions are also given in Quartz 44 (2017).
 Added the condition WhiteOscillatingKings.
 Added the condition BlackOscillatingKings.
 Added the condition SwappingKings (implemented as WhiteOscillatingKings TypeC + BlackOscillatingKings TypeC).
 Accidentally improved the speed of Circe RexInclusive.

v0.4.6 (20180618)
 Fixed a bug introduced in v0.4.4 causing some rare crashes when solving PGs.
 Fixed a crash with Chess960 + RoyalDynasty.
 Added the condition BlackCap (implemented as BlackMustCapture SemiUltra + BlackPassesIfStuck).
 Added the condition BlackChecks (implemented as BlackMustCheck SemiUltra + BlackPassesIfStuck). The text box also accepts the alternative name "Checking".
 Added the condition Zigzag (implemented as WhiteMustCapture Anti SemiUltra + WhiteMustCheck Anti SemiUltra) and the variants ZigzagStapff and ZigzagUltra.

v0.4.5 (20180601)
 Fixed a crash with PromOnly P and Circe variants where a rebirth can promote.
 Fixed a crash with AdversePromotions + Tibet.
 Fixed a crash with RoyalDynasty + KobulKings.
 Changed the behavior of PromOnly + ChameleonChess to correspond to Popeye.
 Fixed a display bug introduced in v0.4.4 that produced strange notation for RelegationChess and ChameleonChess.
 Improved the solving speed of PGs by about 10%.
 Improved the solving speed of some series PGs.
 Fixed degraded performance for PGs with two rooks of the same color ending on files d and f.
 Fixed e.p. notation in output language "Frenchçé".
 Removed the warning "Keep this window visible when solving...", except for Safari. For other browsers it seems this is not an issue since v0.2.

v0.4.4 (20180513)
 Improved the solving speed of some PGs with doubled pawns some more. Invisible promotions (Phoenix, Prenix and CerianiFrolkin) can now sometimes be deduced.
 Fixed a crash with Madrasi.
 Fixed a crash when solving Chess960 + VerticalCylinder PGs.
 Fixed a crash when solving Circe Parrain PGs in demolition mode.
 Fixed a bug causing a check by a pawn to be counted as a multiple check when the pawn would otherwise promote, in some fairy conditions.
 Fixed a bug introduced in v0.2.3 causing the stipulations s#1 and r#1 to no longer work.
 Added the condition RoyalDynasty.
 Added the condition PromOnly.
 Added the condition AdversePromotions.

v0.4.3 (20180419)
 Fixed two bugs introduced in v0.4.2 that caused some crashes when solving PGs, and potentially caused missing solutions with LosingChess and Extinction.
 Fixed a bug that prevented the "test" command from applying to the initial position. This is useful for adding constraints to the initial position in Chess960.
 Replaced the "Flood protection" checkbox with a menu with a new option "Count only" which is more efficient for path enumeration problems with more than 1000 solutions.

v0.4.2 (20180417)
 Improved the solving speed of some PGs with doubled pawns. For example, P1273714 improved 100000x.
 Allow PGs with more than 32 pieces on the diagram. This can happen when promoting pawns in Sentinels.
 Fixed a bug affecting ChameleonChess PGs.
 Fixed a performance bug affecting PGs with Berolina pawns.
 Fixed a crash when solving Chigorin + Einstein Reversal + AntiAndernach PGs.
 Fixed a crash in v0.4.1 when attempting to solve a PG with two kings and the option ColorThePieces.
 Renamed MoveAnyPiece to FreeForAll (Jed Stone, 1982).

v0.4.1 (20180402)
 Fixed a crash when solving Circe Parrain Assassin PGs.
 Fixed a crash when solving AntiAndernach + NonRoyalKings PGs.
 Fixed a bug in EiffelChess (there was paralysis of fairy pieces).
 Fixed a bug in Woozles + White/BlackEdgemover.
 Fixed bugs in Masand when combined with Disparate, Circe Rexinclusive, NewKoeko, or Isardam.
 Changed the behavior of Sentinels + BackHome and Sentinels + Circe Diagram to correspond to Popeye and WinChloe. Sentinels no longer have an origin square.
 Improved the solving speed of Isardam by 312x for nonPGs, and 12x for PGs.
 Added the fairy piece Berolina pawn.
 Moved the condition Circe ContraParrain to the bottom section as Circe Parrain Mirror, following Popeye.
 Added the condition ChigorinChess (special starting position and promotions).
 Added the condition AlmostChess (special starting position and promotions).
 Added the condition Knightmate (special starting position and promotions).
 Added the condition BerolinaChess (special starting position).
 Added the condition ImmunChess.
 Added the condition Sentinels Berolina.
 Added the aims ++, +++, ... , ++++++++. The number of checks is now displayed in the solution, unless also mate.

v0.4 (20180319)
 Made the PG solver a bit smarter and optimized the code. PG solving speed has improved by 2% to 60% depending on the problem, and a lot more for PWC and Sentinels.
 Fixed a crash with Bicapture + Multicapture.
 Fixed a crash with Masand.
 Fixed a crash with VerticalCylinder + Maximummer. Distance now takes into account the board topology.
 Fixed a crash with VerticalCylinder + BlackMustCapture Ultra.
 Fixed a crash when solving Tibet PGs.
 Fixed a crash when solving ChameleonChess PGs.
 Fixed a crash when solving KobulKings + Einstein PGs.
 Fixed a crash when solving FaceToFace + BackToBack PGs.
 Fixed a crash when solving Circe Turncoats + Masand PGs.
 Fixed a crash when solving Circe Turncoats RexInclusive PGs.
 Fixed a crash when solving AntiAndernach + NonRoyalKings PGs.
 Fixed a crash when solving Bicapture + Circe Couscous PGs.

v0.3.2 (20180302)
 Fixed a crash with Tibet. The condition was unusable.
 Fixed a crash when chaining more than 5 PG stipulations.
 Moved the condition Bichromatic to the bottom section as "Monochromatic Anti", for technical reasons.
 Added the condition GenevaChess.
 Added the condition NormalPawn (which can be added to Annan, PWC and others to let a pawn on its first rank move).
 Added the condition Circe Strict.
 Added the condition Circe Assassin.
 Added the aims %, 00, and ep.

v0.3.1 (20180223)
 Fixed a bug introduced in v0.3 causing demolition mode to crash with almost every condition.
 Fixed a crash with Circe Turncoats RexInclusive.
 Fixed a bug causing NoImmediateRepetition to wrongly accept some repetitions midgame when solving PGs.
 Improved the solving speed of Vogtlaender by 6x (for nonPGs).
 Added extra checkboxes for conditions like LosingChess, to aid discoverability.
 Made the Text representation box understand condition names written in French or German.
 Fixed the figurine color when displaying AllInChess solutions.
 Added the condition MulticaptureChess.
 Added the condition UnicaptureChess (implemented as Multicapture Anti).
 Added the condition Tibet.
 Added the condition DoubleTibet.
 Added the condition Koeko.
 Added the condition AntiKoeko.
 Added the condition NewKoeko.
 Got for free the condition AntiNewKoeko.
 Added the condition ContactGridChess (implemented as Grid + Koeko AffectedByGrid AppliesToRebirth).

v0.3 (20180216)
 Reordered the conditions to better reflect the order in which they are applied. For example (following Popeye), Monochromatic affects Madrasi paralysis and Madrasi paralysis affects the definition of observation of Patrol, so these three conditions are listed in the order Monochromatic, Madrasi, Patrol.
 Changed the behavior of Madrasi to correspond to Popeye: test for royal units instead of the king piece.
 Changed the behavior of Circe Clone to correspond to Popeye: test for royal units instead of the king piece (change detectable by adding KobulKings or LosingChess).
 Fixed a bug in Monochromatic + Madrasi causing some missing enpassant paralysis.
 Fixed some missing king moves in Monochromatic + FaceToFace.
 Correctly apply Monochromatic and Bichromatic to castling rook in Chess960.
 Fixed castling distance in Chess960 + Maximummer.
 Improved the solving speed of some Monochromatic and Bichromatic PGs. For example, P0008928 improved 250x.
 Warn if the side to play can capture the king (instead of crashing).
 Fixed a bug causing no solutions in Masand PGs when the goal diagram hides a king as an undefined piece without ColorThePieces.
 Fixed a crash when solving Masand PGs.
 Fixed a crash when solving Tacu enigmas with AntiAndernach.
 Added the condition GridChess.
 Added the condition WhiteEdgemover.
 Added the condition BlackEdgemover.
 Added the condition Madrasi RexInclusive.
 Added the condition Woozles.
 Added the condition BiWoozles.
 Added the condition AllInChess (implemented as
MoveAnyPieceFreeForAll + NoImmediateRepetition).
 Added the condition Bicapture.
 Added the condition Cannibal.
 Added the condition RelegationChess.
 Added the condition Isardam RexInclusive.

v0.2.3 (20180106)
 Notate the starting file of a vertical pawn move if ambiguous (common in Annan).
 Generalized stipulation closure to any sequence of "h" and "*", with "s" or "r" allowed as the last character. This covers 8 of the 12 series genres listed in an article by Nicolas Dupont in issue 13 of the ChessProblems.ca Bulletin.
 Generalized reflex stipulations, with examples given in the
new "Reflex stipulations" section above documentation.
 Fixed a bug affecting Hypervolage PGs.
 Fixed a bug affecting Einstein + VerticalCylinder PGs.
 Fixed a crash with Circe RexInclusive Chameleon + KobulKings.
 Fixed a crash with Extinction.
 Changed the behavior of Circe Chameleon + CavalierMajeur to correspond to Popeye.
 Added the condition ChameleonChess.

v0.2.2 (20171121)
 Fixed a crash in v0.2 and v0.2.1 when solving VerticalCylinder PGs. Notate extended castling OOOO.
 Fixed a bug in v0.2.1 with Vogtlaender.
 Added the condition Chess960.
 In reflex series, reject solutions when the idle side can reach the aim during the series. With this change there is a unique solution to the serhr#8 by Meinking and Petkov, StrateGems 2011, reproduced on p.44 of Dan Meinking's Chess Problem Collection ("forsyth 1S6/pK1R4/3Bk3/r5P1/6P1/8/1PB5/8 stip serhr#7" in Jacobi).
Temporarily hardcoded the version number in the "Launch the latest version" button until I resolve issues Firefox has with the autoupdating version.

v0.2.1 (20171114)
Bug fixes only. Most of the crashes were found by myself through automated testing.
 Fixed a crash when solving Circe Chameleon PGs.
 Fixed a crash when a rook able to castle comes from a rebirth promotion, for example the rebirth [+bPa1=wR] in PWC + Volage.
 Fixed a crash when a king is reborn in Circe Clone RexInclusive.
 Fixed a crash when a king is reborn in Circe RexInclusive + Hypervolage.
 Fixed a crash with Circe Parrain + Andernach.
 Fixed a crash with Volage + Einstein.
 Fixed a bug causing a complete lack of solutions when the initial position had a missing king in Circe RexInclusive.
 Fixed a crash in v0.2 when solving Tacu enigmas with Sentinels.
 Fixed a performance regression in v0.2 when solving Tacu enigmas with Circe or Annan.

v0.2 (20171109)
 Fixed a crash with Circe Parrain + Annan.
 Fixed a bug causing stalemate notation (=) to appear midseries after a parry move.
 Added the ability to specify the hash table size.
 Dramatically improved the performance when solving PGs with diagrams similar to the homebase position.
 Fixed a bug causing some castling solutions to be missing in PGs with Hypervolage and a few other conditions. See details.
 Update the explored variation on screen less often, and other small performance improvements.
 Use WebAssembly instead of JavaScript when available, which is a bit faster.
 Fixed Disparate behavior in series. Can now solve JF996.

v0.1 (20171030)
Many planned features have been postponed to get something out as fast as possible. For now, the problems can only be input in text representation, apart from conditions which can be set by clicking checkboxes.
Page created: October 16, 2017
Page last updated: August 31, 2018
back to François Labelle's homepage