Showing posts with label Endgames. Show all posts
Showing posts with label Endgames. Show all posts

13 March 2023

NextChessMove.com

In the previous off-week engine post, Chessify vs. Chessbase Engine Cloud (February 2023), I noted,

Since the beginning of the year, the off-week engine posts -- meaning those weeks that I'm not tracking TCEC/CCC -- have been looking at the Chessify engine cloud.

While the Chessbase service deserves a deeper look, I'm going to switch my attention to another, similar service that I can use immediately without installing expensive software that I don't really need. The following screen capture shows the home page for 'Next Chess Move [NCM]: The strongest online chess calculator'.


NextChessMove.com

The intoduction at the top of that page explains,

Drag pieces to configure the board and press 'Calculate Next Move'. I'll tell you what the computer player does.

Last year we briefly saw the same site in the post Stockfish Breaks All the Barriers (April 2022; 'NCM Stockfish Dev Builds). At that time I neglected to delve into the real purpose of the site.

The function to 'Calculate Next Move' begs to be used on something other than the traditional start position that appears there by default. I went back to one of the games that I'm using to try Chessify, as described in the recent post Chessify Progress Report (January 2023).

I chose a game that has progressed to a Queen and Pawn (Q+P) endgame where I have an extra Pawn. It's a difficult endgame and during the Chessify trial I've learned a lot from offline resources about Q+P endgames in general. I've steadily improved the position of my King and Queen to their maximum potential, but am now facing a decision on how to proceed. There are several possible plans, but the Chessify engines insist that all variations lead to a draw.

Back to NCM, I used the FEN function, shown below the chessboard, to enter the FEN string from the current position of my Q+P endgame. I then unleashed both Stockfish 15.1 and LCZero 0.29.0 -- separately, of course -- on that position.

My first impression was that NCM is somewhat tedious to operate. 'Calculate Next Move' thinks for about five seconds, then returns a single move that (1) needs an action to apply it to the current position, followed by (2) another action to change the 'Active Color', i.e. the side to move, before it's ready to calculate the following move. None of the remaining moves in the 'Principal Variation' (PV) are shown.

Despite that repetitive procedure, the short test worked well and I'm ready for a more extensive test on a real game (where engines are permitted). The top of the right column on the NCM home page informs,

NCM Pro $19/year • Get stronger moves from NCM's 16 CPU core and RTX 2080 GPU dedicated servers. Free trial includes ten minutes of calculation time. Paid members get unlimited calculations.

The link for 'See Details' points to Next Chess Move: About NCM Pro, where more is explained. As soon as I finish one of my Chessify test games, I'll start the NCM free trial on a new game.

The major downside to the service is obvious. It's a magnet for online chess cheaters.

30 May 2022

Eight-piece Tablebase in the Lab

It's been a few years since I posted Seven-piece Tablebase on Lichess (August 2018), featuring a practical endgame tool that anyone can use. A couple of recent articles from Albert Silver of Chessbase indicate that the next tablebase generation is already with us in the research stage:-

Both articles incorporate a video from Youtube's Chess & Tech channel:-

The video description starts,

The first results of 8-piece chess endgame tablebases are shared in a chat with developer, computer chess enthusiast, and physicist, Marc Bourzutschky.

An earlier, informal paper by Bourzutschky is available at

Although that page is undated, Google search returns the date I gave for the link. The paper starts,

It has been about fifteen years since Yakov Konoval and Marc Bourzutschky (YKMB) published the first database results for 7-man endgames, and about thirty years since Lewis Stiller’s pioneering work on 6-man endgames.

That means it took about 12 years for the seven-piece tablebase (TB) to become generally available via a web interface. I'm guessing we'll see eight-piece TB tools a lot faster.

07 February 2022

'Reasonable Support' Required?

Back in July 2020, the TCEC !next command announced,

Now Top Of The Top - top4 bonus 7x DRR including 1 'bookless' DRR and SF NNUE gauntlet vs top4 !topofthetop . Then Cup6 testing. Then Cup6 !cup. Then S19 starts with special Bonus and special Bonuses between leagues. Then FRC. Then S20 (current plan, can change, also !4k bonus might be inserted somewhere)

A month later that last sentence, '!4k bonus might be inserted somewhere', was expanded:-

Now [S19] QL+L3 testing. [...] Then QL, L3, L2, L1, DivP, Sufi, Cup7 and FRC2. Then S20 (current plan, can change, also !4k bonus and/or !r-mobility bonus might be inserted somewhere)

My fortnightly report at that time was Alliestein Wins TCEC Cup 6; CCC Tests 'Stockfish NNUE' (August 2020). What are those two 'bonus' events? The first...

!4k • Engine maximum size is 4kB (4096 bytes)

...is explained in TCEC 4k Rules (wiki.chessdom.org; 'This is a temporary version!! The page below is not yet final'). The second...

!r-mobility • Goal of reset-mobility is to restrict your opponent mobility in legal moves as much as possible. Only positions after last pawn/capture are included, while not being in check is counted as an additional 0.5 moves.

...is explained in R-Mobility (wiki.chessdom.org). The page starts,

R-Mobility (aka reset-mobility) is a generalization of mate and stalemate: force opponent to have as few legal moves as possible. R-Mobility allows to convert advantage in drawn games into favorable tiebreaks. Only last record since previous pawn and/or capture move counts.

The idea expands on checkmate / stalemate into positions like K+P:K and K+B:K where one side has a material advantage, but the result is a draw. For some time now, I've been looking for ideas that alter scoring (W-L-D) to allow a richer set of values, thereby reversing the draw boredom that chess has experienced when powerful engines are used.

The idea behind r-mobility is a step in that direction, although it is too uncertain to start development. The TCEC !next command currently says,

!4k bonus and/or !r-mobility (armageddon) demo or bonus might be inserted somewhere (one engine minimum with reasonable support needed)

Why wait for 'one engine with reasonable support'? The idea can be back-tested on hundreds of engine vs. engine tournaments to determine if it has any validity. It could even be back-tested on human tournaments. No 'reasonable support' required.

20 September 2021

TCEC VSOB Opening Tools

In the previous post on engine competitions, TCEC VSOB 21, CCC Blitz 2021 : Both Still Underway (September 2021), I copied a couple of the TCEC !Commands. Here's the second of them:-

!vsob1 • Before you submit a VSOB opening you can check if it is completely busted at
   https://www.chessdb.cn/queryc_en/
or (if it is more of a fantasy opening) at
   https://lichess.org/analysis/standard/

TCEC VSOB = Viewer Submitted Openings Bonus. Let's turn those two URLs into clickable links for further investigation.

1) Chess Cloud Database Query Interface (chessdb.cn). Its 'Info & Help' page explains,

