# Question
Title: Can black convert a +5.6 game into a draw (assuming both players play optimally)?
This shows a +5.6 winning for white at depth 33 (Stockfish 13+). White does have a bit of material advantage (knight) and black has more pawn islands. Can black convert this into a draw (assuming both players play optimally) or will this necessarily lead to white winning the game?

```
[Title "Game: White to play"]
[FEN "8/2p3pk/2p4p/p2r4/4p1P1/1Pr5/P1PRK1N1/7R w - - 0 1"]

```

# Answer
When a chess engine shows an evaluation of a position, there are typically 3 possible values, all of which are based on the engine's attempt to simulate perfect play for both sides:

(1) **If the engine sees a forced checkmate** \[meaning, when one side plays perfectly, no matter what the other side does, the winning side can checkmate\], **it will indicate how many moves are needed to complete this**. Something like "#3" to indicate checkmate in 3 moves has been calculated. I would expect in all modern engines that this number is 'perfect' - ie: I would tend to assume that if the engine has actually calculated mate like this, then it is not 'missing' any possible tactics or moves that the losing side could do to ultimately prevent checkmate.

(2) **If the engine detects a checkmate or strong advantage on one side, but also finds a forced-stalemate that the 'losing' side could activate, then it will typically indicate as '+0' or similar**, basically saying "there is a draw here, available to the person who should want to use it".

(3) **If the engine cannot explicitly find mate, it will attempt to assign a numerical value to the position**, where a '+1' assigns a slight advantage to white \[about as much as a human would evaluate a 1 pawn advantage\], or where '-5' assigns a large advantage to black \[about as much as a human would evaluate a 1 rook advantage, although you should be aware that far more goes into these numbers than just 'counting pieces', the analogy is given as a frame of reference, only\].

Note that this value provided is only as good as the engine that gives it; an engine that only looks 2 moves ahead might miss that there is a 3-move tactic that loses a queen. More likely, the engine may miss broad-stroke concepts that limit or enhance one side of the board. Notoriously, the most common 'missed elements' that a chess engine has difficulty evaluating is typically where there is something like a 'fortress'; that is, a position where a human might quickly see that no progress is possible due to a locked-in pawn chain \[or similar concept\].

Generally speaking, modern engines are quite good at evaluating positions, and may also be more conservative when projecting high-value numbers. So for a modern engine, I would expect that any '+5' evaluation is quite likely to be a confident number. **Now remember - If the engine could calculate enough moves to find mate, it would tell you - so it doesn't yet know how mate would come, just that there is an incredible strength to one side**.

Of course there are cases where +5.6 additional 'material' wouldn't lead to mate; for example, you can't checkmate a king with only 2 knights on the board, so even if someone were "2 knights up", that would still end in a draw. Depending on what other material is on the board at the endgame, 1 extra pawn might be able to promote and win, whereas 2 minor pieces have no effect.

**So let's try to figure out "how likely" it is that a +5.6 position leads to mate.** Going back to a simplistic assumption that a +5 evaluation means more or less "a rook up", let's consider whether you could win a game if you were a rook down, with no immediately compensating tactics or position. We can consider this by looking at the idea of giving 'piece odds' as a handicap method when players of different strengths play. Based on this answer, it looks like a difference of a knight would be about the same as a 700 ELO rating difference. What is the required Elo to beat a Grandmaster with queen odds?

So if you consider that a 700 ELO rating differential implies that the weaker player has something like a 1% chance to win (per here: https://www.318chess.com/elo.html), if you are a rook's-worth of material worse than your opponent, what is your chance of winning? In this estimation - less than 1%. I offer this merely as a thought-experiment, to again provide a frame of reference for how good a "+5.6" evaluated position would actually be.

**In conclusion, the engine hasn't 100% confirmed that mate exists, but the odds of escaping mate as the losing side are vanishingly small**. The odds of stalemate are perhaps stronger, but that's hard to say. If the computer detected the chance of stalemate it would indicate it as such per 2) above, so this would have to be a stalemate that only becomes visible after many further moves of perfect play, beyond the engine's line of site.
> 13 votes

# Answer
White is a piece up and has a completely winning position. Black could try to create some counterplay profitting from the fact that White's pieces are a bit uncoordinated right now.

But realistically, any decently skilled player should be able to convert this position into a win for White.

Finally, note that there's no threshold for which positions can be won or drawn (otherwise the engine would just output "White wins", "Black wins" or "draw"). There are some won positions that will be evaluated as +0.5, and some drawn ones that the engine will think they're +1.
> 12 votes

# Answer
It's hard to prove with 100% certainty, but White will very likely win with optimal play. An advantage over +5 is way too much. There are some theoretically drawn endgames where Stockfish claims one side has a very large advantage, but this position isn't one of them. There are too many pieces and pawns still on the board, and they are able to move around quite a bit. The game isn't constrained enough to fall in the category of a theoretically drawn endgame that Stockfish cannot assess properly. And even if the game was more simplified, a +5 evaluation should still be assumed as completely winning unless you have strong reasons to think otherwise.

Generally, once you reach an evaluation of roughly +1.5, that's when there are good chances of the game being won with optimal play.
> 5 votes

# Answer
If black has perfect play and white doesn't, black can draw or even win. But if white has perfect play, chanses are low a draw will occur and white will probably win.

Conclusion, probably no draw and white will probably win
> -3 votes

---
Tags: problems, puzzles
---


# Question
Title: Most effective way to achieve a 2000+ rating in one year, starting as a 1600?
I currently play at around a 1600 level, and have stagnated in terms of rating improvements for quite some time.

I have always played chess recreationally, occasionally doing tactics puzzles here and there, but I've never done any professional studying.

I was wondering what the most effective way of improving my rating to 2000+ would be. If there are links to scientific research on the topic, I would appreciate it. Book recommendations would also be great. I'm mostly looking for a discussion about what exercises maximize your return on rating-- opening, tactics, positional understanding, end games, analyzing grand-master games, analyzing your own games, etc.

# Answer
Gaining 400 points in a single year is not a reasonable goal for an adult playing at 1600. To do this, you will need to be +25 against your peers, where a peer is someone with the rating you have at the time the game is played.

That being said, if you're going to try it, the first step is to get an instructor. Your instructor will be able to identify the weakest parts of your game and help you shore those up. Since you want to end up at 2000, I'd recommend an instructor rated no less than 2200.

The maximum return will likely be on tactics. You'll need to be decent at two openings as white and two as black. Know the philosophy behind the openings - don't just memorize the moves.
> 23 votes

# Answer
I think you best shot is to play 200 rated games of G/60 or longer this year and seriously analyzed each game (like imagine if you analyzed each game for 1 hour plus, tried to find similar high level games, tried to find as many different plans in the position, etc) in addition to doing regular tactical exercises on chess.com trainer or some other good site (making sure to have figured out the "twists" before you get to them).

For most people playing / analyzing (not all one, not all the other) is the only practical way to improve. If you don't analyze you cannot really learn, but if you never play you get into a mode where you misjudge how hard positions are to really play.

Source: I improved my rating from 1600 to 2000 between October 2003 and January 2005 while being a full-time college student at a top 10 (the year I joined #1) university.

Caveat: I had never stagnated up until that point and didn't begin playing tournaments until I was already 18 years old. Doing a quick count I played "only" ~150 rated games in that period of time. I did start taking lessons from a strong IM (soon got his GM title) around when I broke 1850. I also had a club at school with a few masters I could regularly look at my games with.
> 17 votes

# Answer
OK, you can try with the best chess trainer, and the best chess trainer's name is Rybka. This is a software engine, of course, although other engine will be OK as well, their Elo in a normal computer is much more than 3000 points so any of them will be OK. But Rybka is the best one.

The method is as follows:

You have to use this as an arcade game, not only for solving questions, I'll try to explain it. When you are in a position, a chess engine can give you a quantitative information about all best possible movements, a very good method is trying to identify every of them, (or at least the best one) before passing to next step. When a person plays a normal game makes a lot of mistakes and doesn't learn about them.

An example... maybe you are in a position and the engine say to you the seven best moves

```
+4.5  .....
+1.2  .....
+1.1  .....
+0.9  .....
+0.8  ....
-0.2  ..
-1.7  .

```

That's important that you have to find the +4.5 without more help of engine, it gives you the information that you have a move to win +4.5 but your work is to find it. Maybe you try and find +0.9, ok, you go back and try again, like a video game, when you solve a level you can pass to the next one. (Well, after two hours working the position if the movement is impossible to find you're allowed to pass.) ;)

A much more nice method is mixing this one with a real game in live and working the position in real time with Rybka's help.
> 11 votes

# Answer
***YES YOU CAN!***

Here is a guy, an adult in his 30's, with a full time job, who gained 700 rating points in 1 year, and will very likely go from a rating of 1000 to 2000 within 18 months. He is not anyone exceptionally talented, and he is not doing anything that anyone else cannot do at home with a few books and cheap computer software. He outlines his training methods in more than enough detail for you to replicate his success. Start with his old blog posts and read them in order if you are interested in replicating his method.

Pawn to Rook 4 Blog:

http://p-r4.blogspot.com/2015/01/year-1-recap-700-points-in-365-days.html

Here is another guy, a chess master, who outlines the training plan he used to become a master, in 12 videos for free. He says that anyone can do what he did, and after watching his videos, I agree.

https://www.youtube.com/playlist?list=PLDghkp2J0\_kr3zoHS3ZNIFzcrAtAhmAfk

Hiring a good coach can accelerate your success if you use him the right way. If your goal is rapid improvement, use the coach in ways that accelerate your training plan. For instance, have the coach analyze your games and provide feedback and recommendations of tasks that will directly result in you eliminating mistakes from your game. If the coach is interested in imposing his own study plan, it's probably too slow for your goal. Find the people who have done this and repeat what they did. Use a coach to accelerate your success, but do not rely on a coach. You have to do the work. You will need to be highly motivated and disciplined. There will be many days when you do not feel like studying or do not have time. Do it anyway.

And don't forget **The Plan**:

* Decide what it is you want
* Write that down
* Make a plan
* And...
* Work on it.
* Every.
* Single.
* Day.

You can do it.
> 8 votes

# Answer
I've never had a coach. A loose record of my progress over 6 years can be found on my chess.com link below.

Here's my answer: At 1600 you still blunder tactically. What's the use of knowing how to mate with two bishops when you are missing the knight fork 2 moves ahead? chesstempo.com offers free tactics training. It did quite a bit for me. The main difference between a 1600 and an 1800 player is that 1800 players blunder less tactically. Try to hit 1700-1800 tactical ranking at chesstempo.com

By 1700 one should know the opening basic principles and be able to play 6-7 opening moves without getting a bad position. A paid chess.com membership ($7/month) comes with video lectures, many of which go over openings (you can also do this with the chesstempo.com gold membership) I have both, but the chess.com video lectures work much better for me. At this stage you just need to know enough so you don't get killed right out of the opening - so that you get a chance to play chess in the middlegame. Once you get to 1800, repost here, I'll try to offer useful further insight.