Chess Cloud Database (aka "CDB") is a massive chess knowledge database, including an opening book and endgame tablebases. In contrast to traditional opening book building from game results, CDB is built entirely from analyzing individual moves using chess engines while overcoming their problems such as aggressive pruning and blind spots. CDB attempts to explore and define new chess opening theories, currently it includes most of the popular opening lines and yet still refining the results.

Further references to the endgame tablebases use the acronym 'EGTB'.

2) Analysis board (lichess.org). It also incorporates a tablebase, which I discussed a few years ago in Seven-piece Tablebase on Lichess (August 2018). I've used it many times since and it's a great tool. For completeness, I should mention another tablebase tool released recently: Chess.com Announces New Tablebase Feature (chess.com).

I started this post with the intention of examining the use of these tools for opening analysis, not for endgame tablebases. Unfortunately, I found nothing worth reporting for opening analysis. Good openings respect chess logic; bad openings don't. It really is that simple, as the tools consistently confirm. Maybe if I give it more time, something unusual will appear.

12 July 2020

Bloody Endgames

Want to know the truth about the 2000 Kramnik - Kasparov World Championship match?


JUGA feat. Vlad Kramnik - Endgames Bloody Endgames - U2 Chess cover | Kasparov vs Kramnik (4:39) • 'Premiered Jun 30, 2020'

The first lines of the song are...

I can't believe the move he played
3...Nf6 has not been analyzed 'til mate

...and the description of the video says,

Chess version of U2's Song "Sunday Bloody Sunday" performed by Juga. Chess Lyrics by Ex World Champion Vladimir Kramnik. Inspired by Kasparov vs Kramnik World Chess Championship 2000. Recorded at Budai Var, Budapest, June 2020

For U2's original version, see U2 - Sunday Bloody Sunday (youtube.com): 45M views, 9400 comments. For more from Juga, see Bio | JUGA - Chess Artist - Official Web Site (jugamusica.com): 'Juga is a singer, songwriter and Chess Conceptual artist.'

23 March 2020

Tablebases and Fortresses

There's an interesting thread on the Fishcooking forum: Misplayed wins, fortresses, or wrongly evaluated positions (google.com/fishcooking). It starts,

I've done an analysis of ~1M recent Fishtest LTC [Long Time Control] games, looking for those games that had a draw result, but where the evaluation was >2.0 for at least four plies. The result is ~17000 FENs that have been misplayed wins, fortresses, or wrongly evaluated positions. I think this might be interesting to have a look at, and might yield some [Stockfish evaluation] improvements.

The 17K FEN positions are in a Dropbox.com file available to everyone. I downloaded the file and pasted the first dozen positions into the Analysis board (lichess.org). I first discussed this tool in Seven-piece Tablebase on Lichess (August 2018).

Of the positions I looked at, at least half were tablebase positions, thereby subject to exact solution. The rest were fortresses like the one shown below.


6k1/2p4r/1p1q2p1/rPpNp1Pn/P1P1Pp2/1KQP4/5P1R/R7 w

Because of the extra Pawn, this looks to me like a possible win for White -- play for Nb3 -or- try the exchange sacrifice on h5 -- but the engines have a remarkable talent for finding hidden resources in tough positions. More work is necessary, but first I have to develop a better tool than copy/paste into a web page.

21 February 2019

Chessable and 'Game Changer'

Chessable appeared on my radar twice during the past month. The first time was in connection with the 'Game Changer' book; see my recent post 'Game Changer' Excerpts for my next-to-last word on that. The second time was John Hartmann's book review in the January 2019 issue of Chess Life. The Chessable portion of the review started,

Chessable is a new website/"webservice" gaining quite a bit of mindshare with tech-savvy players. Part of this has to do with its association with IM John Bartholomew, one of chess' leading streaming personalities, who also serves as Chessable's Chief Communications Officer and co-founder. Bartholomew is a big draw in the streaming/esport landscape and his involvement with the platform has undoubtedly aided in its rise to prominence.

I make no claim to being particularly tech-savvy, which is confirmed by my having never visited the Chessable site. Hartmann's mention that the site was 'free to use' meant that it was high time to rectify the oversight.

Chessable.com describes itself as 'Learn chess online: openings, tactics & more'. Since taking up chess960 I'm no longer interested in studying traditional chess openings and since tactics trainers are a dime a dozen, I wasn't sure that the site had much to offer me that was both interesting and free. Luckily for me, the '& more' portion includes endgames.

Free access to the site requires an id and a password (entry no.248 according to my system for managing passwords), undoubtedly used to track progress on the Chessable material. I quickly located the free 'Basic Endgames' course and started using the service immediately. The key to the training is in repeating the material, an exercise which I found a bit tedious after a few minutes, but which probably works for anyone who has the necessary patience. The underlying theory is explained on the page The science that makes chess learning easier (chessable.com). Like most theories about learning, I imagine there is considerable controversy here, but I'll look into that some other time.

As for the material based on the 'Game Changer' book, see The game has changed! GM Matthew Sadler on how Game Changer can benefit YOU (ditto; 31 January 2019) by Leon Watson, who is described on the About Us page as responsible for 'PR & Marketing'. That promotional page points to Game Changer: AlphaZero's Groundbreaking Chess Strategies and the Promise of AI - MoveTrainer™ Course (chessable.com). The comments include a couple of positive reviews by competent chess players who are also knowlegeable about MoveTrainer. All in all, the course looks promising.

13 December 2018

Endgame Studies with Timman

GM Jan Timman is best known as a player. Last year, in 1967 World Juniors (October 2017), I gave a brief overview of his career as a World Championship candidate, stopping just before his ill-fated participation in the 1993 Karpov - Timman FIDE Title Match.

After being a player, GM Timman is also well known as an author. His Wikipedia page, Jan Timman, currently lists nine book titles and I am certain that the list is not complete. The last book listed is 'The Art of the Endgame', subtitled 'My Journeys in the Magical World of Endgame Studies' (New in Chess, 2011). The book brings us to a third aspect of his dedication to chess : as a composer of endgame studies. Chapter 1 of the 2011 book, titled 'Miniature Studies', starts,

A miniature study is a study with no more than seven pieces in the starting position. With minimal material, the composer must weave the maximum amount of finesses into the position. A classical example is the following study by the brilliant Russian composer Mark Liburkin.

Any study with seven pieces or less is solved by current tablebase technology, which we saw a few months ago in Seven-piece Tablebase on Lichess (August 2018). The Liburkin study is the first position in the first chapter of Timman's book.


Liburkin, '64' 1933
White to play and win

I'll continue to explore 'The Art of the Endgame' and will report any findings worth further research. I've already discovered that seven-piece tablebase positions are paricularly fruitful for further investigation.

10 October 2018

Chess Informant R+2P vs. R+P

After the previous post on Reuben Fine's 'Basic Chess Endings' (BCE), Fine 1 - Tablebase ½, what's next for R+2P vs. R+P endgames? Chess Informant (CI) comes to mind with both the 'Encyclopaedia [Encyclopedia] of Chess Endings' (ECE) and the endgame section of the 'Informant' periodical.

Some years ago I discussed both products in Chess Informant Endgames (March 2012), which included a copy of the table of contents for the ECE volume on Rook endings The structure of that volume's chapter devoted to R+2P:R+P is shown below (p.162).

The short left branch ('5/a') of the upside-down tree is for endgames with no passed Pawn. The branch below it (the 'middle' branch) is for endgames where the stronger side has one passed Pawn, while the right branch shows endgames with two passed Pawns. Both of those long branches are divided into sections where the side with two Pawns has connected, disconnected, or doubled Pawns. Those sections are further divided into subsections according to the relationship with the opponent's lone Pawn. It looks simple enough, but it took me some time to understand the symbols. The same system was adopted in Informant 39 (1985H1) and thereafter.

04 October 2018

Fine 1 - Tablebase ½

Let's go back to Chess and Impressionism (September 2018), where I wrote,

After my first idea for today's post ran into trouble when I ran out of time (a follow-up to last week's 'A Remarkable Tool', if you're curious) [...] I'll try to return to 'A Remarkable Tool' in another post.

In the post A Remarkable Tool, I aimed Lichess's seven piece tablebase at an endgame of the type R+2P vs. R+P. After documenting some flawed analysis, I then tackled the same class of endgame in Reuben Fine's 'Basic Chess Endings' (BCE). Fine's analysis was 100% accurate on every position I looked at until I 'ran out of time'. Continuing with Fine during the next session, I discovered the following position. (Use the link under the diagram to follow the analysis on Lichess.)

BCE no.363

Lichess: 8/8/6p1/R5K1/4k2P/8/p7/r7 w - - 0 1

Fine wrote,

To blockade the Pawn with the [defending] Rook is less favorable. It is relatively best to have the Rook behind the Pawn. In that event, the defender draws if his King can find a haven behind the Pawns, but loses if he cannot. As a rule the King can find a safe spot only if the two remaining Pawns are on the same file.

No.363 (Steinitz - Gunsberg, 9th match game, 1890-91) is typical. Against the threat of the removal of the Black Rook with check White is defenseless, for on 1.Kh6 g5! compels him to expose his King.

Fine's logic looks straightforward, but there is a neat twist hidden in the position. After 2.Ra4+ (the only move) 2...Kd5 3.Ra5+ (ditto) 3...Kc6, the move 4.hxg5 is an error. White should sacrifice a second Pawn with 4.Ra3 (4.Ra8 leads to the same idea), entering a Rook endgame two Pawns down, where the extra Pawns are a- & h-Pawns. This is known to be drawish.