https://www.chess.com/members/view/ak87

2010 - 2012 1100-1400 - that just happened by itself... 1400-1500 - Tactics training, chesstempo.com, chess.com tactics trainer 1500-1600 - Tactics training, chesstempo.com, chess.com tactics trainer 1600-1700 - Tactics training, chesstempo.com, chess.com tactics trainer

2012-2014 1700-1800 - Tactics training, chesstempo.com, chess.com tactics trainer and being more careful

2014-2015 1800-1900 playing better in the opening, paying more attention to positional considerations and some improvement in tactics. 2016 1900-2000 playing even better in the opening - every move counts, paying more attention to positional considerations and some more improvement in tactics.
> 6 votes

# Answer
First, understand what the levels mean. A 1600 level means that a player can "get by" at the club level. A 2000 rating refers to an expert, or what I call a "near master." Those are two different worlds.

Study master games and learn how masters play, and especially how they think. Get an instructor to help you. You want to get out of the "club" rut and leave your current (1600) "peers" behind. So try not to play like them, but like the master players you are "associating" with (vicariously). You will take some beatings, but you will learn a lot.

One thing that separates top players from the merely good is the end game. As people go higher and higher, the differences in skill become less and less, and the endgame is where the small differences show up. A good grasp of the endgame will help your middle games to, because you will learn what kinds of positions to "aim for," instead of blindly trying to master the game move by move, and opponent by opponent, like some of the other posters advocate.

When you have "arrived" at 2000, you will not be a master, because you won't know all the details. But you should be able to do a pretty good simulation of one, that is someone who will overawe the 1900s and lower.
> 4 votes

# Answer
My IM instructor once told me that reading and mastering the single book "Modern Chess Strategy" by Pachmann was enough to raise my level to 2000. I was rated around 1700 and reached 1996 (FIDE) in a year or so. Obviously I needed help with my ending and he used the excellent endgame book by Shereshevsky.
> 4 votes

# Answer
In spite of the literature that claims anyone can become a Master, I seriously doubt it. There are natural limitations. Not everyone is Capablanca, and no amount of studying/playing will change that. I can attest to that from my own situation. My initial rating in the late 1960's was 1759. I would periodically give up chess from lack of progress but start in again later. In the early 1980's through concerted effort/ study, I did approach 1900 (at 1891) but again stopped due to several life crises (divorce, loss of job and home, death of parents). When my life had stabilized I started in again in the early '90's, but my rating started to slowly sink. Old age and fatigue began to take their toll, and I found I could no longer calculate in depth after several hours of exhausting play, so I gave up the chase in 1995. My final rating - 1759, the same one I started with. Perhaps with expensive training I could have gotten to 2000, but I somehow doubt it. I suppose doubting it would have in and of itself prevented it, since supreme self-confidence is also a requisite, but I'll never know now.
> 3 votes

# Answer
400 Points in a year is pretty tough. I don’t think you should put yourself under unnecessary stress of achieving this goal within one year. Unlike others I don’t think it’s unrealistic to reach a 2000+ rating with a less stringent dead-line. A good coach would of course be great. I don’t know how easy it is to find a suitable coach though. I would recommend studying Nimzovich’s Chess Praxis, and reading some of Silman’s books especially “How to reassess your chess”.

Signing up at chess.com and watching instructional videos combined with using their chessmentor and tactics trainer should also be helpful.

Also aim to play a reasonable number of games and analyze them. Ideally with a stronger player from your club.
> 2 votes

# Answer
Well first off, if you have a lot of money to invest in a GM instructor you can surely go above 1600, but if you don't: don't let rating and score interfere. Starting a game and thinking about victory is not smart at all. Focus on your game-play instead.My friend (IM 2470) always says chess is 50% skill and 50% psychology. I see people here saying tactics, I'm going to tell you right away that is incorrect. For a decent 2000+ player you should work on all of your components:

-**Have 2 openings with white and two with black** \- why? Because when you reach a certain level it's great to have a backup opening because your opponents will obviously prepare against you, and it's quite bad if you don't use the fact that you're white, just because your opponent has prepared for your always-the-same repertoire.

-**Tactics**-obviously an extremely important component, but, the point of working on your tactics is to **remember different motives**: you obviously won't have exact copies of the problems in your games, so motives are the ones who can help you greatly. That's why you need to use good tactics books with realistic problems, the ones that actually came from games.

-Work on what you're **good** at: many people say analyzing your games and looking for mistakes is smart, but, my short timed chess instructor taught me that you have to excel at a point in chess. E.g. if you're a positional player work on that! Make it even stronger!

-**Discipline** \- every.single.day. if you just once say "I will skip today, but tomorrow I'll do double" it's all over, cause you're going to keep saying that again and again.

-**Don't be picky with books**\- essentially any good recommended books will work, don't be like "I don't like this one so I won't do it."

-**Work on all points of chess**\- for openings learn the plans and the **moves** (you won't figure them out by playing a lot, you have to learn them and then see if you can remember in-game), for endgames get a good books (I'd recommend Reuben Fine) and for middlegame- find a grandmaster who plays similarly to you(same openings, same style of play)- and **analyze** his/her games, I don't mean as in just go through them, but analyze them, figure out what each and every move is there for. :)
> 2 votes

# Answer
#### Study as if you were taking a university course.

Choose a **lecture series**. I recommend Naroditsky's (first) speedrun! 1

Apply various learning techniques while watching the "lecture" videos:

* Watch one lecture video each day.
* **Pause and guess** what move the instructor will play (especially in critical sections), and try to explain your reasons for the move.
* **Rewatch** a video after some time interval (e.g. a week) and see if you can predict the moves the instructor will play, and with what reasoning. Bonus points if you apply the principle of **spaced repetition** and repeat the video after a longer time interval (e.g. a month).
* **Practice the concepts** you learn from each video with a few games of your own, either against a human, or a (difficulty adjusted) computer from a particular type of position. Only watch the next video after you have successfully applied a concept.
* **Take notes.** Perhaps create a lichess study and create a chapter for each important example/concept that you think would improve your chess.

Don't stop practicing your tactics, reviewing your basic opening repertoire (listudy), analyzing your games (**with *your own* annotations!**), and creating your own opening studies on your favorite openings/repertoire.

In total, you should be "studying" chess for an hour or two every day. Try not to "waste" too much time doing what you know doesn't work (e.g. playing a bunch of bullet games with no *learning* purpose in mind). It's OK to do that if it keeps you motivated and interested, but know that it does not really contribute to your learning.

---

1 That's how I went 1500-\>1900 on lichess within a few months. The specific choice of learning material can be different, but I recommend these videos since they are a great format and cover a wide breadth of practical real-time decision making concepts.
> 1 votes

# Answer
1600 to 2000? Although hard, it is possible IMHO. Especially if you're still young.

I am just below 2000; I always performed better after solving a bunch of tactical problems. I think TACTICS is the most important component to get you to your goal! For example, you may solve daily puzzles at chess.com

As you are getting stronger, other things like strategy, opening prep and endgame become more important.

Consistent work is important, do not have very long breaks. Better 30 min every day than 3.5 hours once a week. Although it may take more than 30 min/day to progress this quickly.

Definitely, review your own games and try to find common mistakes. Having someone stronger review your games will help, too. Having a coach of course helps but it better be a good one (if you can afford it).
> 0 votes

# Answer
To get something you really want, which in this case is to be rated over 2000, you need to work harder than everyone else is, or at least work harder than you normally do. Currently, I'm a 1750 player, and I got that rating in only four months since I was a 1600 player
> -1 votes

---
Tags: learning, tactics, rating
---


# Question
Title: How does black proceed in the following position?
Shown below is a game I have been trying to solve, Black has been better for the whole game but resigns at the end. On checking the analysis stockfish says black is still better

```
[Event "Hourly Blitz Arena"]
[Site "https://lichess.org/RS8OKA3q"]
[Date "2021.06.09"]
[White "okotieno"]
[Black "Kryptonopolis"]
[Result "1-0"]
[UTCDate "2021.06.09"]
[UTCTime "15:28:08"]
[WhiteElo "2018"]
[BlackElo "2363"]
[WhiteRatingDiff "+11"]
[BlackRatingDiff "-10"]
[Variant "Standard"]
[TimeControl "300+0"]
[ECO "B21"]
[Opening "Sicilian Defense: McDonnell Attack"]
[Termination "Normal"]
[Annotator "lichess.org"]
[FEN ""]

1. e4 c5 2. f4 { B21 Sicilian Defense: McDonnell Attack } d5 3. e5?! { (-0.07 → -0.59) Inaccuracy. exd5 was best. } (3. exd5 Nf6 4. Nc3 Nxd5 5. Nxd5 Qxd5 6. Qf3 Qe6+ 7. Qe3 Nc6) 3... Nc6 4. Bb5 Bd7 5. Bxc6 Bxc6 6. d3?! { (-0.62 → -1.17) Inaccuracy. d4 was best. } (6. d4 Nh6 7. Nf3 e6 8. c3 Nf5 9. O-O cxd4 10. cxd4 Bb5) 6... d4 7. Nf3 Nh6 8. Nbd2 e6 9. Ne4 Be7 10. h3?! { (-0.63 → -1.44) Inaccuracy. Qe2 was best. } (10. Qe2) 10... O-O? { (-1.44 → -0.04) Mistake. f5 was best. } (10... f5) 11. g4 Qd5 12. Kf2 c4?! { (-0.76 → 0.01) Inaccuracy. f6 was best. } (12... f6 13. exf6) 13. g5?? { (0.01 → -2.34) Blunder. Re1 was best. } (13. Re1 Rac8) 13... Nf5 14. Rg1 Kh8 15. Qf1 Rac8 16. Bd2?! { (-2.69 → -3.52) Inaccuracy. Qe2 was best. } (16. Qe2 Rfd8 17. h4 cxd3 18. cxd3 Qb5 19. Rd1 Bxe4 20. Qxe4 Rc2+ 21. Rd2 Rdc8 22. h5 g6) 16... cxd3?! { (-3.52 → -2.75) Inaccuracy. b5 was best. } (16... b5 17. Qe2 c3 18. bxc3 dxc3 19. Be3 b4 20. h4 Rfd8 21. h5 a5 22. h6 g6 23. Nf6) 17. cxd3 Bb5 18. Rc1?! { (-2.30 → -3.39) Inaccuracy. a4 was best. } (18. a4 Ba6 19. b4 b6 20. Qe2 Rc2 21. Rgb1 Rfc8 22. Ne1 R2c7 23. a5 Bb7 24. b5 g6) 18... Qxa2 19. Rxc8?! { (-3.01 → -3.78) Inaccuracy. Ng3 was best. } (19. Ng3) 19... Rxc8 20. Bc1? { (-3.78 → -7.51) Mistake. Ng3 was best. } (20. Ng3 Nxg3) 20... Rc2+ 21. Nfd2 Qa6 22. Nf6 Bxd3 23. Qg2 Qc6 24. Qg4 Rxc1 25. Qh5 Bxf6 26. Qxf7 { Black resigns. } 1-0

```