Indeed, after 4...gxh4, White has a series of forced moves that lead to a draw: 5.Rc3+ Kd5 6.Rc2 Ke4 7.Kh5 Kf3. Now follows, for example, 8.Rb2 h3 9.Kh4 (forced) 9...h2 10.Rxh2. Black can try other attacks, but White always has a counterattack. After rejecting 1.Kh6, Fine continued,

Consequently the only hope lies in driving the Black King as far away from the K-side as possible, giving up the Rook for the RP, and taking one's chances on the ensuing R vs. P ending. This stratagem is bound to be unsuccessful here because the Black King is too near.

He gave 1.Ra4+ Kd5 2.Ra5+ Kc6 3.Ra6+, and Black wins. He again overlooked 3.Kh6, which after 3...g5, reaches the same position as in the line after 1.Kh6.

None of this is meant to belittle Fine. BCE was a landmark chess book and much of the analysis has withstood the test of time. This post is meant instead to demonstrate the kind of subtleties that are available in the common R+2P vs. R+P endgames.

13 September 2018

A Remarkable Tool

In my previous post, An Important Seven-piece Endgame, I discussed endgames of the type R+2P vs. R+P as given in 'Rook Endings' by Levenfish and Smyslov. I ended the discussion with:-

Despite the supposed simplicity of the other examples, I discovered a number of inaccuracies in their analysis. I'll discuss one or two of them in a future post.

Unlike the era of Levenfish and Smyslov (L&S), these endgames are now completely transparent thanks to the use of tablebases (TB). Consider the position in the top diagram below (Furman - Kopaev, event/year not specified). The TB gives 1.g5 as the only move, which is also the first move that L&S give. They wrote,

A strong move, opening up the White King's path to h5. It also makes it more difficult for Black's Pawn to advance.

Both sources agree that White has a won game and give 1...h5 as the best continuation for Black. L&S first examine 2.Rh6, where White wins the h-Pawn by force: 2...Rb2+ 3.Kg3 Rb3+ 4.Kf2 Rb2+ 5.Ke1 Ke3 6.Kd1 Kd3 7.Kc1 Rh2 8.Rxh5. The poor positions of the White Rook and King allow Black to draw with 8...Kc3 9.Kd1 Kd3 10.Ke1 Ke3 11.Kf1 Kf3 12.Kg1 Rg2+ 13.Kh1 Kf2 forcing perpetual check. (To follow the analysis in this post on Lichess, use the link below the diagrams.)


Lichess: 8/7p/5R2/8/4k1PP/1r6/6K1/8 w - - 0 1

The bottom diagram shows the position after the correct move 2.gxh6 (e.p.), followed by 2...Rb7 3.Kg3 Ke5. L&S now give the incorrect 4.Rg6, followed by 4...Kf5 5.Rg5+ Kf6 6.Kg4 Ra7 7.Kh5 Rf7 8.Rg6+ Ke7. Here Black can draw with 8...Kf5 9.Rg7 Kf6.

After 8...Ke7, L&S duplicate their error by giving 9.Rg7 Kf8, where 9...Kf6 leads to the same position (and the same draw) after 9...Kf6 in the previous paragraph. Instead of 9.Rg7, the continuation 9.Ra6 Rf8 10.h7 would win.

Back to the bottom diagram, instead of a draw with 4.Rg6, the TB says White should play 4.Rf8 Rh7 5.Kg4 Rxh6 6.Kg5, with mate in 64(!). This allows two conclusions: (1) the TB is a remarkable tool, and (2) not all Rook & a-/h-Pawn endings are drawn.

11 September 2018

An Important Seven-piece Endgame

Continuing with the Seven-piece Tablebase on Lichess (August 2018), I first looked at endgames of Q+2P vs. Q+P in A Flawed Seven-piece Study (ditto):-

The next section in Averbakh's book covers Q+2P:Q+P where the strong side has a passed Pawn. I fed all six examples to the Lichess tablebase and discovered that Averbakh's analysis was correct on five of them.

I then turned my attention to R+2P:R+P. Before tackling Averbakh, I decided to return to 'Rook Endings' by Levenfish and Smyslov, previously seen on this blog in Levenfish's Rook Endings (January 2011) and The Bridge, the Diversion, and the Best Defense (November 2011). The authors introduced the section titled 'Rook and Two v. Rook and One' with:-

This section is of great practical interest, as endings of this type, quite naturally, arise very often: as when one player has won a pawn during the game but at the same time most of the pawns have been exchanged off. As is clear from previous chapters, a R + P v. R ending is by no means always won for the superior side. The situation becomes more complicated with the addition of an extra pawn on each side, as this allows for new resources both for the attack and for the defence.

For example, the superior side can sometimes reduce to an ending with two far advanced connected pawns against a rook, whilst the defending side can sometimes reduce to an ending with rook v. far advanced pawn. Sometimes the defending side manages to transpose into a drawn ending with R + 2P v. R of the type analysed in Chapter 3.

No less important is the fact that, in analysing more complex rook endings, positions with two pawns v. one pawn can come up. Only if these positions are correctly appraised can the correct way to solving the more complex endings be found. But up till now endings with R + 2P v. R + P have been very poorly dealt with in chess literature.

The section is separated into positions having similar characteristics in their Pawn structure. The first diagrams in the section are of the type that is easiest to assess.

When the pawns are opposite each other and the superior side does not have a passed pawn, the result is usually a draw.

For example, the first position is shown in the following diagram.