How should black continue to prevent the checkmate on the backrank?

# Answer
White threatens 27. Qf8#. Black has several ways to stop the immediate mate, so let's look at them:

1. 26...Qc8? 27. Rxc1 Qg8 (27...Qxc1? 28. Qf8#) 28. Qxg8+ Kxg8 29. gxf6 gives back a decisive amount of material.
2. 26...Qc5? 27. Qe8+ forces mate.
3. 26...Be7 27. Rxc1 Qd7 leaves Black with a still-comfortable material advantage.
4. 26...Rf1+ is a variant of the above idea. After 27. Nxf1 or Rxf1 Black plays 27...Be7 and maintains a still-comfortable material advantage.
5. 26...h6? 27. Qf8+ Kh7 28. g6#
6. 26...h5? 27. Qf8+ Kh7 28. g6+ Kh6 29. Qh8#
7. 26...Nh6 27. gxh6 Bh4+ is the computer's main line. 28. Rg3 (only legal move) Bxg3+ 29. Kxg3 Rg1+ 30. Kh4 Qc8 leaves Black up more than a decisive amount of material.

The last line is admittedly somewhat difficult to spot, but 26...Be7 is still winning.
> 16 votes

---
Tags: analysis
---


# Question
Title: Where does Leela Zero stand (in terms of ELO / strength) when compared with other AI like Mu Zero / Alpha Zero?
I can break my puzzle down into the following:

* How strong is Leela Zero today in terms of rating / strength, esp when compared with Alpha Zero / Mu Zero?
* Does its rating get calculated as it continuously trains?
* Will there be matches between Leela Zero and the other AI to derive a reliable rating?

# Answer
We can't compare Leela vs. AlphaZero or MuZero, because they are private engines. That means we can't just get them to play tens of thousands of games against each other (which is the standard way of telling how strong each engine is). However, if AlphaZero has not improved since it was unveiled, Leela is likely to be stronger than it. The same goes for MuZero, since MuZero only got as strong as AlphaZero. The reasoning is the same as my answer to this question.

Leela has a self-play elo as it trains. You can see its progress here.

Leela already plays lots of games against other chess engines. You can watch its tournament games here, see its tournament results on Wikipedia, and see its position in rating lists such as CCRL and SP-CC.de. Caveat: if you are *really* interested in how "good" Leela is at chess, be sure to check out what the hardware used is.
> 3 votes

# Answer
> How strong is Leela Zero today in terms of rating / strength, esp when compared with Alpha Zero / Mu Zero?

We will never know for sure because we don't have the source code for AlphaZero/MuZero. However, it's very likely Leela Zero is a stronger version because it is an evolving project. Open source for the best AI programmers in the world, not just internally to Google.

> Will there be matches between Leela Zero and the other AI to derive a reliable rating?

A lot of computer tournaments are running. Check TCEC, CCRL etc. You could run your own tournament easily, it's free and open source!
> 3 votes

---
Tags: engines, rating
---


# Question
Title: What is the difference between an opening and a defence?
I would like to know why some openings are called "defences" and other all called "openings." What is the difference?

# Answer
> 7 votes
"The opening", in general, is the first phase of a game of chess, in which both sides develop their pieces. It is followed by "the middlegame" and, if the game gets that far, "the endgame".

When people talk about "an opening", they are referring to a particular series of opening moves that has a name. For example, 1.d4 d5 2.c4 e6 is the Queen's Gambit Declined, and 1.d4 d5 2.c4 dxc4 is the Queen's Gambit Accepted.

Openings that are defined by the moves that Black makes are often called "defenses", since White is generally considered the attacker and Black the defender by default. For example, 1.e4 c5 is the Sicilian Defense and 1.e4 e6 is the French Defense.

# Answer
> 2 votes
A "defense" is a subset of an "opening." It is a system for Black against standard opening moves such as d4 or e4. Examples are the French Defense (e6) and Sicilian Defense (c5), in response to e4, where Black actively tries to take the initiative away from White.

Other "openings" are named from White's point of view, such as Ruy Lopez (following e4) or the Colle System (following d4). These are systems where Black more or less follows White's lead instead of making an "active" defense like the ones mentioned above.

# Answer
> 2 votes
The difference is whose move defined the opening.

If, after 1. e4, black responds with e6, the opening is defined as a French Defense. If, after 1. e4 e5, white plays Bc4, the opening is defined as the Bishop's Opening. However the most common openings, such as the Queen's Gambit, aren't considered either an opening or a defense. (Note: The Sicilian Defense breaks this rule, but it's variations are often so well known that we refer to them as the opening name instead of a variation. Most people call it the Najdorf, but the Morphy variation of the Ruy Lopez would be a rarity.)

---
Tags: opening
---


# Question
Title: Material vs positional advantage: does Stockfish give good advice?
This is from Yusupov's "Build up your chess" volume 1, chapter 11 (pins).

```
[Event "Munich"]
[Site "Build Up Your Chess"]
[Date "1994"]
[Round "Diagram 11.4"]
[White "A.Yusupov"]
[Black "P.Nikolic"]
[Result "1-0"]
[FEN "8/2r2kpp/2N1p3/5p2/b3B3/4P2P/1R3PP1/6K1 w - - 1 2"]

2.Bf3
    ( 2.Rb6 fxe4 {Not actually the best defence according to Stockfish} 3.Nd8+ )
2...Bxc6 {In the actual game, black played ...Rxc6 here} 3.Rc2 1-0

```
* Option 1 (Yusupov's recommendation): Bf3 and white is a piece up.
* Option 2: Rb6 and white can win a pawn.

Who wouldn't prefer being a whole piece up? Stockfish! It looks like both options win the game (approx +5 for white), but Stockfish seems to have a mild preference for option 2.

Is there a valuable lesson in here, or is it a "computer strategy" that humans shouldn't try to imitate?

# Answer
It might be not even as simple as the other answer suggests (regarding only objective evaluation), as "both lines are (roughly) equal" is probably already from a certain perspective. Let's view it specifically from the computer and the human eye and that we want to win the game. I outline only the central points.

* Computer, Variant 1: "I'm an exchange up, Black will put up a hell of a resistance, I have to penetrate with my king through four pawns, might be annoying."
* Computer, Variant 2: "I mop up the two e-pawns and then comfortably waltz my majority to promotion. Whatchamean, human patzer, my Nd8 is endangered? Can't calculate 20 moves in advance?"
* Human, Variant 1: "Black hasn't the least counterplay. It takes time to crack the fortress but I can play by my buttocks."
* Human, Variant 2: "My Nd8! His figures molesting my hinterland! No thanks!"

Since Yusupow probably didn't write his book for use by a computer, I tend to follow his advice.
> 9 votes

# Answer
It's not so simple. 1. Bf3 leads to a position where White is up an exchange. 1. Rb6 leads to a position where White is up two pawns. Both are worth roughly the same in terms of material. Look at the lines carefully:

* After 1. Bf3, Black does not have to play Bxc6. 1...Rxc6 2. Bxc6 Bxc6 -- White is up an exchange.
* After 1. Rb6 fxe4 2. Nd8+ K-wherever 3. Rxe6 followed by 4. Rxe4 leaves White up two pawns.

You might think in the second line Black can play 2...Ke7, but then after 3. Nxe6 Black still has too many weak pawns (e4, g7) to defend.

Of course as a human the exchange-up position after 1. Bf3 is much easier to play than the two-pawn-up position after 1. Rb6. Black has completely no counterplay, White is up a safe amount of material in a simple position, and can almost play on autopilot. But still: objectively, both lines are equally good.
> 8 votes

# Answer
Stockfish just tells you that both moves win. The exact evaluation is irrelevant; if you increase the depth, I'm sure the evaluation will go up.

There is really no need to overthink this. For example, if you're up two pieces, it might be a good idea to give up one but make sure the opponent has no counterplay, as opposed to keeping both and allow a few checks. Stockfish might not do it, but it will show that both moves win, just like here.
> 2 votes

---
Tags: engines, positional-play, material
---


# Question
Title: Tools specifically for training at finding loose pieces?
There are of course lots of tactical trainers out there, but I'm wonder if there are any that focus solely on the basic skill of spotting loose or hanging pieces. It is of course a trivial exercise when given enough time: one could just look at each piece in turn and see if it's being attacked/defended. Under time pressure, it's a different story: I often lose under time trouble not even due to a tactic but due to leaving a piece simply hanging.

I'm amazed that when I show a position to an expert, within a fraction of a second they have already spotted all the loose and hanging pieces, whereas I might take at least several seconds to do the same, and sometimes even miss some!

What I'm envisioning is something that shows a position and says "click on all the loose pieces" and the goal is to solve as many of these as possible within a certain amount of time. In other words, something like the Lichess coordinate training tool (https://lichess.org/training/coordinate) but for loose pieces instead of coordinates.

# Answer
> 4 votes
I don't know of any such tool. A paid membership at ChessTempo might allow you to filter problems for the hanging piece motif. Not exactly the type of tool you imagine, but something comparable.

However I would argue against the usefulness of a tool that you describe for the following reason.

If I play chess (and I presume most other players beyond beginner level as well), I do not scan the board after every move for attacked pieces, which is what you are trying to train.

Instead I ask myself: "**What did the last move change with regard to attacked pieces?** There are only a few things that change if you move a piece:

* the piece will *attack new squares* from its new position
* the piece will *stop attacking some squares* that it used to attack on its old position
* moving the piece can *open lines/diagonals* for other pieces to attack something
* moving the piece can *block lines/diagonals* for other pieces

Of course, a move can also interrupt you from defending a piece or can create all kinds of multi-move tactics. You don't need to learn a new way of thinking to include these, as you advance in chess: just rephrase/generalize the question to: "What did the last move change with regard to the position?" Anyway, for the time being let's stick with attacked pieces which is what your question is about.

If you look a bit more careful you will soon recognize some features of chess pieces which make answering the question easier. For instance if you move a rook horizontally, it will still attack squares along the line that you moved it, however all the squares that it attacked vertically change. Similarly for the bishop: if you move it along one diagonal, it will essentially only change things along the other (perpendicular) diagonals.

Also, you can take into account the range of pieces to quickly assess whether something is getting attacked. For instance pawns are very short range and it is very easy to see whether they attack anything. Similarly if your opponent does some moving around far away from any action, behind his pawn chain (e.g. castling), chances are that this does not attack anything new.

So my recommendation would be to go with an **incremental approach**, storing the attacked pieces (later you will add all possible tactics/strategies) in your memory and update your memory after every move.

# Answer
> 2 votes
There is a web site with this type of training: https://tailuge.github.io/chess-o-tron/

Click on "Loose pieces" in right menu.

# Answer
> 2 votes
Lichess puzzle theme includes hanging pieces, link below:
https://lichess.org/training/hangingPiece

One can access other motifs / themes using the following:
https://lichess.org/training/themes

# Answer
> 1 votes
Years ago in correspondence chess games, I used to write down with a negative value the pieces that attack mine and with a positive value, that of the pieces that defended it. Two open source programs identify the boxes under attack and with colors, differentiate those that are equally defended from those at risk. These are SCID and Arena.

# Answer
> 0 votes
I know this is quite old, but I'm building a tool that can be used to train for that. It should be out in a couple of days. If you want to talk about it, you can join my discord server: https://discord.gg/7hZwq9j

---
Tags: tactics, beginner, training
---


title: How do Stockfish levels work?

text:
# Question
Title: How do Stockfish levels work?
I read on some Lichess forum that Stockfish levels use limited computation time and search depth for lower levels. However, it seems like Stockfish also every so often inputs mistakes and blunders, because it makes some blunders a human, even a beginner, would almost certainly not make. So how are levels implemented?

# Answer
Since I could not find any complete explanation, I followed the eternal advice "Use the source, Luke". The Stockfish authors did a great job because their code is easily followable and commented. Relevant parts from `search.cpp`:

```
  // If skill level is enabled, swap best PV line with the sub-optimal one
  if (skill.enabled())
      std::swap(rootMoves[0], *std::find(rootMoves.begin(), rootMoves.end(),
                skill.best ? skill.best : skill.pick_best(multiPV)));

```

```
      // If skill level is enabled and time is up, pick a sub-optimal best move
      if (skill.enabled() && skill.time_to_pick(rootDepth))
          skill.pick_best(multiPV);

```

And this is the full algorithm used. Here's a summary: the algorithm considers the top-k moves, where k is `multiPV`, an option chosen by the user and set to at least 4 in the code. `delta` is computed as the score difference between the best move, ordered first, and the kth best move, however this difference is capped at the value of a pawn to ensure it is not too large. Then, each move is strengthened (has its score increased) by an amount depending on weakness and a random scaling of `delta`, with `% weakness` limiting how much effect `delta` has. If there are many good moves, `delta` will be small, so each move receives a smaller score push. The algorithm finally chooses the strongest move after these score perturbations.

```
  // When playing with strength handicap, choose best move among a set of RootMoves
  // using a statistical rule dependent on 'level'. Idea by Heinz van Saanen.

  Move Skill::pick_best(size_t multiPV) {

    const RootMoves& rootMoves = Threads.main()->rootMoves;
    static PRNG rng(now()); // PRNG sequence should be non-deterministic

    // RootMoves are already sorted by score in descending order
    Value topScore = rootMoves[0].score;
    int delta = std::min(topScore - rootMoves[multiPV - 1].score, PawnValueMg);
    int weakness = 120 - 2 * level;
    int maxScore = -VALUE_INFINITE;

    // Choose best move. For each move score we add two terms, both dependent on
    // weakness. One is deterministic and bigger for weaker levels, and one is
    // random. Then we choose the move with the resulting highest score.
    for (size_t i = 0; i < multiPV; ++i)
    {
        // This is our magic formula
        int push = (  weakness * int(topScore - rootMoves[i].score)
                    + delta * (rng.rand<unsigned>() % weakness)) / 128;

        if (rootMoves[i].score + push >= maxScore)
        {
            maxScore = rootMoves[i].score + push;
            best = rootMoves[i].pv[0];
        }
    }

    return best;
  }

```
> 10 votes

---
Tags: stockfish, blunder
---


# Question
Title: Which chess website with the most correct online rating?
I recently switched from chess.com to lichess.org. This was because I enjoy live chess more and it seems like can find more live chess on Lichess while it chess.com keeps you waiting. Chess.com searches for who they think is your perfect opponent whereas Lichess lets you play whoever you want.

However, I’ve noticed that Lichess gives more points to the winner and takes away more points from the losers, and I mean much more. I don't know if I'm correct though, but I think I am. Lichess also gives youn a higher starting rating.

If I'm right, then which online chess website gives the most realistic chess rating to its users?

# Answer
> 11 votes
How do you define *realistic* for chess ratings? Actually, they are all realistic. Ratings should be considered inside their own population because your rating in server X is your performance relative to other players in the same server. As it depends the population you shouldn't compare one rating to another rating in another server. But if you really want to compare your rating to another population **approximately**, please see this method: How does Chesscube.com rating compare to USCF and FIDE ratings?

All chess rating systems follow almost same rules, but they have different *converging speeds*. This is what you explained in your question, one server gives less on win and takes less on loss, another one gives/takes more etc.

There is a thing, K-factor, in USCF rating system for example, to tweak this converging speed from game to game. Please see this topic: What does "half-K" mean in the USCF tournament rating system?

When you enter a rating population as a new player, you start with average rating of that population(generally). But it doesn't matter which rating you start with, even if you start from 3000, you will converge to your real rating as you play games. So, it's not about being realistic again.

And generally for all rating systems, your first 8 to 20 games will have super high converging speeds, to approximate your rating faster. After that, converging speeds drops to normal and ratings get stabilized.

So, shortly, your ratings will be different in different populations, and it's totally normal.

# Answer
> 9 votes
My Lichess blitz rating is very close to my FIDE classical rating. But is that *correct*?

The FIDE rating is based on slow (six hour), over the board games, in my case usually in team matches, one per match weekend, where I make sure I am well rested and then try to play to the best of my abilities. For instance, if I suspect a trade to a better endgame is available, I will calculate it and go for it.

On the other hand my online blitz games are purely for fun, with a glass of whisky at the end of the day when I am dead tired. I play the first move I think of with major preference for just throwing stuff at his king and flashy sacrifices. I avoid all endgames as they're boring.

It seems more coincedence than correctness.

# Answer
> 5 votes
Well, assuming that you define a 'correct rating' by a FIDE rating, I'd say that chess.com is up there, although not necessarily for the bullet pool. However, for the slow time control pool, chess.com is extremely similar to FIDE and maybe even more similar to USCF. On chess.com, you start at 1200 which is quite similar to an average scholastic rating. Furthermore, lots of cheaters on chess.com deflate the ratings a little bit.

P.s. lichess.org is extremely inflated. 1800 FIDE basically equates to around 2250 on lichess (classical time control). On the other hand, 1800 FIDE equates to around 1850 on chess.com (again, classical time control).

Did I approach your question right?

# Answer
> 3 votes
You should understand what your rating really is: A rough approximation of your recent performance against other players in the same rating pool. What's good on one server might stink on another, and *none of it matters*.

# Answer
> 2 votes
Like other answers, let's assume FIDE rating is the baseline for comparison. This is reasonable as it's widely understood by chess players; for example it's what titles like FM, IM, and GM are based on.

Then it is very much possible to compare a player's strength across multiple sites and see which matches the baseline the closest. This comes with some assumptions, like assumptions that online chess performance matches OTB performance and performance across time controls, which appear decently reasonable.

A fairly recent new site lets you compare directly with a graph: https://www.chessratingcomparison.com/Graphs

According to https://chessgoals.com/rating-comparison/, which is based on the player data from their database, chess.com does a fairly accurate mapping:

> The Chess.com ratings map pretty closely to USCF and FIDE ratings overall. You can use it generally as a quick mapping to your USCF rating. USCF ratings start at 100, and the Chess.com equivalent is slightly under 500. Between 100 and 1750, the 400-point gap shrinks as the ratings go higher. Above 1750 we see Chess.com ratings are higher than OTB on average. FIDE ratings follow a similar distribution to the USCF ratings. Fewer OTB during the pandemic has not impacted Chess.com to over-the-board comparisons.
>
> Typical bullet ratings on Chess.com are slightly lower than blitz ratings. Rapid ratings start higher than blitz ratings, with a breakeven point around 1900 when blitz ratings begin to be higher. This table also accounts for the change that Chess.com made to move 10+0 games to the rapid category. Chess.com to chess.com ratings have about 7000 data points, USCF 1500 data points, and FIDE 1900 data points. See the complete data below.

**Update as of Dec 2021**: The page also confirms common knowledge that Lichess ratings have gotten very inflated at lower ratings, and the discrepancy gets smaller for higher ratings, since Lichess's rating system starts users off at a very high starting rating of 1500.

> We have also analyzed how lichess.org ratings map to OTB ratings. We combined the first two tables to create the lichess vs. OTB comparison. Lichess.org ratings are generally higher than OTB ratings, and the separation increased in 2021. If you have a lichess rapid rating of 1800, don’t expect to score an 1800 performance at your first FIDE event. Your rating will map to roughly 1420 FIDE or 1270 USCF. The complete data set is below, which maps all lichess ratings to their OTB averages across our survey results.

In particular, a Lichess rapid rating of 1800 corresponds to only FIDE 1420 rating, Lichess rapid 2000 is about FIDE 1660, and Lichess rapid 2400 is about FIDE 2300.

The details of their calculations are here https://chessgoals.com/rating-comparison-explained/

To compare Lichess and chess.com, my rule of thumb is Lichess is roughly 300 points higher than chess.com, give or take 100 points. The hand-wavy explanation is that chess.com starts unrated players at 1200 and Lichess starts at 1500.

# Answer
> -1 votes
Opinion and subjective.

There is no way to tell unless you provide a very detailed description of how you would evaluate each site.

And no rating system is that accurate even if all the players were consistent and no beginners were improving to further disrupt things.

Even if it could be accurate no system would have enough games from enough people to be accurate except in small groups that have many common opponents. That is why when a hotshot from moosejaw or podunk goes to the big city to play in a tournament they get creamed by lower rated players because theirs had inadequate range of competition to be valid.

---
Tags: rating, online-chess, lichess, chess.com
---


# Question
Title: Most Dynamic Continuation for White in the Reti Advance variation (1. Nf3 d5 2. c4 d4)
I have been playing the reti with 1NF3 2C4 for the past 1 month and want to find a dynamic response to the advance variation (...2 d4) as the engine considers it to be the most critical try for black

# Answer
> 3 votes
A good try for a dynamic game is 3.e3, against which Black has two main replies: 3...c5 and 3...Nc6. Against 3...c5 you could opt for either 4.exd4 or 4.b4, being a tempo up in the Modern Benoni or Blumenfeld gambit respectively. Both of these openings are known to be quite dynamic, so if you're ahead an extra tempo it can only help you.

In the case of 3...Nc6, the main line goes 4.exd4 Nxd4 5.Nxd4 Qxd4. The position is around equal - White is a bit cramped and the d-pawn could end up being backward, but Black will have to spend a bit of time moving the queen around. If this isn't to your taste, then after 3...Nc6 you could instead go for 4.b4!? dxe3 5.fxe3 Nxb4 6.Nc3, with some compensation for the sacrificed pawn. Further study will be required here to understand how to best develop and make use of your compensation for attacking.

On the third move instead of 3.e3, you could also consider 3.b4. White enables the bishop to go to b2 and attack the d4-pawn. The b4-pawn also puts itself in a position where it could attack Black's knight arriving on c6, while at the same time monitoring the c5-square. However, I don't think 3.b4 is quite as dynamic as 3.e3, as you're not immediately putting pressure on the d4-pawn -- this gives Black the freedom to choose from a number of continuations, such as 3...f6 4.e3 e5. So while 3.b4 is definitely not any worse from an objective standpoint, for the sake of learning less theory while also getting a dynamic game, I'd recommend 3.e3.

---
Tags: opening
---


# Question
Title: How can white gain a slight advantage in this position? (puzzle for beginners)
Try solving the following puzzle (for beginners), where it is white to move and gain a slight advantage, despite being a queen down for a bishop:

```
[FEN "2k1r3/pp6/n5q1/1N3p2/8/3B4/5PPP/5RK1 w - - 0 1"]

```

# Answer
> 13 votes
```
[FEN "2k1r3/pp6/n5q1/1N3p2/8/3B4/5PPP/5RK1 w - - 0 1"]

1. Bxf5 Qxf5 2. Nd6

```

and a cute family fork wins the queen. White is up a pawn.

---
Tags: beginner, puzzles
---


# Question
Title: Would there be more decisive games if we began to see stalemates as checkmates? And hence more "interesting" chess?
I think it is up for debate as to whether a stalemate should be a win or a draw. I agree stalemates make beginner chess more interesting but we rarely see games at international level end in stalemate. I guess viewing stalemates as a win would create more decisive games as even a 1 pawn advantage in the endgame can be converted into a win as the defender loses the advantage of themes like opposition. I also believe the value of pawns in the endgame will be higher compared to that of present day chess giving rise to less materialistic games and interesting piece sacrifices for better pawn advantages.

So my final question would be would chess be more interesting if we saw stalemates as checkmates

# Answer
> 13 votes
There are already many good answers here that address your question from a hypothetical point of view. I want to add to this discussion some empirical data coming from AI chess, based on the arXiv preprint *Assessing Game Balance with AlphaZero: Exploring Alternative Rule Sets in Chess* (2020) by Nenad Tomašev, Ulrich Paquet, Demis Hassabis and Vladimir Kramnik (link: https://arxiv.org/abs/2009.04374). The first three authors are from Google's DeepMind team that developed the AlphaZero chess engine, and Vldimir Kramnik is of course a former chess world champion.

The paper arose from a similar question: what chess would look like without castling, and whether this would lead to more interseting and/or decisive games. Since the AlphaZero chess engine is entirely based on self-learning, it can easily be used to address such questions: simply change the rule set in the program, and let it train against itself. After enough training, it will out-perform any human player on that chess variant.

The team uses this approach to compare classical chess with nine variants, including the variant where forcing stalemate is a win. As you can see in the paper, they analyse each variation in quite some depth. Your question about decisiveness of games under this rule change is addressed in Figure 2: in 10,000 games at 1 second per move, 10% ended in white victory and 86% in a draw, compared to 7.8% and 88% respecively for classical chess. In 1,000 games at 1 minute per move, 2.5% resulted in a victory for white and 97% in draw (classical: 1.8% and 98% respecively). So indeed, your proposed rule change leads to slightly more decisive games, but the difference is quite small.

Of course, this is computer chess, and human chess might be different.

# Answer
> 23 votes
Absolutely not. Making stalemate a win would be a sure way to make for less interesting chess. Any rule change which makes it easier to convert a small material advantage to a win, will ipso facto make it less attractive to sacrifice material for attacking chances. One of the things that makes gambits playable is the fact that, if the attack fails, the gambiteer still has chances to draw a pawn-down endgame. Your proposed change to the stalemate rule would result in more grubby materialistic chess.

# Answer
> 15 votes
The game would definitely become way less interesting, as many endgames that offer a chance to keep fighting would become hopeless.

There would be more games that end in a win (so yes, more decisive games), but not necessarely more attacks, as those hardly ever end in a stalemate. It's hard to make a valid prediction without trying it out, but it's reasonable to say that openings and middlegames would be quite similar to those we see today, only with most endgames being either a dead draw or an easy-ish win.

# Answer
> 7 votes
More decisive games? Certainly.

But that does make it a better game? (I.E. is it a satisfactory solution to the problem of high drawrate?) Stalemates can occur in positions which are not vastly advantageous endgames but more or less equal, just like checkmates can. But the point of chess is to look for checkmates. Having to watch out for stalemates in the same way would be regarded a perversion of the original game by many of its players, since there is really little in common between a stalemate (which precludes a check) and a checkmate (which necessitates a check).

In other words, the problem with the proposition isn't that it necessarily makes the game fundamentally less interesting to have two possible win conditions (checkmate or stalemate) but just fundamentally very different, since stalemate and checkmate are very independent. So the variant you suggest is less like standard chess and more like e.g., 3-Check or King of the Hill, both of which can be won by checkmate *or* with an alternative win condition (three checks / King on e4, d4, e5 or d5).

# Answer
> 7 votes
If stalemates were wins chess would be simpler and therefore less interesting to me. Many tense struggles would become simple wins. Many "study-like" endings would become trivial.

Would these be replaced with more hard-fought middle games? Perhaps. bailing out to drawn ending would be less common I suppose.

Endings and Transition to endings are my favorite part of Chess. I find bailing out to a drawn ending a wonderful feature of Chess.

Here is one of my favorite games. A hard fought messy game full of errors where I managed to draw. I do not want a chess that does not include this game.

```
[White "NN"]
[Black "Me"]
[Result "1/2-1/2"]
[ECO "A50"]
[ECOUrl "https://www.chess.com/openings/Indian-Game-2.c4"]
[Termination "Game drawn by agreement"]
[Link "https://www.chess.com/game/daily/89899147"]
[FEN ""]

1. c4 Nf6 2. d4 g6 3. Nc3 Bg7 4. e4 d6 5. Nf3 O-O 6. Be2 e5 7. d5 a5 8. h3 Na6 9. Bg5 h6 10. Be3 Nh5 11. Qd2 Nf4 12. Bxf4 exf4 13. Qxf4 Nc5 14. O-O-O Re8 15.Nd4 Bf6 16. h4 g5 17. Qe3 gxh4 18. g3 Qe7 19. gxh4 Bg7 20. Rdg1 Kh8 21. Bh5 Qe5 22. Bxf7 Re7 23. Nf3 Qf6 24. Bg6 a4 25. e5 Qf8 26. e6 a3 27. b3 Qf6 28. Kc2 c6 29. Nd2 cxd5 30. cxd5 Nxe6 31. Nde4 Nd4+ 32. Kb1 Bf5 33. Bxf5 Nxf5 34. Nxf6 Nxe3 35. Rg6 Rf8 36. fxe3 Rxf6 37. Rxf6 Bxf6 38. Nb5 Rxe3 39. Nxd6 Rd3 40. Kc2 Rxd5 41. Nxb7 Be7 42. Re1 Bxh4 43. Re6 Kg7 44. b4 Bg5 45. Kb3 Bc1 46. Re1 Bb2 47. Na5 Rd3+ 48. Ka4 Rd4 49. Nc6 Rc4 50. Ne5 Rd4 51. Rh1 Bc3 52. Nc6 Rc4 53. Kb5 Rxc6 54. Kxc6 Bxb4 55. Kd5 Kg6 56. Rh3 Kg5 57. Ke5 h5 58. Rg3+ Kh4 59. Rb3 Bf8 60.Kf5 Be7 61. Rb7 Bd6 62. Rh7 Bc5 63. Kg6 Kg4 64. Rxh5 Bd4 65. Ra5 Bb2 66. Rf5 Bc1 67. Kf6 Bb2+ 68. Ke6 Bc3 69. Rf7 Kg5 70. Kd5 Bb2 71. Kc4 Kg6 72. Rf1 Kg5 73. Kb4 Kg6 74. Rf3 Kg5 75. Rxa3 Bxa3+ 76. Kxa3 Kf5 77. Kb4 Ke6 78. Kb5 Kd7 79. a4 Kc7

```

1/2-1/2

# Answer
> 2 votes
I would argue that a stalemate can offer as decisive an outcome as a checkmate, and a more decisive outcome than a draw.

Chess is like a military battle in that it requires strategy and tactics, and has many interesting nuances like sacrifices, pins, and so forth which have real life correspondents. Of course the nice thing about chess is that the battle occurs solely in the mind without any actual bloodshed.

The idea of a stalemate is important and intriguing because it is most surprising and effective when one can produce it at a time when it seems most certain they face defeat, perhaps due to overconfidence by their opponent. For instance, if one is in a hopeless position, one's opponent has an insurmountable piece advantage, or even if checkmate seems imminent, stalemate provides a last ditch chance of snatching victory from the jaws of defeat. Because if one can turn an almost sure defeat into a draw, for the person who does this it can be a real victory despite not being an actual win.

What would making it an actual win accomplish? Just like in real life, a stalemate does not produce an actual victory for either side. One side was about to win, but was denied of that win. But the side doing denying did not earn a victory either. They came from behind and prevented a loss and evened the score, but it definitely cannot be counted as a true win. In a real battle, both sides would get to live to fight another day. In my opinion, that is the more interesting outcome.

# Answer
> 0 votes
I was unable to locate a question in the main text, so I'll answer the one from the title. Would there be more decisive games? - Absolutely yes, since your proposition effectively turns a lot of currently drawn positions into winning ones.

# Answer
> -2 votes
If stalemate were a loss for the player who couldn't move, a good player with the white pieces would be able to beat even the best possible player with the black pieces. The only reason that White's advantage isn't decisive is that black has substantial opportunities to steer the game into positions where White would be able to stalemate Black, but not able to checkmate.

Thus, a rule that classified a stalemate as a loss for the stalemated player would make games very dull *unless* it were combined with a rule that would offer black some counteracting advantage. If, for examaple, chess were to add a "pie rule" similar to that used in Hex, and provide that one player gets to choose the first move made by the white pieces, and the other player gets to then choose whether to take the black or white pieces, that might make the game more interesting, though it would be a substantially different game from the one now called "chess". In particular, the first player to move would need to make a move for the white pieces which would give White as small an advantage or disadvantage as possible. Very few chess openings would be played under such rules, since nearly all such openings feature a powerful first move by white, and a player who made a strong move with the white pieces would get stuck playing the black pieces.

---
Tags: endgame, checkmate, pawns, stalemate
---


# Question
Title: What chessboard companies are the most reputable?
As a follow up to my original question What are the characteristics of a good chess board? I was wondering what companies are the most reputable for chessboard construction. Since I am just a beginner I am curious at lower cost beginner boards, but also in other boards that I might want to splurge on one day if I really get into chess.

# Answer
The standard vinyl board is hard to beat for everything except showing off a chess set. You can get them for cheap from the USCF or from any other purveyor of chess gear.

Here's one from Cajun chess for $4. I bought a few sets from them. I like them.

Looks like tournament-sized wooden boards begin at $50.
> 2 votes

# Answer
I don't really know any cheap chess board companies, but checking out websites like The Chess House can yield very good results.

For a nice splurge, the best boards are without a doubt the DGT ones,
> 2 votes

# Answer
Most reputed brand in Chess boards is probably Staunton. They are manufactured by Jacques of London and have been in circulation since 1849!
> 2 votes

# Answer
DGT chessboards are the best. The digital chessboards are definitely helpful in your chess career, besides, the quality is really good; the only downside is that it is quite expensive. However, I would say the board is worth the price.
> 1 votes

# Answer
The most reputable chessboard company I know is chessbazaar.com. They are the finest crafters of chess pieces and boards and they do it at the lowest price in the industry. the quality is not compromised.
> 1 votes

# Answer
UK and Europe based can order chess board from Discover Handicrafts

Their chess boards are made from wood and very artistics.
> 1 votes

# Answer
## "Caveat Emptor"

A lot of the chess sets out there *look* pretty nice, but frankly most of the manufacturers invest all their effort into attractive molds and durable plastic. Very few of them offer even the most basic features that you would expect in this day and age - the features that would most enhance your game.

I just spent over $50 for a tournament set for my son. Yes, it has hefty, triple-weighted pieces for stability and an attractive Staunton design, and the pieces seem very durable. The set even came with extra queens - a nice touch for those four-queen positions you get every once in a while. But look at what it doesn't have:

* Undo. This feature has been in cheap word processors since the '80's, but is totally missing from the set.
* Syntax Checking. The set allows illegal moves without so much as a warning. This has been a feature of programming editors since the '90s.
* Speed Regulation. The set allows me to make moves as hastily as I want, even though my game always suffers as a result. For goodness sake, the *escapement* has been a part of clocks since the *13th Century*!
* Drink Holders. Ok, this one is just a personal preference, but my minivan comes with about 16. You would think that a chess set would have space for at least two.

The upshot: It doesn't seem to matter how much you spend, you aren't going to get these sorts of features. So if you ask me, *all* the companies out there are ripping us off. The USCF has been doing it the longest - I suppose there is some merit to the thought that if you are going to be swindled, get swindled by someone who has been at it for a long time and has swindled lots of others. It's less embarrassing.
> 0 votes

---
Tags: chessboards, recommendations
---


# Question
Title: What does the term LPDO (Loose Pieces Drop Off) mean?
I have been hearing the term LPDO (Loose Pieces Drop Off) a lot lately, which apparently is helping players in the beginning level. If so, does it prescribe some best practices and tips to help beginners?

# Answer
> 3 votes
LPDO (Loose Pieces Drop Off) is a reminder that unprotected pieces are vulnerable to tactics like forks. If two unprotected pieces (or pawns) are attacked at the same time then you can only move / protect one of them. One of your loose pieces is going to drop off.

In general this is used to guide weaker players to try and build up their position prophylactically so that pieces as much as possible protect each other. Stronger players, of course, can also come unstuck which is why you also hear this phrase occasionally made by commentators on GM games.

# Answer
> 3 votes
Excellent advice here from Brian and Hauke. Another important lesson is that tactics are important at all levels of play, not only for beginners. You won't ever reach a stage where you've "fixed" the problem: even if you have a master-level understanding of strategy, you still need to be on the guard for basic tactics.

The term was made popular by John Nunn's book "Secrets of Practical Chess". He describes a friendly match of 100 rapid games where he beat a 2300-rated player by 88-12:

> "I thought that I would see lots of advanced strategic concepts in these games but actually all I have learnt is LPDO" ... During the remaining games I saw what he meant. Most of the games were decided by relatively simple tactics involving undefended pieces, when the LP would duly DO.

# Answer
> 2 votes
Brian's answer gives you the "why". I will add a bit of "when not", as this, as usual, is a rule of thumb which happily may be ignored by a stronger player. Thus, the limitations of the rule...

* Does not help at all against attacks of pesky pawns (assuming "piece" meant "officer") or more generally, light force kicking your heavies around.
* Overprotecting everything makes your position somewhat cramped.
* Protection is a liability that limits the agility. Good luck mating with each and any piece protected at all times!
* Might be in clash with other rules of thumb. E.g. using the "bulls head" (e4 d4 Nc3 Nf3 Rd1 Re1) your bishops *must* go to b5 and g5 by this rule, which are usual good squares anyway, but sometimes c4 and f4 are fine or even better. BTW, in the latter case protecting them with pawns to b3/g3 by the rule is more often a bad idea than not!

Also as usual, don't worry - eventually you get stronger and know by yourself when and how to follow the rule in spirit, not in letter.

---
Tags: beginner, training
---


# Question
Title: Did AlphaZero also have to learn that each piece has a value?
When AlphaZero learned on its own that a queen has a value of 9, a pawn 1, knight 3, etc., then did it also need to learn on its own that a piece has a value? Or was it that the concept of value was baked into its code and it only had to figure out on its own what the values are. The value of a queen is not strictly 9, but it is relatively more valuable than a pawn.

# Answer
In short, no there was no explicit concept of relative piece importance coded in. But the position evaluation is based on a neural network which possesses weights which indirectly account for the pieces in the position.

That said, in this AlphaZero paper they use self-play games to fit a linear model that predicts the game outcome from the difference in numbers of each piece only, result:
> 6 votes

# Answer
It sort of did. "Sort of" because once you examine how neural networks work it's not clear what AlphaZero is actually learning.

AlphaZero has a neural network evaluation function. How that works is that it takes as input the position on the board (along with other things like whether a pawn can capture *en passant*, whether castling is possible, etc) and converts that into a list of candidate moves to play as well as the probability of winning. There is no "queens are worth 9 pawns" input, there is only "there's a queen on this square". Of course, queens usually have quite an impact on a position, so the neural network will quickly learn that having queens strongly correlates with a high probability of winning, but nobody actually knows how much value the neural network ascribes to the queen.

What was definitely not given to AlphaZero was the idea that each piece has a value. Remember, it was only given the position on the board.
> 28 votes

# Answer
The short answer is: **No**.

AlphaZero learns to evaluate only the position. The position consists of all the pieces and their placement on the board (plus castling and en-passant information). **There is no way to distinguish the material's value from the position's strength** -- which is a really beautiful idea and offers a lot of learning potential for humans. AlphaZero chooses its moves to maximize the (positive) value of the position. (The checkmate-win has the maximal positive value, the checkmate-loss has the maximal negative value.)

The information about the value of single pieces is stored nowhere. It can be potentially obtained by comparing position evaluations when removing/adding pieces to the board. But it will also influence the position's strength which cannot be separated from the material's value itself. So in best case some average value of pieces (when averaging over many positions) might be estimated in this way.
> 16 votes

# Answer
One central piece of alphazero is the neural evaluation function. This function takes the board as input and produces a value as output. The only input is what pieces are on the board and where.

So, you can see it as the programmers enforcing this rule: the value of a position depends on which pieces are placed where.

This is what the AI "knew" as it as born, if you will. It knew that pieces being present and located relative to each other had value. Now, one possible way to score the board is a linear combination of "piece value" times "number of pieces of that kind". But in practice, the network learned a much more complex and non-linear function of the pieces present on the board.

It certainly could do what we often use: queen times 9 + knight times 3 + ... but it learned much better than that.

https://medium.com/applied-data-science/alphago-zero-explained-in-one-diagram-365f5abf67e0

The deep neural network on the left gives you a hint of how much more complex the evaluation function can be, over this simplistic linear evaluation.
> 9 votes

# Answer
From the comments below, maybe a good summary of this answer:

> Alphazero doesn't necessarily respect piece value the way we do, but both Alphazero's experience and our piece valuation (which is effectively our human experience) are approximations of same the balance of power for a given board state.

---

Piece value is a form of **bias**, by inherent definition of saying that one piece is worth more than other. It's an artifact of how humans reason about the strength of a certain position/play. Our piece valuation, when taken as literal truth, suggests that a queen is *always* worth more than e.g. a knight or a pawn.

Part of what makes machine learning so interesting is that having an unbiased objective view can fundamentally shake things up. For example, in certain strategies you could do more with a knight than a queen, therefore throwing out the idea that a queen has more value than a knight.

However, this is just a small subset of strategies and positions, among million others. You already touched on this point yourself, when you commented:

> Not strictly 9, but only that a queen is worth more than a pawn, for example. Of course, exceptions exists, for example if the pawn can deliver a mate.

Humans aren't able to mentally track different individual piece valuations for millions of different positions or plays. Therefore, humans use a valuation that works in *most* cases. In *most* cases, a queen is more useful than a knight. In *most* cases, a knight is more useful than a pawn. This is why our piece valuation is the way that it is.

However, machines don't have these limitations. They are much more able to track different piece valuations for each distinct board situation, and therefore a machine doesn't need to rely on some arbitrary global piece value, as it is a needlessly imprecise measurement.
For a machine, it makes a lot more sense to simply calculate each piece's value on the fly, rather than relying on some half-baked approximation.

Different strokes for different folks. Machines are better at this, and therefore they don't need the oversimplified crutch that our piece valuation represents.

In order to understand machine learning, and how the machine "thinks", you need to sidestep your own bias and preconceived observations. Unsurprisingly, sidestepping human bias is by far the biggest challenge in machine learning - more so than the raw learning algorithm in and of itself.

---

That being said, if you asked Alphazero to play a billion games, look at the victories, asked it to re-simulate those games after taking away one random piece, and then asked which type of piece had the biggest impact on turning a victory in a defeat, then it would very likely tell you that it's the queen.

That is *sort of* the same as saying "the queen is the most valuable piece", but in a much more pedantic and deeply analytical way. It is pedantic *to us*, but for Alphazero this isn't pedantry but rather necessary accuracy. One man's pedantry is another man's precision.

Our human piece valuation system isn't *wrong*, it's just very crude and unrefined.
> 6 votes

# Answer
AI engineer here.

The answer to this question is hiding in the name: Alpha**Zero**. This refers to "zero prior knowledge of the game". AlphaZero can also play Go.

Now, it might be a bit strong to say that AlphaZero has absolutely no knowledge about chess. AlphaZero knows that it's a turn-by-turn board game, and that the 3 possible outcomes are a win for either side or a draw. (unlike Go, which has no draw). But AlphaZero had to figure out itself how pieces contributed to winning.

Since AlphaZero is a Deep Neural Network, it can quickly learn highly complex valuation functions. That is to say, it can learn a valuation function which includes how well each piece cooperates with other pieces.

What might also be surprising is how Google got started with these valuations. They simply started with entirely random values! The learning algorithm just tweaked the values step by step, and gradually won more and more games.
> 6 votes

# Answer
This is a short answer, but hopefully it helps.

Consider how AlphaZero values pawns. It throws them away in disgust sometimes, usually to open up files or diagonals on which to plant menacing rooks and bishops. AlphaZero doesn't care one bit about the nominal value a piece may have (I'd argue most human players also don't care about a piece's value).
> 1 votes

---
Tags: alphazero
---


title: Castling in the French Defense

text:
# Question
Title: Castling in the French Defense
How do you decide which way to castle?

It seems castling kingside can be dangerous because of white's extra kingside space he often gets in the French Defense. Also most of my pieces are naturally on the queenside making it difficult if they're needed for defense on the kingside. I'm curious about if castling queenside is good or not, since you use your pawns to expand on the queenside its feels like a lack of a pawn cover for your king?

Sometimes I end up not castling at all in the French because of this. I understand that the answer is rather situational but can someone explain the theory on this?

# Answer
> 6 votes
If you can block the pawn structure on the queenside then you can consider castling queenside, for example in this line

```
  [StartPly "12"]
  [White "White"]
  [Black "Black"]
  [FEN ""]

  1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6 6. a3 c4

```

Also, in the Winawer poisoned pawn, black often castles queenside in the middlegame because kingside castling is not possible and to bring the a8 rook into play, e.g.

```
  [StartPly "32"]
  [White "White"]
  [Black "Black"]
  [FEN ""]

  1. e4 e6 2. d4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3 6. bxc3 Ne7 7. Qg4        Qc7 8. Qxg7 Rg8 9. Qxh7 cxd4 10. Ne2 Nbc6 11. f4 Bd7 12. Qd3 dxc3 13. Nxc3 a6 14. Rb1 Na5 15. h4 Nf5 16. Rh3 O-O-O

```

Otherwise you generally castle kingside. Sometimes Kf8 is played to defend a pawn on g7, e.g. after Qg4, but that depends on the specifics.

# Answer
> 3 votes
I have trouble telling what's theory and what's my practical notes, but one thing immediately comes to mind.

Castling queenside can be nice in the Winawer, but it may be almost necessary in the MacCutcheon variation:

```
  [White "White"]
  [Black "Black"]
  [FEN ""]

  1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 Bb4 5. e5 h6 6. Bd2 Bxc3 7. bxc3 Ne4 8. Qg4 g6 9. Bd3 Nxd2 10. Kxd2

```

You can see h4-h5 and Bxg6 are constant threats. Rh3 targets a rook lift, f6 is a hole for the queen or knight, and so forth.

Black can even play ...c4 (as in the Advance variation above) and target the weak a- or c2- pawns. White's pawns point towards the kingside, and an a5 push is hard without an exchange sacrifice. In this case, advancing pawns on the queenside makes it safer, since it locks the white c-pawns and shuts out the light-squared bishop.

If the c-file is up for grabs, the black king may be able to duck to b8 after castling and make it easier to trade off rooks. It's hard to open the a- and b- files, though a possible c5 or d6 outpost may be a nuisance. If the black king were on g8 after kingside castling, it would have ground to make up to get to the c-file or, in general, participate in the endgame. Your point about black's queenside pawns potentially moving and making weaknesses is a good one--you probably don't want to castle that way if you've moved them, the exception being a MacCutcheon-ish b6/Bb7/Nc6 formation, or where you've played ...a5 and White's played a4, and you control b4. Again, you want to make sure a knight can't slip into d6 or possibly c5.

But if pieces are traded off, or White's bishop on h3 is dangerous, ...Kd7 (hiding behind a wall of pawns) may also be quite good.

I think one side note is that, while castling queenside can be good, the central pawn bunker affords Black the option of delaying castling at times if there are other useful moves to make. This may not be theory, but it often happens if white blunders the d4-pawn in the opening. The e5 pawn can provide a kingside attack that is hard to defend in practical play. Black may want to push White's pieces away from d4 and castle to the wing White avoids.

Castling queenside may also be desirable in the Burn variation (...dxe4 instead of ...Bb4) since after Nxe4 Be7 Bxf6 gxf6 Black gets a hold on e5. There, castling kingside lets White castle queenside and have an attack with ready-made targets. Black should use the half-open g-file for some prospects, but staying in the center isn't an option as d5! may hurt.

If White has pointed pieces at the kingside and Black hasn't made a lot of queenside holes, queenside castling may be very strong indeed. It can, however, be vulnerable to a timely Ng5, threatening the f-pawn, if Black has not found the time to play ...f6.

---
Tags: castling, french-defense
---


# Question
Title: How to quickly calculate two pawns facing two pawns
A situation that often seems to confuse me is when I push a pawn alongside two pawns that are head-to-head and my opponent pushes the opposing pawn, such as when Black plays c5 to my c4.

```
rnbqkbnr/pp3ppp/4p3/2pp4/2PP1B2/8/PP2PPPP/RN1QKBNR w KQkq - 0 4

```

Suddenly, there are four moves to consider.

1. I play dxc5.
2. I play cxd5.
3. Black plays cxd4.
4. Black plays dxc5.

I find it challenging to quickly sort through the options and even understand whether I'm losing or gaining a pawn, let alone considerations like the resulting pawn structure. In this case, it looks like if I play cxd5, Black may end up with an isolated d pawn.

Are there any shorthand methods for quickly analyzing these two-pawns-facing-two-pawns situations to predict the outcome? Or, failing that, rules of thumb which lead to reasonable outcomes?

# Answer
Since this is happenning so early in the game, the best idea is probably not to get involved in deep calculations, but rather to get some knowledge about the pawn structures that could arise from those trades (most notably, the isolated central pawn).

I see no particular gain from either **4.cxd5** (it'd liberate the c8 bishop) or **4.dxc5** (it'd speed up my opponent's development), so I'd continue with **4.e3**, allowing me to retake with a pawn on d4 if Black attempts to take
> 11 votes

---
Tags: tactics, pawns, pawn-structure, calculation, captures
---


# Question
Title: Regarding a pawn sac in the Neo Grunfeld
I have been looking at the Neo Grunfeld.

```
[FEN ""]

1. d4 Nf6 2. c4 g6 3. g3 d5

```

I am considering Nf3 followed by castling, thereby giving up the pawn. Does White has compensation for the sacrifice as they do in the Open Catalan?

# Answer
> 3 votes
TL;DR: Yes, it is playable to leave the pawn hanging. In the event of it being captured, you will either regain it quickly, or enjoy strong compensation if Black hangs on to it. And if Black doesn't take on c4, then you will soon be protecting it in some fashion (or opting to exchange it).

After 1.d4 Nf6 2.c4 g6 3.g3 d5, I'd recommend playing 4.Bg2 before Nf3 (David also mentioned this move). The point is that after 4...dxc4, 5.Qa4+ is a more enticing option since 5...Nc6 runs into 6.Bxc6+. Although answering 4...dxc4 with 5.Nf3 is also fine, with the intention of instead hopefully recapturing the pawn with the b1-knight later. So small move order subtlety, just to improve the circumstances arising from 5.Qa4+ if that's how you'd prefer to answer the immediate 4...dxc4 capture.

Moving on, following 4.Bg2 Black is more likely to not take yet and instead play 4...Bg7 or 4...c6. For 4...Bg7 5.Nf3 0-0 6.0-0, the main move for Black (other than 6...c6, which transposes to a position discussed in the final paragraph of this answer) is 6...dxc4. At this point you should play 7.Na3, aiming to recapture the pawn with the knight. Black does not have a good way to defend the pawn.

Meanwhile for 4...c6, you could choose to relieve the pawn tension and go for a symmetrical structure with 5.cxd5 cxd5. Or, 5.Nf3 Bg7 6.0-0, when Black can choose between 6...dxc4 and 6...0-0. 6...dxc4 prepares to create a pawn chain with ...b5, so you should prevent this with 7.a4. Now the plan is to regain the pawn with Qc2 and/or Na3, as well as to expand in the centre with e4. Black could try to relentlessly hang on to the pawn if they want (e.g., ...Ne4-...Nd6 and ...Be6 ideas), but White will definitely have good compensation in the form of a strong centre and better coordinated forces (not to mention that the c4-pawn will obviously be very weak).

If Black instead plays 6...0-0, then you have a number of moves. Once again you could capture on d5 (7.cxd5), or you may support the c4-pawn with any of 7.Qb3, 7.Nbd2, 7.b3, or 7.Ne5. So by now the opportunity for Black to win a pawn, either temporarily or over the long term, will have passed.

# Answer
> 2 votes
Not really a pawn sacrifice, since you can retake your pawn with Qa4, but definitely a reasonable way to continue. **4.Bg2**, with similar ideas, appears to be the more popular option according to databases though, but both moves will transpose into each other pretty much every time.

---
Tags: opening
---


# Question
Title: Problems with computing the Zobrist hash for a chess position?
I'm attempting to use Zobrist hashing in my chess engine, but I'm running into some difficulties getting it to work correctly.

I'm using the random numbers from this site so I can test my results against the answers they have, and for one of the positions I can't figure out what series of XORs need to be performed to get the next correct position.

I'm attempting to go from the "position after e2e4 d7d5 e4e5" (with a hash 662fafb965db29d4) to the "position after e2e4 d7d5 e4e5 f7f5" (with the hash 22a48b5a8e47ff78).

But I can't figure out what series of XORs I need to use to go between the first position's hash key and the second (this is important as I need to incrementally add and remove pieces from the hash correctly for the Zobrist hashing to efficiently work with my engines DoMove and UndoMove functions). As far as I can tell, the black pawn on f7 is XORed away, and then a black pawn at f5 is XORed back. And then the random number for the side to move should be flipped. Here is what I said in pseduo-code:

```
startingHash = 662fafb965db29d4
startingHash = startingHash XOR random number for pawn at f7
startingHash = startingHash XOR random number for pawn at f5
startingHash = startingHash XOR random number for white to move

```

But doing this isn't giving 22a48b5a8e47ff78. Any idea where I'm going wrong here? I'm fairly confident I'm using the correct random numbers according to the spec in the link above. And I've already gotten many of the other positions to work as well. But I'm stuck on this one.

# Answer
> 5 votes
After 2...f5 white can take en passant: 3.e5xf6.You have to take this into account.

---
Tags: engines, software, programming, computer-chess
---


# Question
Title: How can a check evasion move generation algorithm be done efficiently?
In my chess engine, I'm attempting to create a strictly legal move generator, instead of generating pseduo-legal moves, then discarding them later in the search and evaluation phase.

So far, here is my planned approach:

* Remove pinned pieces from the board
* If the king is in check
    + Generate possible moves from the check evasion function
* Otherwise
    + Generate possible moves for pinned pieces
    + Generate possible moves for non-pinned pieces

The only part of this algorithm that I don't quite understand how to implement is the check evasion move generator. As I understand it, there are three ways of evading a check:

* Capture the checking piece
* Block the checking piece
* Move the king

Now although I understand these three cases, I'm having a hard time trying to think of a way to implement them concretely and efficiently. What strategies are usually taken in creating a check evasion function? Also note, I'm working with bitboards.

# Answer
You generate all the legal king moves up front, regardless of whether there's a check. Then determine the number of checking pieces. There will be two scenarios relevant to the question.

If it is a double check, the only legal moves are king moves out of check, so you simply return the existing list of moves

Single check is trickier. There are multiple cases here depending on the checking piece:

* If the checker is a knight, simply generate all piece moves which capture this knight. Return the list of captures and existing king evasions
* If the checker is a pawn, you do the same thing, **but** you also have to check if an e.p. move works.
* For any other checking piece (the "ray" pieces: queen, bishop, rook), the most efficient way to do this for bitboard-based move generation is using masks. You generate two bitboards: one containing all the intermediate squares between the king and the checking piece, and one containing a single set bit for the location of the checking piece. If you're not storing quiet moves and captures separately, you can combine both masks. If there are no checks, this bitboard is simply the all-ones bitboard.

Then, for every piece and pawn, you presumably generate a bitboard of target squares. You AND this with the mask(s) above, to restrict to legal check evasions. Then create the moves as usual, from this reduced bitboard.

A concrete implementation can be found in the `generate_legals` function in my (very optimised) chess move generator on GitHub.
> 6 votes

---
Tags: engines, programming, computer-chess, chess-ai
---


# Question
Title: Description of rectangular opposition in Silman's Complete Endgame Course
In *Silman's Complete Endgame Course*, the author gives this rule in order to gain the Opposition when there isn't a direct connection in between the kings:

> In this type of situation, the rule is to make a square or rectangle in which each color is the same color *with the other guy to move.*

But later in the book, this practice problem is given which seems to contradict this:

```
[FEN "2k5/8/8/8/1PK5/8/8/8 b - - 0 1"]

1...Kb8 2.Kd4 Kc7?? 3.Kc5

```

> 2.Kd4 Kb7 with a draw (and not 2.Kc7?? 3.Kc5 when White gets the opposition and wins).

Black moved his king to a square of the same color as White's king (forming a rectangle with corners c7-d7-d4-c4), but White still got the Opposition and won. Doesn't this invalidate the rule given above?

# Answer
> 7 votes
> the rule is to make a square or rectangle in which each color is the same color with the other guy to move.

I'm not quite sure how this sentence makes sense other than there is a typo, and it actually says "...rectangle in which each **corner** is the same color with the other guy to move". If this is indeed the case, then obviously b4-d4-d8-b8 works and c4-d4-d7-c7 doesn't (two white and two black corners).

An example to this would be if it's white to move, they play 1. Kd4 and black plays either Kd8 (direct long opposition) or Kb8 (indirect, rectangular opposition).

# Answer
> 4 votes
There is a crucial part missing from the definition. *To have the opposition you must have an odd number of squares between the kings when it is your opponent's turn to move.*

This is obvious when you think about it. Suppose you move your king to be diagonally opposite your opponent's king on a square of side 4. The two kings are on the same diagonal and so on the same colour. Then there are two squares between the kings and your opponent can simply move the king one square diagonally closer to your king giving your opponent the opposition.

According to Silman's quoted rule each player had the opposition on their turn. This is nonsense. When you moved your king onto the same coloured square diagonally opposite your opponent's king but two squares away you lost the opposition.

There is a good YouTube video by Hanging Pawns on the opposition here.

---
Tags: endgame, books, opposition
---


# Question
Title: How do I complete this implementation of magic bitboards?
I'm currently coding a chess engine in C++, and have run into a bit of trouble with my magic bitboard implementation.

So far, I have a function that calculates blockerBoards (all the possible pieces that can block the rook or the bishop).

From there, I have the following code to take these blockerBoards and convert them into attack tables:

```
bitset<M> mBishopAttacks[64][512]; // 256 K
bitset<M> mRookAttacks[64][4096]; // 2048K

bitset<M> bishopAttacks(bitset<M> blockerBoard, int sq) {
    unsigned long long index = blockerBoard.to_ullong();
    index *= bishopMagics[sq];
    index >>= 64-9
    return mBishopAttacks[sq][index]; //outputs corresponding attack board
}

```

Note that I got the array of magic numbers, bishopMagics\[64\], from somewhere on the web.

How do I initialize these attack tables, mBishopAttacks and mRookAttacks? Currently, they are empty. Do I simply have to calculate the attack tables for each possible permutation of blockers?

# Answer
> 3 votes
It is probably most efficient if I paste my code from my chess move generator on GitHub.

```
int ROOK_ATTACK_SHIFTS[64];
Bitboard ROOK_ATTACK_MASKS[64];
Bitboard ROOK_ATTACKS[64][4096];

void initialise_rook_attacks() {
    Bitboard edges, subset, index;

    for (Square sq = a1; sq <= h8; ++sq) {
        edges = ((MASK_RANK[AFILE] | MASK_RANK[HFILE]) & ~MASK_RANK[rank_of(sq)]) |
            ((MASK_FILE[AFILE] | MASK_FILE[HFILE]) & ~MASK_FILE[file_of(sq)]);

        ROOK_ATTACK_MASKS[sq] = (MASK_RANK[rank_of(sq)]
            ^ MASK_FILE[file_of(sq)]) & ~edges;

        ROOK_ATTACK_SHIFTS[sq] = 64 - pop_count(ROOK_ATTACK_MASKS[sq]);

        subset = 0;
        do {
            index = subset;
            index = index * ROOK_MAGICS[sq];
            index = index >> ROOK_ATTACK_SHIFTS[sq];
            ROOK_ATTACKS[sq][index] = get_rook_attacks_for_init(sq, subset);
            subset = (subset - ROOK_ATTACK_MASKS[sq]) & ROOK_ATTACK_MASKS[sq];
        } while (subset);
    }
}

```

Some comments:

* For each square, the bitboard stored in the attacks table is determined by a complicated cycling algorithm. You start with an empty bitboard `subset`, then manipulate it using the magics and the masks generated previously. This gives you an index. You then initialise the attacks table at `ROOK_ATTACKS[sq][index]` as the bitboard of slider moves from that square, using the initial value of `subset` as the occupation bitboard. `subset` is then updated using the masks, and the loop continues. The nature of the magic numbers is that, starting with `subset=0`, you will cycle through all 4096 indices (not in order), and `subset` will turn into the correct "representative" occupation bitboard for all 4096 of these.
* The value of "9" while bitshifting to calculate the index should *not* be hardcoded. Instead, it should depend on whether the piece is in the centre, on an edge or in a corner, which is what `ROOK_ATTACK_MASKS` and `ROOK_ATTACK_SHIFTS` are for. I believe excluding these is a little-known bug
* Once you have generated the occupation/blockers bitboard for a particular index (running from 0 to 4095 for rooks), you can generate the sliding moves to initialise the attacks matrix in any way you want. I personally used hyperbola quintessence, but using a simple flood fill poses no problems, it's all pregenerated anyway

Unfortunately the chess programming wiki does not seem to be very useful on these matters; you are best off reading the original works and talkchess posts by Pradyumna Kannan et al.

---
Tags: engines, programming, bitboard
---


# Question
Title: Is ECO still the best reference for all chess openings?
Is ECO, Encyclopedia of Chess Openings still considered the best printed reference work for all the chess openings, as it was back in the '80s?

# Answer
> 5 votes
There does not seem to be a consensus on this, but here is a relevant discussion:

https://www.chess.com/forum/view/chess-equipment/chess-opening-reference-books?page=1

For printed opening material (as you requested) I prefer ECO with Chess Informant updates for new opening ideas and analysis: http://www.chessinformant.org/about-chess-informant/

# Answer
> 2 votes
I can't speak on the usefulness of ECO for serious study. However, I can tell you that https://www.openingtree.com/ (which is not a printed reference, but is relevant to the title) is much easier than a book to search: just play the moves, and the most common lines with white/draw/black percentages are displayed. You can search by Lichess players, chess.com players, notable chess players, and notable chess events, as well as see the most common lines played and game results. The site touts a testimonial that "It's so powerful" from IM Eric Rosen. Lichess and chess.com offer similar opening explorers, with Lichess and chess.com having Stockfish integration in the browser.

# Answer
> 1 votes
IMO, this is an area that needs work. I developed a small computer program to check for duplicates in openings and found that most opening categorizations contain duplicate positions. For example, Schiller's opening list has duplicate openings. The same positions arise through different move orders but are named differently. ECO is far too general.

# Answer
> 0 votes
Maybe, but it doesn't mean much. Any version of ECO will always be an inferior, cumbersome substitute for an opening explorer.

---
Tags: opening, books, eco
---


# Question
Title: Strategic plans for Black in Fianchetto Variation of KID
As an intermediate-level KID player, I'm starting to face Catalan-style setups with d4 / c4 / g3 more often:

```
[FEN ""]

1.d4 Nf6 2.c4 g6 3.g3 Bg7 4.Bg2 O-O 5.Nf3 d6 6.O-O Nbd7 7.Nc3 e5

```

I often struggle to find plans for Black after pushing e5. White's position just seems so solid and without a lot of weaknesses; meanwhile, Black's is cramped and it's hard to develop pieces like the d7 knight / the c8 bishop. I've read that it's also not as easy for Black to create a kingside attack, since White does not close the center and has an extra defender near their king.

Here is the typical way I go about these positions:

* Play c6 to prevent hops from the c3 knight / block out the g2 bishop
* Play Re8 and Nf8
* Try to develop the light-squared bishop somewhere if possible
* Remaneuver the knight to e6

What other strategic plans are available to Black? Is it possible to play more aggressively against this variation?

# Answer
> 4 votes
Since you're asking about rather aggressive reply, the a6-Rb8-b5 variation might be of interest. In the other answer it's referred to as Gallagher; I have no clue who this Gallagher is, but the line is known as either Panno or Yugoslav variation (which might be odd since Panno has nothing to do with Yugoslavia). This line is recommended by Bologan, and although stockfish doesn't like for black too much, it's still pretty much playable.

In short, instead of Nd7 and e5 you play Nc6, a6, Rb8 and b5 (it's debatable if a6 first or Rb8 first, some might argue one is more precise than the other). The immediate idea is to attack the c4 pawn. If white meets Nc6 with d5 you answer with Na5 attacking c4, and after a move like Nd2 you play c5 ruling out b2-b4 threat. Then you push b5, exchange pawns on c4 and play along the b file, long dark diagonal and try to win the c4 pawn. White plays in the center, so at some point you might want to close it with e7-e5.

Of course, white doesn't have to push d5, but you still aim for b7-b5 and taking away the c4 pawn. Strategically, white is very solid with the bishop on g2, so the idea is to use the only weakness of this development: the Bg2 leaves the c4 pawn a bit weak. Also, by playing Rb8 and b5 you move your pieces away from the long diagonal, somewhat limiting the impact of the bishop on g2.

# Answer
> 4 votes
There are several top level games in this variation from the 1990's, including Yusapov-Kasparov, which Garry won; and some games where Karpov played it as White.

You can explore the database further for examples.

Typically, Black either pressures d4 more with c6 and Qb6, or he gets ready to give up the center (exd4) when he would play Nc5, a5, Re8 type of setup.

But there is also the Gallagher system (http://www.kenilworthchessclub.org/games/java/2010/carrelli-goeller.htm) which gives up the center and tries to get in b7-b5 (Rb8, a6, b7-b5, he discusses it in his excellent book "Play The King's Indian"

---
Tags: opening, strategy, kings-indian
---