White can make no progress: 1.Rh6 Ra4 2.Rh7+ Kf6 3.Rh6+ Kf7 4.Re6 Rb4 5.Kg5 Ra4 6.e5 Ra5. The position after the third move repeats the position after the first move, probably to show two different tries by White.

Despite the supposed simplicity of the other examples, I discovered a number of inaccuracies in their analysis. I'll discuss one or two of them in a future post.

23 August 2018

A Flawed Seven-piece Study

In my previous post Seven-piece Tablebase on Lichess, I noted the 'first free 7-piece tablebase' and took the service for a test drive. The example that I used was from Averbakh's book on Queen endgames, specifically a section with four positions of the type Q+2P:Q+P where there are no passed Pawns. I ended the post saying,

I'll continue to look at other Q+2P:Q+P endgames and will post anything unusual that I find. I'll also look at other endgame sources to investigate the accuracy of their analysis.

The next section in Averbakh's book covers Q+2P:Q+P where the strong side has a passed Pawn. I fed all six examples to the Lichess tablebase and discovered that Averbakh's analysis was correct on five of them. The exception was a study by F.Prokop, shown in the top diagram, Black to move.

The study continued 1...Qb2+ 2.Kc5! (a temporary Queen sacrifice) 2...Qe5+(*) 3.Kc4 Qf4+(*) 4.Kd3 Qd6+(*) 5.Kxe3, arriving at the bottom diagram. Here the Averbakh/Prokop analysis continued with three candidate moves, all of which lead to a win for White. The most interesting for me is 5...Qg3+ 6.Qf3 Qg1+ 7.Kf4 Qh2+ 8.Kg4 Qg1+ 9.Kh3 Qxg7 10.Qa8+ Kf7 11.Qb7+ Kf6 12.Qxg7+ Kxg7 13.Kg4, because it shows a common theme in Q+P:Q endgames. The strong side trades Queens to arrive in a position with K+P:K, where the Kings are far apart and distant opposition plays a leading role. A similar idea is behind 2.Kc5!.

In the bottom diagram, the tablebase indicates a fourth move, 5...Qh6+, which it says is the only move leading to a draw. It appears that Black has a perpetual check with this move. The variations branch off into so many sub-variations, that it is impossible to follow all of the key moves. I'll just have to trust the tablebase on this.

In the main variation starting 1...Qb2+, what do the asterisks '(*)' mean? They identify moves that the tablebase indicates are the only move leading to a draw; other moves lose. The tablebase also says that there is an alternate solution in the diagrammed position: 1...Qe6+ also draws.

In a footnote, Averbakh indicated that the top diagram was in fact an intermediate position in Prokop's study, because the previous moves were flawed. With so many branching variations in Queen endgames, it's not surprising that both the original analysis and the subsequent correction were flawed.

21 August 2018

Seven-piece Tablebase on Lichess

Almost since its beginning, this blog has taken an interest in chess tablebase technology, where endgames with a limited number of pieces are solved perfectly. The latest news opens an entirely new channel of investigation: 7-piece Syzygy tablebases are complete (lichess.org; 'Use the world's first free 7-piece tablebase on Lichess!'). The announcement started,

Congratulations to Bojun Guo (aka noobpwnftw) and Ronald de Man (aka syzygy) for completing the first free 7-piece tablebase and generously sharing it with the world! Lichess now provides online access on the analysis board and in studies, practice against tablebases, a public API, and a mirror for downloading the full tablebase files.

For the accompanying discussion, see General Chess Discussion / 7-piece Syzygy tablebases, with more links to other resources.

Six-piece tablebases are useful but somewhat limited. When we exclude the two Kings that are present in every position, we are left with four pieces, which are not sufficient for evaluating many positions where the stronger side has the advantage of a Pawn. Six-piece tablebases are most interesting for positions with unbalanced material, like R+P:B+P. With seven-piece tablebases, we suddenly have a tool for examining positions like R+2P:R+P, which are notoriously difficult to analyze.

Lately I've been interested in Queen endgames, because their outcomes -- win or draw? -- are difficult to predict during a game. Their analysis often goes beyond the horizons of current engine technology. Here's a simpler, well-known 19th century position from Averbakh's book on Queen endgames. It shows the Lichess interface.

Averbakh Q-endings (no.234) / Horwitz and Kling, 1851

White to move
Lichess: 5qk1/7p/8/6K1/8/7P/6P1/Q7 w - - 0 1

The key move is 1.Qa2+. The Queen climbs a ladder on the a1-h8 & a2-g8 diagonals to force a won K+P endgame. For more about Averbakh, see Averbakh's R+P vs. B+P Endgames (September 2017).

I'll continue to look at other Q+2P:Q+P endgames and will post anything unusual that I find. I'll also look at other endgame sources to investigate the accuracy of their analysis. In the meantime, I'd like to give a big thanks to Stefan Meyer-Kahlen for the resource that I've been using for the last ten years or so: All 6 men chess endgame databases available online (shredderchess.com).

26 June 2018

How Many Pawns for a Rook?

The diagram below shows an endgame position I reached in a recent chess960 game. I was playing White and although it looks like I'm down boatloads of material, I'm about to recover some of it. Looking at the material on the board, it's one of the most unbalanced positions I've ever encountered.


After 26...Rg8-c8

The game continued 27.Rxg6+ Rc6 28.Rxc6+ Kxc6 29.Qg6+. Here I was expecting 29...Kb7 30.Qxg7+, when White has a Queen and six Pawns against a Queen and Rook. The game was a correspondence game where engines were permitted and I had spent considerable time studying this position before deciding to play the line. The further variations went beyond the horizon of the engines I was using, so I was on my own to make an evaluation.

  • First observation: Black is going to recover at least one Pawn, maybe two.
  • Second observation: The White Pawns are too far back to present an immediate threat to Black.
  • Third observation: The Black King has no cover and is exposed to long sequences of checks by the White Queen.

All in all, it promised to be an interesting endgame where any result was possible. After 29.Qg6+, my opponent played 29...Kb5, and offered a draw. I realized that as long as he didn't play ...Kb7, White has nothing more than a perpetual check by the Queen on the 5th and 6th ranks. I reluctantly agreed to the draw and moved on to my other games.

08 March 2018

Stockfish in a Straitjacket?

It was one of those coincidences you can never plan. Near the end of last year Houdini won TCEC Season 10 at the same time that AlphaZero appeared on the scene. I covered both of those significant computer chess events in a single post, Houdini, Komodo, Stockfish, and AlphaZero (December 2017). The first three names are the top three chess engines in the world, of roughly equal strength, but AlphaZero had apparently crushed one of the trio in a match. In my post I wrote,

We can quibble about whether the AlphaZero - Stockfish match was indeed a fair fight -- 1 GB hash size is a severe restriction -- but the final score of +28-0=72 for AlphaZero was more than convincing to all but the most vehement skeptics.

I was reminded of those words while writing my most recent post, TCEC Season 11 in Full Swing. One of the sources I consulted, without referencing it in the post, was TCEC 11: Premier Division starts (chessbase.com; February 2018). The Chessbase site is well known and well respected for its expertise in computer chess and always attracts comments from informed readers. This particular article launched a discussion on why AlphaZero wasn't participating in TCEC Season 11 and whether the AlphaZero - Stockfish match had been too heavily rigged in AlphaZero's favor. The discussion mentioned four factors that could have hurt Stockfish's performance:-

  • Restricted hash size
  • Fast time control
  • No opening book
  • No endgame tablebases

I knew that the first two points were an issue, but wasn't certain if the last two were true. I went back to the Deepmind paper that had announced AlphaZero to the world (titled 'Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm') and re-read the relevant section:-

Evaluation • To evaluate performance in chess, we used Stockfish version 8 (official Linux release) as a baseline program, using 64 CPU threads and a hash size of 1GB. [...] The Elo rating of the baseline players was anchored to publicly available values. We also measured the head-to-head performance of AlphaZero against each baseline player. Settings were chosen to correspond with computer chess tournament conditions: each player was allowed 1 minute per move, resignation was enabled for all players (-900 centipawns for 10 consecutive moves for Stockfish and Elmo, 5% winrate for AlphaZero). Pondering was disabled for all players.

Since 'publicly available [Elo] values' depend both on configuring engines properly and on a level playing field, I started to have serious concerns that this controversy was more than a quibble. What did the Stockfish developers think about the match? On Stockfish's Fishcooking forum, in a long thread titled Open letter to Google DeepMind (December 2017), the opening message said,

AlphaZero won the 100 game match against Stockfish very impressively by a total score of 28 wins and 72 draws and 0 [losses]. This translates to an Elo difference of 100. However the details of the match described in your paper show that this match might have been much closer and more interesting had it not been for some IMO rather unfair conditions.

That first post and the subsequent discussion repeated the four complaints from the Chessbase comments listed above, and added,

In the match version 8 of Stockfish was used which is now over a year old. The latest version of Stockfish is over 40 Elo stronger in fast self play.

That makes five significant objections to the conduct of the match. Later in the same Fishcooking thread, TCEC insider Nelson Hernandez wrote,

This "match" was like a boxing match where one fighter had no seconds in his corner, the referee and judges were picked by his opponent, there was no audience to validate what happened in the ring as it happened, and the post-match story was written by the opponent's hirelings. It may well be that Alpha Zero is indeed better than the latest version of Stockfish in fair test conditions. But it is almost criminal to announce very biased test results such as these, thereby rubbishing the work of hundreds of people, in order to gain some PR benefit. What the computer chess community expects is fairness and decency.

The clincher to the above discussion is that three months have passed since Deepmind's bombshell announcement, which made available only ten games from the match. None of the other 90 games have been released for dissection by the experts. AlphaZero might be a better chess engine than Stockfish, but it might also be much worse. If we can't have a match where the Stockfish developers configure their creation for its full strength, let's have the other games from the first match.

27 November 2017

Improve Engine Software - Tablebases

After the previous post in this series on improving my engine infrastructure, Improve Engine Hardware - High Performance, what's next? If I go back to the first post in the series, Improve Engine Software (October 2017), the next bullet is:-

  • Link engine(s) directly to tablebase

Wikipedia gives an overview of the technology in Endgame tablebase. The three evolutions of tablebases to date have been:-

  • Nalimov - six-piece (~2000)
  • Lomonosov - seven-piece (2012)
  • Syzygy - six-piece optimized (2013)

The Houdini 6 User's Manual has two sections covering tablebases. They discuss technical considerations for downloading the tablebases, installing them, and accessing them from the engine.

The same article by Albert Silver that I referenced in the 'High Performance' post, Building the ultimate chess machine (chessbase.com), gives a useful tip on the hardware (certain comments are also relevant):-

The choice of two SSDs for storage as opposed to a single centralized one is deliberate. One SSD should be reserved for the six-piece Syzygy tablebases and not be mixed with the one used for the operating system and databases. It will be consulted non-stop by engines in analysis, and it would be a mistake to place it on a drive that is also being used for other purposes, since it could lead to unnecessary slowdowns.

What's the future of tablebases? Seven-piece Lomonsov technology hasn't yet arrived for the hobbyist, but it can't be too far off. A back-of-the-envelope calculation tells me that there is a difference of (roughly) two orders of magnitude in complexity (x 100) between an n-piece and an n+1-piece tablebase. An eight-piece tablebase will arrive when advances in processing and storage support it. Beyond that, I wouldn't even begin to guess.

28 September 2017

Averbakh's R+P vs. B+P Endgames

For the last day the house wifi has been behaving badly, so for today's post I needed a subject that didn't demand too much online time. My first idea was to return to the Aronian - Dubov game from the fourth round of the just-completed 2017 World Cup in Tbilisi. I discussed the R+P vs. B+P endgame in

I knew I had covered other R+P:B+P endgames in the past, but when exactly? Here's a list:-

That last post ('Magic') discussed a couple of positions from Averbakh's multi-volume set of endgame books, specifically the volume on Rooks vs. minor pieces. The Rook vs. Bishop endgames can be extremely tricky and often contain hidden resources. The following diagrams shows two of Averbakh's first (and simplest) examples.

The top position is a typical example of how a single tempo can be the difference between a win and a draw in an endgame. White to move draws with 1.Rxf2. Black to move wins with 1....Ke2, because after 2.Re8+ Be3 3.Rf8 Bc1 4.Re8+ Kf3 5.Rf8+ Bf4, the Bishop interferes with the Rook's attack on the file.

The bottom position (Mattison 1914) shows the Bishop and the King coordinating to stop the Rook's attack. The key move is 1.Be3+. After 1...Kb7 2.e7 Rxa3, first the Bishop limits the scope of the Rook with 3.Ba7 Ra1. Then the King finishes the job with 4.Kf4 Rf1+ 5.Bf2 Rxf2+ 6.Ke3 Rf1 7.Ke2.

All of Averbakh's examples contain equally surprising moves and deep plans. For more info on his books, see

If I can't get the wifi tamed quickly, I might come back to the subject again.

14 September 2017

A Difficult Tablebase Position

Tablebase (TB) positions make for an interesting class of endgames. While best play in most TB positions is obvious to a good player, some positions defy accurate analysis even for world class players. A recent example is a tiebreak game from the fourth round of the 2017 World Cup, currently being played in Tbilisi, Georgia.

TB games between top players are particularly difficult to annotate. On the one hand, we can't criticize a world class player for not knowing an esoteric endgame which has probably never occurred in his previous experience. On the other hand, we can't pass without comment on positions where one or both players overlook a winning or drawing continuation.

An additional problem is that every single move by either player leads to a new branch of the TB's tree of variations. The TB doesn't explain the winning plan; it just lists moves together with their eventual evaluations. It is the annotator's job to make sense of the moves played and to explain why they work or not.

Another question is how a position compares with similar positions. If we shift a TB position a file to the left or right, or a rank up or down, how does the evaluation change? Similarly, if we leave the Pawn structure the same, but move the Kings (or other pieces) to completely different squares, how then does the evaluation change?

This blog's most recent TB post was Q vs. 2B in TCEC Season 9 Superfinal Followup (December 2016). For this current post, the TB position is R+P vs. B+P, shown below. It helps to know that R vs. B is almost always a draw.


After 47.Rb6-b5(xP)

Here is the PGN for the full game, followed by a brief analysis of the critical positions reached during the game.

[Event "FIDE World Cup 2017"]
[Site "Tbilisi GEO"]
[Date "2017.09.13"]
[Round "4.2"]
[White "Aronian, Levon"]
[Black "Dubov, Daniil"]
[Result "1-0"]
[ECO "D85"]

1.d4 Nf6 2.c4 g6 3.Nf3 Bg7 4.Nc3 d5 5.cxd5 Nxd5 6.e4 Nxc3 7.bxc3 c5 8.Be3 O-O 9.Be2 b6 10.Qd2 cxd4 11.cxd4 Bb7 12.e5 Nc6 13.h4 Qd5 14.h5 Rfd8 15.Rc1 Qa5 16.h6 Bf8 17.e6 f6 18.O-O Qxd2 19.Bxd2 Nxd4 20.Nxd4 Rxd4 21.Be3 Rdd8 22.Bb5 Bd5 23.Bd7 g5 24.f4 Bxh6 25.fxg5 Bg7 26.Bd4 fxg5 27.Bxg7 Kxg7 28.Rf7+ Kg6 29.Rxe7 Rf8 30.Re1 Bxa2 31.Bb5 a6 32.Bd3+ Kf6 33.Rxh7 b5 34.Rh6+ Ke7 35.Rh7+ Kf6 36.e7 Rg8 37.Rh6+ Kf7 38.Rh7+ Kf6 39.Be4 Rae8 40.Rh6+ Kf7 41.Bc6 Bc4 42.Bxe8+ Rxe8 43.Rxa6 Rxe7 44.Rxe7+ Kxe7 45.Kf2 Kf7 46.Rb6 Be6 47.Rxb5 Kf6 48.Kf3 Bf5 49.Rc5 Bd3 50.Ke3 Bf5 51.Kd4 Bb1 52.Rc1 Bg6 53.Rc6+ Kg7 54.Ke5 Bb1 55.Ra6 Bc2 56.Rd6 Kf7 57.Rf6+ Kg7 58.Rf2 Bb1 59.Rb2 Bd3 60.Rd2 Bb1 61.Ke6 Be4 62.Re2 Bd3 63.Rd2 Be4 64.Ke5 Bb1 65.Rd4 Kf7 66.Ra4 Bc2 67.Ra5 Bb1 68.Rc5 Kg6 69.Rc1 Bd3 70.Rd1 Bc2 71.Rd2 Bb1 72.Ke6 Be4 73.g3 Bb1 74.Rb2 Bd3 75.Ke7 Be4 76.Rb6+ Kg7 77.Rb5 Kg6 78.Rb4 Bc2 79.Kf8 Kf6 80.Kg8 Bd3 81.Rd4 Bc2 82.Rd2 Bb1 83.Rf2+ Kg6 84.Rb2 Bd3 85.Rb6+ Kf5 86.Rb4 Kf6 87.Rd4 Bc2 88.Rd2 Bb1 89.Rf2+ Kg6 90.g4 Be4 91.Rd2 Kf6 92.Rb2 Bd3 93.Rb6+ Ke5 94.Kg7 Kf4 95.Rb4+ Be4 96.Rxe4+ Kxe4 97.Kg6 1-0

47.Rxb5: The diagrammed position shows the first TB position reached in the game, where the Pawn capture starts a countdown for the 50-move rule. The TB says, 'Given optimal play on both sides, White will win in 72 moves.' The main variation undoubtedly includes moves that reset the 50-move count.

47...Kf6: The first mistake, giving White a win in 47 moves, which is just inside the 50-move rule. For the next few moves both players find the right plan and make the best moves.

51....Bb1 52.Rc1 Bg6: Both players make a suboptimal move. This is followed by a long sequence of moves which maintain the status quo. White fails to make progress, while Black does not let the position deteriorate prematurely. The TB consistently indicates that White wins in around 30 moves.

73.g3 Bb1: White makes a Pawn move, thereby resetting the 50-move count. Unfortunately for White, the move hands Black a TB draw. Unfortunately for Black, he fails to take advantage of the opportunity and moves into another lost position. The double blunder starts another long sequence where White often lets Black escape with a draw, but Black overlooks the chance and plays into yet another lost position. The right plan for White revolves around a timely g3-g4, while Black needs to prevent this.

92.Rb2 Bd3: White again overlooks the win (the TB says 92.Re2 is the fastest) while Black misses the only move to draw (92...Ke5). After this, White plays accurately to score the win although Black overlooks opportunities to prolong the game for as long as possible.

A discussion of the winning plan in this game and an overview of similar positions in other endgames with R+P vs. B+P would take too much time for a single post. I suppose that someone could even write a book on the subject.

12 December 2016

TCEC Season 9 Superfinal Followup

In last week's post, TCEC Season 9 Superfinal Week 4, I wrote,

Congratulations to the Stockfish team on becoming the defacto, unofficial World Computer Chess Champion.

Now that the event is over, what can be said about the games? I'll leave annotations of complete games to the experts, because I don't know how to start understanding engines that routinely calculate variations to depths of 40 ply. Instead I'll look at the openings where White won both games (all decisive games were won by White) like I did last year in Battering the Gruenfeld (March 2015; TCEC Season 7). The game pairs were:-

  • g.17/18 Sicilian: Dragon, Yugoslav, Main Line, 12.h4 Nc4: 14.h5
  • g.65/66 Slav: Smyslov, 6.e4 Bg4 7.Bxc4 e6
  • g.71/72 French: Classical, Steinitz, 9.Qd2 Nc6 10.dxc5 Qxc5

As documented in TCEC Season 9 Superfinal Week 2, the first game in the list (g.17) has already received attention for the way it was scored.

A Stockfish win in game 17 provoked a genuine controversy. The final position of Queen vs. two Bishops [Q:2B] is shown in the following diagram, Black to move.

The position is shown below in the diagram on the left, which is a tablebase win for White. Instead of continuing a discussion of the controversy, I would rather focus on the position itself. I had always thought that Q:2B was generally a draw, because the two Bishops should be able to prevent the enemy King from getting too close. The diagram on the right shows position 605 (attributed to Lolli, 1763; flipped on the horizontal axis) from Fine's 'Basic Chess Endings', which is a draw. Why is the first diagram a win and the second a draw?

I did some simple manipulations of both positions, moving all pieces up/down a rank or left/right a file. If you move the left position down a rank, so that the Black pieces are on the same squares as in the right position, the game is a draw. If you move the right position up a rank, the game is a win for White. The squares of the White pieces don't seem to matter much, as long as there are no immediate tactics.

If you move either position up/down or left/right an arbitrary number of ranks/files, the position is always a win for White. From this I concluded that the position in BCE 605 forcing a draw is a special case. Black defends successfully because the White King can't get 'behind' the huddled Black pieces, as it can in the position on the left.

You might think it would be a simple matter to go from the left position to the right position by regrouping the Black pieces, especially since the White King is so far away. It turns out that the White Queen can singlehandedly prevent any regrouping. All that Black can do is mark time. When the White King gets close, one of the Bishops is inevitably lost.

I also looked at the final positions of other games that ended by reaching a 'TB position', i.e. terminated by a five-piece tablebase. All of them were draws and none of them was particularly interesting. Most were Bishops of opposite color or Rook against two Pawns, where any good player can foresee the result. More interesting are those three pairs of busted(?) openings that I flagged earlier. I'll tackle those in another post.