# Question
Title: How do you nerf Stockfish to analyze the same position multiple times?
I want to make some statistics by analyzing the same position, multiple times, at different levels of Stockfish. Precisely, I would like Stockfish to analyze a specific position at different `"Skill Level"` but what I've noticed is that there is the "hash table" which keeps in memory the previous analyses. Somewhere I've found that if I specify the parameter `game=object()` the hash table has been reset but I'm not sure about that. What I want is that the second analysis is completely independent from the first one.

```
skill_levels=[2,10,20]
for i in range(len(skill_levels)):
    engine = chess.engine.SimpleEngine.popen_uci(stockfishpath)
    engine.configure({"Skill Level": skill_levels[i]})
    board = chess.Board(fens[f])
    dummy_move = engine.play(board, chess.engine.Limit(time=0.1), game=object()).move
    result = engine.analyse(board, chess.engine.Limit(time=1), game=object(),root_moves=[dummy_move])
    engine.quit()

```

How do you do this properly?

Second question: I suppose that limiting the engine on time `chess.engine.Limit(time=1)` I will get different results depending on the specs of the PC where Stockfish is running. How do I make the results somehow independent of that? Considering to use an average pc (i5 8th generation, 16gb of ram) which depth should I chose `chess.engine.Limit(depth=20)` the get more or less the same results of `chess.engine.Limit(time=1)`?

# Answer
Use engine.play because you are using skill level, note use info parameter to get the score. You don't need to worry about the hash table because you quit the engine for every skill levels.

## Method 1

##### Code

```
import chess.engine
import logging

# Uncomment to see the log in console.
# logging.basicConfig(level=logging.DEBUG)

stockfishpath = 'sf15.exe'
fens = [
    'r4rk1/5pp1/5q2/p2n2p1/2R3P1/7P/P1Q2P2/2R2BK1 w - - 0 1',
    'rn1qkbnr/pp2pppp/2p5/3p1b2/3P4/4PN2/PPP2PPP/RNBQKB1R w KQkq - 0 1'
]
skill_levels=[2,10,20]
analysis_time_sec = 2
hash_mb = 128

for fen in fens:
    print(f'FEN: {fen}')

    for s in skill_levels:
        engine = chess.engine.SimpleEngine.popen_uci(stockfishpath)
        engine.configure({"Skill Level": s})
        engine.configure({"Hash": hash_mb})
        board = chess.Board(fen)
        result = engine.play(board, chess.engine.Limit(time=analysis_time_sec), info=chess.engine.INFO_SCORE)
        engine.quit()

        bestmove = board.san(result.move)
        score_cp = result.info['score'].relative.score(mate_score=32000)
        score_mate = result.info['score'].relative.mate()

        print(f'skill level: {s}')
        print(f'score cp: {score_cp}')
        print(f'score mate: {score_mate}')
        print(f'bestmove: {bestmove}')
        print()

```

##### Output

```
FEN: r4rk1/5pp1/5q2/p2n2p1/2R3P1/7P/P1Q2P2/2R2BK1 w - - 0 1
skill level: 2
score cp: 57
score mate: None
bestmove: Rd1

skill level: 10
score cp: 57
score mate: None
bestmove: Rc6

skill level: 20
score cp: 45
score mate: None
bestmove: Rc6

FEN: rn1qkbnr/pp2pppp/2p5/3p1b2/3P4/4PN2/PPP2PPP/RNBQKB1R w KQkq - 0 1
skill level: 2
score cp: 34
score mate: None
bestmove: Nh4

skill level: 10
score cp: 34
score mate: None
bestmove: Bd3

skill level: 20
score cp: 23
score mate: None
bestmove: Bd3

```

Regarding your second question do the following:

1. Run the engine
2. Set engine options you like, e.g
`setoption name Hash value 128`
3. Send the command
`go movetime 1000`
that will search the engine for 1000 ms or 1 sec. Sample output:

```
info string NNUE evaluation using nn-6877cd24400e.nnue enabled
info depth 1 seldepth 1 multipv 1 score cp 30 nodes 20 nps 10000 tbhits 0 time 2 pv e2e4
info depth 2 seldepth 2 multipv 1 score cp 84 nodes 45 nps 22500 tbhits 0 time 2 pv e2e4 a7a6
info depth 3 seldepth 3 multipv 1 score cp 37 nodes 191 nps 63666 tbhits 0 time 3 pv c2c4 a7a6 e2e4
info depth 4 seldepth 4 multipv 1 score cp 158 nodes 264 nps 88000 tbhits 0 time 3 pv c2c4
info depth 5 seldepth 6 multipv 1 score cp 49 nodes 1449 nps 241500 tbhits 0 time 6 pv e2e4 d7d5 e4d5 d8d5 d2d4
info depth 6 seldepth 6 multipv 1 score cp 36 nodes 3954 nps 395400 tbhits 0 time 10 pv e2e4 c7c5 c2c3 b8c6
info depth 7 seldepth 9 multipv 1 score cp 37 nodes 6269 nps 447785 tbhits 0 time 14 pv e2e4 c7c5 g1f3 b8c6 d2d4 c5d4 f3d4 g8f6
info depth 8 seldepth 12 multipv 1 score cp 30 nodes 11049 nps 502227 tbhits 0 time 22 pv e2e4 e7e5 g1f3 b8c6 d2d4 e5d4 f3d4 g8f6 d4c6 b7c6
info depth 9 seldepth 13 multipv 1 score cp 30 nodes 15347 nps 495064 tbhits 0 time 31 pv e2e4 e7e6 d2d4 d7d5 b1d2 g8f6 e4e5 f6d7 c2c3 c7c5 g1f3
info depth 10 seldepth 14 multipv 1 score cp 37 nodes 23259 nps 540906 tbhits 0 time 43 pv e2e4 c7c5 g1f3 d7d6 f1b5 c8d7 b5d7 d8d7 e1g1
info depth 11 seldepth 14 multipv 1 score cp 45 nodes 40064 nps 556444 tbhits 0 time 72 pv e2e4 c7c5 g1f3 e7e6 g2g3 d7d6 d2d4 c5d4 f3d4 g8f6
info depth 12 seldepth 15 multipv 1 score cp 38 nodes 57767 nps 571950 tbhits 0 time 101 pv e2e4 c7c5 g1f3 b8c6 f1b5 c6d4 b5e2 e7e6 f3d4 c5d4 e1g1 a7a6
info depth 13 seldepth 15 multipv 1 score cp 46 nodes 97551 nps 602166 tbhits 0 time 162 pv d2d4 d7d5 g1f3 g8f6 c2c4 e7e6 g2g3 f8e7 f1g2 e8g8 e1g1 d5c4 b1d2
info depth 14 seldepth 20 multipv 1 score cp 38 nodes 152736 nps 606095 tbhits 0 time 252 pv d2d4 d7d5 g1f3 g8f6 c2c4 c7c6 b1c3 g7g6 e2e3 f8g7 f1e2 e8g8 e1g1 d5c4 e2c4
info depth 15 seldepth 17 multipv 1 score cp 43 nodes 214622 nps 614962 tbhits 0 time 349 pv e2e4 c7c5 g1f3 d7d6 f1b5 c8d7 b5d7 b8d7 e1g1 g7g6 f1e1 g8f6 c2c3 f8g7 d2d4 c5d4
info depth 16 seldepth 23 multipv 1 score cp 33 nodes 413957 nps 619696 tbhits 0 time 668 pv e2e4 c7c5 g1f3 d7d6 f1b5 b8d7 e1g1 a7a6 b5d7 c8d7 f1e1 e7e5 c2c3 g8e7 d2d4 e7g6 d4e5 d6e5 c3c4 f8e7 b1c3 e8g8 c3d5
info depth 17 seldepth 24 multipv 1 score cp 35 nodes 525134 nps 621460 tbhits 0 time 845 pv e2e4 c7c5 c2c3 g8f6 e4e5 f6d5 d2d4 c5d4 c3d4 b8c6 g1f3 e7e6 b1c3 d7d6 f1d3 d6e5 d4e5 f8b4
info depth 18 seldepth 24 multipv 1 score cp 35 nodes 619893 nps 618655 hashfull 37 tbhits 0 time 1002 pv e2e4 c7c5 c2c3 g8f6 e4e5 f6d5 d2d4 c5d4 c3d4 b8c6 g1f3 e7e6 b1c3 d7d6 f1d3 d6e5 d4e5 f8b4
bestmove e2e4 ponder c7c5

```

So in my PC the depth reached in single thread for 1 sec search is 18.

## Method 2

##### Code

```
"""
Evaluate positions with skill levels and get the correct score
of the move corresponding to the skill level. Also Applicable
to uci engines that does not show correct score for the move when playing suboptimal moves.
"""

import chess.engine
# import logging

# Uncomment to see the log in console.
# logging.basicConfig(level=logging.DEBUG)

def analyze_position(stockfishpath, board, root_moves=None, skill_level=20, hash_mb=16, time_sec=1):
    """
    Analyze board position and return bestmove, score_cp and score_mate.
    """
    engine = chess.engine.SimpleEngine.popen_uci(stockfishpath)
    engine.configure({"Skill Level": skill_level})
    engine.configure({"Hash": hash_mb})
    result = engine.play(board, chess.engine.Limit(time=time_sec), info=chess.engine.INFO_SCORE, root_moves=root_moves)
    engine.quit()

    score_cp = result.info['score'].relative.score(mate_score=32000)
    score_mate = result.info['score'].relative.mate()
    bestmove = result.move

    return bestmove, score_cp, score_mate

def main():
    stockfishpath = 'sf15.exe'
    fens = [
        '3K4/8/8/p2k4/pp1B4/N5N1/P2Q4/8 w - - 0 1'
    ]
    skill_levels=[2,10,20]
    analysis_time_sec = 1
    hash_mb = 128

    for fen in fens:
        print(f'FEN: {fen}')

        for s in skill_levels:
            board = chess.Board(fen)
            bestmove, score_cp, score_mate = analyze_position(
                stockfishpath, board, root_moves=None, skill_level=s,
                hash_mb=hash_mb, time_sec=analysis_time_sec)

            # Restart the engine to get the actual score of the bestmove returned when skill level is not best.
            # This is because the current stockfish (v15) does not report the correct score based on the bestmove it returned.
            # We will use the searchmoves <move> command to restrict the engine to search only this move.
            if s < 20:
                # We will set the max skill level because we are after on the correct score of the given move.
                max_s = 20
                root_move = [bestmove]
                bestmove, score_cp, score_mate = analyze_position(
                    stockfishpath, board, root_moves=root_move, skill_level=max_s,
                    hash_mb=hash_mb, time_sec=analysis_time_sec)

            print(f'skill level: {s}')
            print(f'score cp: {score_cp}')
            print(f'score mate: {score_mate}')
            print(f'bestmove: {board.san(bestmove)}')
            print()

if __name__ == '__main__':
    main()

```

##### Output

```
FEN: 3K4/8/8/p2k4/pp1B4/N5N1/P2Q4/8 w - - 0 1
skill level: 2
score cp: 31996
score mate: 4
bestmove: Kc7

skill level: 10
score cp: 31995
score mate: 5
bestmove: Bb6+

skill level: 20
score cp: 31997
score mate: 3
bestmove: Qd1

```
> 3 votes

---
Tags: engines, stockfish, computer-chess, python
---


# Question
Title: What does it mean when stockfish evaluates a move as an inaccuracy after previously thinking it was the best move?
I stumbled onto this position from a game posted on reddit. Stockfish gives the best move as cxd4, which it evaluates as +2.

If you play cxd4, it then says cxd4 was an inaccuracy (only being +1), and that Nxd4 was actually the best move.

It seems that the engine thinks it evaluated the position wrong in the previous move. In this case, should I regard cxd4 as a bad move or not?

# Answer
> 16 votes
Odds are, it means there's a depth\* issue. In other words one of the two moves is better at low depth, and the other move is better at high depth.

Try it yourself - put the position into Lichess without a maximum depth and run Stockfish on it. You should find that Stockfish's best move changes as you let the engine run. It'll first suggest move X, then change its mind and say Y is better, and so on. For example, suppose you have

* d = 20: cxd4 (+2.01) Nxd4 (+1.80)
* d = 30: Nxd4 (+1.3) cxd4 (+0.9)

Now if the first screenshot uses only a d=20 search, while the second one uses a d=30 search, you'll get what you see: the first screenshot recommends cxd4, which the second screenshot calls an inaccuracy since it loses 0.4 centipawns.

If you're interested in this you might also want to check out this question. There's a good chance the computer will say on move nine that 8...Qh4+ is the best move, and then (after you execute it) say that 8...Qh4+ is an inaccuracy.

\*Depth is a number that describes how far ahead the engine is searching. It is usually measured in ply, so d = 20 is 20 ply (or 10 moves) ahead.

# Answer
> 17 votes
Don't read anything into it. This is the fault of chesscom's poor interface and has no deeper meaning. Every other website I know of does not have this issue. You should trust the current evaluation and not the words "good" or "great" or "inaccuracy."

The reason this occurs is simply that chesscom came up with a classification for all the moves as "best," "good," etc based on a quick overview with the engine. If you actually look at the positions and play any of the moves it originally recommended, the current engine might change its mind. In your case, after re-analyzing deeper, it sees the move it originally thought was best (cxd4) isn't as good as it originally thought.

# Answer
> 7 votes
Generally engine analysis accuracy is dependent on the analysis time and position. With more time the analysis depth is deeper and more accurate. Also depends on the position, if engine sees that the position is a mate in 3 at ply 5 even if we search it for 20 plies it is still mate in 3. But if there is no mate to be found and no repetition seen and other drawing lines then we will expect varying evaluation as we get deeper. Before cxd4 it has its own evaluation and accuracy but pushing the move cxd4 next will have a new analysis evaluation and accuracy. By pushing the move it advances the analysis 1 ply deeper plus the time that is used for this new analysis.

# Answer
> 0 votes
It depends. In the first image you posted (before White has captured the pawn), the UI says SF is at depth 20. And in the second image after cxd4 is played, SF is also evaluating at depth 20 there. At depth 20 it's normal for SF to change its mind on moves, so letting it evaluate further is recommended here.

After doing this for the position before and after cxd4, SF should give fairly consistent outputs on which move it prefers.

---
Tags: engines, stockfish
---


title: Account closed on chess.com?

text:
# Question
Title: Account closed on chess.com?
My account was closed on chess.com today for reasons that I do not understand. This morning I played nine games and won each. While I was on my tenth game, I found my account closed on Fair Play violations.

**Disclaimer**: I resorted to no Foul Play, and even if I did, for the sake of argument, how can it be proved.

# Answer
> 10 votes
Chess.com has very sophisticated cheat detection systems built by chess players and data scientists. GM Hikaru Nakamura was reportedly impressed by their system after being introduced to it by chess.com staff. The exact inner workings cannot be disclosed for (at least) two very obvious reasons:

1. If their algorithm becomes public, players could try to exploit that and evade cheat detection
2. The cheat detection system is one of the most important features of a chess platform in the competition against other platforms. chess.com has a very capable system and would help its competitors if they disclosed the exact algorithm.

For these reasons, you cannot expect detailed reasons for their decisions. Neither from any of us nor from them.

They would not ban you at all because you won several games in a row, but they would ban you if your playstyle was indicative of assisted play (i.e. help from an engine / a stronger player) and if their confidence (based on statistical measures) that you cheated is extremely high. They combine lots of variables (these could be e.g. your rating, quality of your moves, and so on) and calculate the probability for you to have played without assistance, and if that probability for that is very, very low, then they'll ban you **after a manual review**.
They don't take this lightly and it is very unlikely that you have been banned without reason. You probably have played moves that were too good for your playing strengths, maybe you played inconsistently (e.g., exceptionally engine-like in difficult situations, but pretty badly without assistance in not-so-critical situations) or too many strong moves that are very difficult to find. The exact criteria are proprietary, but this should give you an idea.

Please read Chess.com's official explanation here.

> Chess.com's fair-play system is thorough, complex and rigorously verified by more than eight years of data from millions of games played by our own members online. Our system gathers and reviews different types of data and other information pulled automatically (and manually) from all member games.

> We load these games into a tool that provides the probability that a given player is playing cleanly or with the assistance of a computer engine. Before any accounts are closed, all reports are thoroughly reviewed by a team of specialists who have reviewed and closed thousands of accounts in their roles as Chess.com statisticians.

**EDIT**: Of course, an absolutely certain proof is impossible to be given (except if they had you and your devices under secret-service-like surveillance), but their evidence is typically so overwhelming, that you would be better off admitting what you did and get a second chance from chess.com.

---
Tags: online-chess
---


# Question
Title: How do Chess Bitboards generate individual moves?
If I have a pawn bitboard like this, for example,

```
00000000
00000000
00000000
00000000
00001000
00000001
11110110
00000000

```

generating all of the, say, legal capture moves to the right will perform a north-east shift on the bitboard, like so.

```
00000000
00000000
00000000
00000100
00000000
01111011
00000000
00000000

```

Normally, moves are stored as square that the piece moved from, and square that the piece moved to, with special move considerations. But this approach, at least to me, appears to only create a map of positions that these pieces are attacking or can move to.

How would you be able to tell individual moves like this? Would you have to separate it out, i.e. create a bit-board with only one square? In a similar vein, if there were to be multiple moves, how would one be able to distinguish between them?

# Answer
> How would you be able to tell individual moves like this? Would you have to separate it out, i.e. create a bit-board with only one square? In a similar vein, if there were to be multiple moves, how would one be able to distinguish between them?

There are some different ways you could handle generating moves from bitboards.

In my engine, what I do is go through the bitboard of pawns for the side to move, and generate the moves each individual pawn has. Here's most of the relevant code:

```
func genPawnMoves(pos *Position, moves *MoveList) {
    usBB := pos.Sides[pos.SideToMove]
    enemyBB := pos.Sides[pos.SideToMove^1]
    pawnsBB := pos.Pieces[Pawn] & pos.Sides[pos.SideToMove]

    // For each pawn on our side...
    for pawnsBB != 0 {
        from := pawnsBB.PopBit()

        pawnOnePush := PawnPushes[pos.SideToMove][from] & ^(usBB | enemyBB)
        pawnTwoPush := ((pawnOnePush & MaskRank[Rank6]) << 8) & ^(usBB | enemyBB)
        if pos.SideToMove == White {
            pawnTwoPush = ((pawnOnePush & MaskRank[Rank3]) >> 8) & ^(usBB | enemyBB)
        }

        // calculate the push move for the pawn...
        pawnPush := pawnOnePush | pawnTwoPush

        // and the attacks.
        pawnAttacks := PawnAttacks[pos.SideToMove][from]

        // Generate pawn push moves
        for pawnPush != 0 {
            to := pawnPush.PopBit()
            if isPromoting(pos.SideToMove, to) {
                makePromotionMoves(pos, from, to, moves)
                continue
            }
            moves.AddMove(NewMove(from, to, Quiet, NoFlag))
        }

        // Generate pawn attack moves.
        for pawnAttacks != 0 {
            to := pawnAttacks.PopBit()
            toBB := SquareBB[to]

            // Check for en passant moves.
            if to == pos.EPSq {
                moves.AddMove(NewMove(from, to, Attack, AttackEP))
            } else if toBB&enemyBB != 0 {
                if isPromoting(pos.SideToMove, to) {
                    makePromotionMoves(pos, from, to, moves)
                    continue
                }
                moves.AddMove(NewMove(from, to, Attack, NoFlag))
            }
        }
    }
}

```

Notice how I loop through each bit of the pawn bitboard, and then generate all of the possible moves that pawn might have, verify those moves, and then loop through each bit of those move bitboards to generate each individual move.

Note `PawnPushes` and `PawnAttacks` are lookup tables where I precalculate what move has a pawn depending on it's square and color (not including double pushes, as those are calculated on the fly as you can see).

If you want to see more of the detail in my code, see here: https://github.com/algerbrex/blunder/blob/main/engine/
> 3 votes

---
Tags: engines, bitboard
---


# Question
Title: Difference between national and international rating
For extreme cases see here, but I'm interested in statistical averages.

The most skewing factor, as already mentioned there, should be underrated players, which simply haven't played against the "big fish" yet. That said, I would expect national ratings (assuming, of course, that they use a system compatible with ELO, e.g. Germany) are constantly below FIDE ones, and the larger and more active the nation is, the smaller the difference.

For example, my personal experience suggests that in average German DWZ is about 100 points lower than ELO (and for my own rating, this is even true over decades of active play!). But that's no proper way to do stats. Does anyone have validated data, especially for different countries which confirm or deny my naive assumption?

# Answer
> I would expect national ratings (assuming, of course, that they use a system compatible with ELO, e.g. Germany) are constantly below FIDE ones, and the larger and more active the nation is, the smaller the difference

This false expectation is based on the usual mistake of believing that ratings are some kind of absolute measure of chess playing ability. They are not. They are always purely relative measures with limited time validity.

> my personal experience suggests that in average German DWZ is about 100 points lower than ELO

And if you talk to Americans they usually tell you that their USCF rating is about 100 points *higher* than their FIDE rating.

When I played and arbited in Israel the generally accepted formula for conversion between the two ratings was ICF = FIDE + 90. I even remember arbiting in a tournament which was limited to players with ICF rating under 2290! A stranger number until you remember the formula. When I moved to England and stopped playing ICF rated chess I was curious as to what would happen to my ICF rating. It stayed in synch with my FIDE rating! The ICF monitors my FIDE games played and updates my ICF rating accordingly.

Note that there have been questions regarding conversions between different rating systems. This one in particular gives formulae which may have applied at the time but are unlikely to apply now.

This answer from 6 years ago gives a complicated formula for converting between USCF and FIDE. It may have been accurate then. It is unlikely to be accurate now.

This answer gives a formula (FIDE=7.5xECF+700) for converting between ECF and FIDE which is just wrong. It is debatable whether it was right at the time, despite being officially used by the ECF (I remember FIDE = 8xECF+600), but then ECF ratings had 3 digits and now they have 4. My current ECF rating is just under 1900 while my FIDE rating is just over 1700.

Bottom line: national, international and online ratings can only be meaningfully compared within the individual systems. Comparisons between systems are meaningless.
> 5 votes

---
Tags: fide, rating, statistics
---


# Question
Title: Is there such a thing as a criterion-based diploma or certification in chess skills?
The vast majority of chess titles today are fundamentally *competitive*. To be a "master" of any kind according to bodies like FIDE is defined in terms of being able to *beat others* rather than mastering a specified body of chess knowledge, theory, or skills. In educational theory, such chess titles are norm-based rather than criterion-based.

A recent question establishes that there are criterion-based *curricula* that an aspiring chess player may self-study, but it appears that none of them lead to any sort of recognized title, certification, degree, or other formal designation.

Are there criterion-based titles or other designations in the world of chess? For example, is there a "GED" type qualification that doesn't represent any particular competitive rating but represents basic competency in all of the basic techniques of chess? Are there specialty skill certifications, e.g. for openings or skewers, that are obtained by passing skills tests rather than by obtaining a specified tournament rating?

I'm mentally comparing this somewhat to martial arts, which typically award color belts based on passing tests (criterion-based) but also have a separate system of trophies and titles that can be earned by winning tournaments (norm-based).

Other common educational terms strongly associated with criterion testing are mastery learning, learning standards, competency-based education, and outcome-based education.

As to the "why", these sorts of titles could appeal to people who see chess as more of a form of mental exercise for themselves than an opportunity to pwn noobs.

# Answer
The short answer is "No".

The kind of certification you describe serves three purposes:

1. It serves as a gate for a job. For instance in the UK police and nursing are graduate only professions despite the fact that a degree has no useful benefit for a nurse or policeman/woman.
2. An academic form of qualification. For instance The ABRSM and Trinity School of music have a grade system of music achievement. When I was growing up Grade 5 equated to an "O" level (qualification taken at age 16) and a grade 8 to an "A" level (qualification taken at age 18). If you want to study music at university then you will generally require a grade 8 qualification in your instrument.
3. As motivational devices for young children, a bit like scout badges or girl guide badges.

The problem is that none of these really work in the world of competitive chess. Tournament results and ratings are a much better measurement of achievement and ability. I know the old saying "There's a sucker born every minute" has an element of truth but given the choice between paying for a certificate that says you've mastered skewers and playing real chess in a competition most people are going to choose the latter every time.

Of course there are two areas of the chess world where certification and qualifications are important and those are in the fields of arbiting and training and FIDE has arbiter qualifications and trainer qualifications which require courses and passing exams but they are for people who want to be arbiters or trainers, not chess players.
> 9 votes

# Answer
Picking up on part 3 by Brian, indeed there are such things as "Bauerndiplom" for (not exclusively!) kids in Germany. The questionnaire is built by the national federation, the test usually done by the clubs. Naturally, it's more like a decorative diploma landing in some drawer, but then, my official FM title can't buy me anything either...
> 3 votes

# Answer
The answer is 'yes', but it might not be the answer you're looking for.

FIDE awards criterion-based titles for achievement in chess. Here for example are the requirements to become a Grandmaster (which is the highest title except World Champion):

> * An Elo rating of at least 2500 at any point in their career (although they need not maintain this level to obtain or keep the title).
> * Two favorable results (called norms) from a total of at least 27 games in tournaments. With some exceptions, to receive a norm in a tournament:
> * The player's rating performance at the end of the tournament must be at least 2600. (Tournaments are no longer classified in categories.)
> * At least 33% of the player's opponents must be Grandmasters.
> * At least 50% of the player's opponents must hold a FIDE title.
> * The player's opponents must have an average rating of at least 2380.
> * The player's opponents must come from at least 3 different chess federations, which can include the player's own federation. A maximum of 60% of a player's opponents can come from the player's own federation. A maximum of 66% of a player's opponents can come from a single federation.

But being a grandmaster doesn't mean you are, e.g., able to execute a bishop and knight mate.
> -1 votes

---
Tags: learning, training, titles
---


# Question
Title: What do you do when an opponent asks for a score sheet after a game in which recording is not compulsory?
I wish to know how to handle a certain situation regarding chess etiquette. Consider the following:

I went for an OTB tournament recently - rapid 15 + 10 time control. Organizers stated that recording is not compulsory, but I still recorded for the purpose of post-mortem analysis. One of my opponents didn't record the game himself but he asked me for a photo of my recording sheet after the game ended, which I had recorded on my own time during the game.

Should I let him take a photo or ask him to record his game himself if he wants to do post-mortem analysis? I let him take a photo but I feel a bit sour now, considering that it's pretty unfair that I spent some of my own time recording instead of thinking - or am I being a bit petty? Also we'll probably meet in some other tournament again just that he's in a better position to prepare against me now.

# Answer
> 23 votes
You did the right thing! I would definitely allow my opponent to take a picture of the scoresheet. There is no need to be sour, as it is very unlikely you had or will have any disadvantages from **his** behaviour. It was your choice to spend time recording the moves and one single game will not help him in a meaningful way to prepare against you next time, even if he didn't have ChessBase. Even if it did, you would still need to be matched.

Of course, it would not have been sportsmanlike if he had already started to record the moves and stopped doing that after noticing you keep recording the moves **only in the hopes of getting them from you later**. In this case, rather than alleging that so. has such dishonest motives, grant him the benefit of the doubt and show magnanimity. In the case described, I would assume that he would not have recorded the moves anyway and only asked for the sheet because it was nice to have.

Try to separate your emotions about the game itself from such questions. I find it hard to believe that you would have such thoughts if you had taken the full point effortlessly. If that player does not already have a reputation for taking advantage of others, I will second Brian Towers' opinion that refusing the scoresheet would appear rather petty.

# Answer
> 12 votes
> Should I let him take a photo or ask him to record his game himself if he wants to do post-mortem analysis?

The FIDE Laws of Chess say this about the ownership of the scoresheet:

> 8.3 The scoresheets are the property of the organiser of the competition.

and they say this about sharing the scoresheet:

> 8.5.2 If only one player has not kept score under Article 8.4, he must, as soon as either flag has fallen, update his scoresheet completely before moving a piece on the chessboard. Provided it is that player’s move, he may use his opponent’s scoresheet, but must return it before making a move.

So, you are not allowing your opponent to take a photo of *your* scoresheet, you are allowing your opponent to take a photo of the *organiser's* scoresheet for your game and there are certain events which can happen during the game which *require* you to share the scoresheet you are keeping.

Although the rules are silent on what happens after the game regarding sharing the scoresheet it would appear churlish to deny your opponent a photo. Arguably your opponent needs the permission of the organiser, the owner of the scoresheet, not you, in order to make a copy.

# Answer
> 6 votes
It seems likely that someone who doesn't record moves themselves wants a picture for personal gratification \['my first chess game in a real tournament!!!'\], rather than deep study for which they maliciously offloaded work to you.

Therefore refusing a picture of this is not a matter of some sort of 'game edge' you are denying, it is simply a personal request which provides no harm to you and some enjoyment to the other player.

# Answer
> 4 votes
This is an incredibly legalistic argument over a simple matter of common decency. Rules have no place here. Use your common sense and be as nice to your opponents as they are to you.

# Answer
> 2 votes
This is too long for a comment, but Brian Towers answer as it currently stands is legally wrong. It is true that the score sheets are property of the organizers. But the document you wrote during the game is not a score sheet as understood by the rules, these are just your personal notes that happen to have a form that is very similar to a score sheet.

Score sheets have to satisfy a whole bunch of rules on what is and isn't written there, how it is written and which notation has to be used. Your personal notes are not bound by any of these rules. You could have skipped a few moves, you could have written down some variant that wasn't actually played in the game, you could have used your personal notation, maybe you didn't even write down the game at all but rather some general impressions of the tournament. All of these things would get you in trouble on an official scoresheet. None of them matter on your personal notes.

What you wrote are your personal notes and you are free to do with them as you please.

All that being said, personally I would consider it impolite to not share them if the other player asks nicely. This is just information, you lose nothing by sharing but the other player gains something.

# Answer
> 2 votes
You dont have any obligation. If I was playing a friend I would give it to them but if I thought he was doing it to gain an advantage, which he is by forcing you to use your time, I wouldn't.

He is choosing to not record the game. If you give it to him its a favor.

Besides, how does someone not remember the game they just played? Thats just laziness. Back in the day, before smartphones and before I had internet, I would go down to the local library and play online for 4-5 hours then come home and transcribe the 10-15 most interesting games. How can someone not remember ONE game they just played?

---
Tags: rules, fide, tournament, etiquette
---


# Question
Title: At what time control do you stop recording your moves?
I've been to a 15|2 (Fischer) tournament where it was not necessary to record your moves and I've also played in longer games where it was expected. My question is at what time limit are you no longer expected to record your games (generally speaking)?

More specifically, would you expect to have to record your moves in a G30 tournament?

# Answer
> 11 votes
Anything less than or equal to G/29 does not require you to record moves, according to USCF. Otherwise known as Blitz and Quick, they have a separate rating for those time controls.

Reference: An Introduction to USCF-Rated Tournaments \[PDF\]

So, yes, you do need to record your moves in a G/30, because that is considered Standard time control.

There is a rule that allows you to stop recording once you (or your opponent) have less than 5 minutes on the clock, in Standard time control games. See #7: USCF - FIDE Rule Differences - 2 Columns

Additionally, if you have an increment of 30 seconds or more, it looks like you have to record moves regardless of the time left on the clock. (I wonder if people really have that sort of increment in tournaments.)

# Answer
> 3 votes
I always write my moves down even in 30 minute games; I get funny looks, but I can record 3/4 of the game before the position deems otherwise.

# Answer
> 1 votes
My memory is a lot better than my handwriting. I just do the best I can and try to fix it after the game. I will say though that anything over 30 minutes a side and Im not worried about time. I may even get up and wander around, go to the bathroom, or look for a food truck etc..

---
Tags: tournament, notation
---


# Question
Title: Historic time controls for World Championships
According to the answer to this question we know that currently it is 100 minutes for 40 moves followed by an additional 50 minutes for 20 moves then an extra 15 minutes to finish the game with a 30 second increment from move 1 which works out at 3 minutes a move for the first 60 moves.

I remember from 20 years ago in the early days of digital clocks it was very similar. The one difference being that the players got 10 minutes to finish the game according to Bill Goichberg of the USCF.

Back in the day of analog clocks, when Fischer beat Spassky for the world title it was 40 moves in 150 minutes (no increment) plus 60 minutes for each 16 moves after that until the game was decided with adjournment with a sealed move after 5 hours play. So players were getting 3 minutes 45 seconds per move.

Back in Paul Morphy's day there were no time controls for world championship matches.

Can anyone fill in the gaps and identify when the time controls changed and to what?

# Answer
> 10 votes
I have spent far too much time on this as is, but here we go. Time control phase X/Y means X moves in Y minutes for each player, + means increment per moves (in seconds).

## Steinitz's era

An idiosyncratic era with matches decided by direct negotiations.

* 1886: Steinitz-Zukertort, FT10 wins with 8-8 or 9-9 declared as draw
    + 30/120 then 15/60
* 1889: Steinitz-Chigorin,?
* 1890: Steinitz-Gunsberg, FT10 wins with 8-8 or 9-9 declared as draw
    + 26/210 then 15/60
* 1892: Steinitz-Chigorin, ?

## Lasker's era

The time control for all of these is 15/60, except Lasker-Marshall 1907 and Lasker-Janowski 1910 which I couldn't find.

* 1894: Steinitz-Lasker, FT10 wins
* 1896: Lasker-Steinitz, FT10 wins
* 1907: Lasker-Marshall, FT8 wins
* 1908: Lasker-Tarrasch, FT8 wins
* 1910: Lasker-Schlechter, BO10
* 1910: Lasker-Janowski, FT8 wins
* 1921: Lasker-Capablanca, FT8 wins

## Alekhine's era

Capablanca's "London Rules", subsequently adopted by Alekhine, made this fairly regular. Formats is first to 6 wins capped at 30 games, except the 1927 match which had no game limit. Time controls are 40/150.

* 1927: Capablanca-Alekhine
* 1929: Alekhine-Bogoljubov
* 1934: Bogoljubov-Alekhine
* 1935: Alekhine-Euwe
* 1937: Euwe-Alekhine

## FIDE 1948

After the death of Alekhine, a quintuple round-robin with five of the best players in the world (Botvinnik, Smyslov, Keres, Reshevsky, Euwe). Botvinnik won. Games were 40/150 followed by 16/60.

## FIDE era I

FIDE's championships were generally of a standard format, notwithstanding player disputes, leg-swinging, yoghurts and gurus, return matches and off-the-board politics.

All matches from Botvinnik-Bronstein 1951 to Kasparov-Karpov 1990 were 40/150 followed by 16/60.

All were also BO24 (champion retains title if 12-12), except the cancelled Fischer-Karpov 1975 (that was a point of contention in the negotiations), Karpov-Korchnoi 1978 and 1981, and the aborted Karpov-Kasparov 1984, which were all first to 6 wins.

## A mess

Welcome to the era of FIDE and PCA and general chaos.

### Direct matches (PCA/BrainGames/whatever really)

* 1993: Kasparov-Short, BO24, champion retains if 12-12
    + 40/120 then 20/60 then adjournment
* 1995: Kasparov-Anand, BO20, champion retains if 10-10
    + 40/120 then 20/60 then G/30
* 2000: Kasparov-Kramnik, BO16, champion retains if 8-8
    + ? There is a time control at 40 moves but I can't find the details.
* 2004: Kramnik-Leko, BO14, champion retains if 7-7
    + ?

### Direct matches (FIDE)

* 1993: Karpov-Timman, BO24, tiebreaks if 12-12
    + 40/150 then 16/60
    + Tiebreaks four sets of two games at 40/60 then 20/15
* 1996: Karpov-Kamsky, BO20, tiebreaks if 10-10
    + 40/120 then 16/60 then adjournment
* 1998: Karpov-Anand, BO6, tiebreaks if 3-3
    + I can't find the details.

### Knockout (FIDE)

Because FIDE had the brilliant idea to create a knockout format and further annoy the champions and challengers.

* 1999 (Khalifman), 2000 (Anand)
    + 40/100 then 20/50 then G10+30
    + Tiebreaks G25+10 rapid, G15+10 blitz, Armageddon G5 vs G4 (+10 second increment?)
* 2002 (Ponomariov), 2004 (Kasimdzhanov)
    + 40/75 then G15+30 (in 2004, 40/90 then G15+30)
    + Tiebreaks G20+10 rapid, G5+10 blitz (?), Armageddon G6 v G5

## FIDE era 2

The reunification of the championship begins with an 8-player double round-robin in 2005.

* 2005 (Topalov)
    + 40/120 then 20/60 then G15+30

Sanity ensues when Topalov wins in 2006, and from there everything becomes much nicer.

* 2006 to 2014: BO12, tiebreaks if 6-6
    + 40/120 then 20/60 then G15+30
    + Tiebreaks 1 set of 4 games of G25+10, then 5 sets of 2 games of G5+3, then Armageddon G4 v G5 with +3 seconds increment from move 61 and above.

In 2016 the classical time control was tweaked slightly, but format and tiebreaks remained the same.

* 2016 and 2018: BO12, tiebreaks if 6-6
    + 40/100+30 then 20/50+30 then G15+30
    + Tiebreaks see 2006-2014.

## Sources

Wikipedia, chessgames.com, Edward Winter's history pages, Mark Week's WCC pages, 2005 FIDE regulations (Wayback Machine, .doc file), FIDE regulations (.pdf files) (2012, 2013, 2014, 2016, 2018, and a bunch of books and other pages I am not fully remembering now.)

# Answer
> 1 votes
The 1890 match between Steinitz and Chigorin used: 30 moves/120minutes, then 15/60

(Source: Bachmann: Schachmeister Steinitz, v. 3, p. 231)

However, Steinitz's claim that this was a WCh does not seem to be entirely believable.

---
Tags: rules, world-championship, time-control
---


# Question
Title: Is it improper etiquette to ask your opponent what his/her rating is before the game?
Suppose you're playing in a tournament. For the purpose of filling up your scoresheet, is it improper etiquette to ask your opponent what his/her rating is before the game?

# Answer
> 30 votes
Yesterday, I played a tournament match, and at the table next to me the guy asked his opponent for his rating. “I don’t really know...” was the reply, “about 1580, I think. And yours?”

“Euhm... about 1400”, the guy mumbles in reply.

If you don’t want to give out your exact rating in reply or you don’t know it yourself, I would not ask the question to begin with. Furthermore, I thought the question was bad etiquette and would not really be happy with my opponent asking it.

Finally, where I live, most tournaments have lists of all participating players and their rating which you can look at. So start the game, and then after a couple of moves, when your opponent is thinking, you can always go check the list.

PS: I find that I play better when I don’t know my opponent's rating. Once I know his rating is a lot better, I get nervous and consider myself lost from the start. When I know his rating is much lower, I tend to play reckless and make mistakes.

# Answer
> 26 votes
I don't think this would be a breach in etiquette - but I think it is a somewhat **dangerous thing to do for you**. Chess is as much about mental fortitude as it is about "playing skill" and regardless what your opponents answer is - it can get into your head and affect your play.
If your opponent is a lot lower rated than you are, it tempts you to play these "Maybe he won't see it" moves, if he is higher rated, you might overestimate a bad sacrifice or a blunder he does.

Considering the mental effects of a move, before and during the game, may prove to you as useful as considering the positional effects.

# Answer
> 10 votes
It isn't a breach of etiquette and is quite common in tournaments. Many scoresheets have a place to write the opponent's rating, so a lot of players ask while filling it out at the beginning of the match.

There's no shame in being low-rated anyway. With the exception of top players, we're all novices compared to someone.

# Answer
> 5 votes
Some people are a bit self conscious if they are lower rated - better to look it up on the tournament list or ask a teammate.

That said, if it's a team game and I don't recognise the opponent or their name on the team sheet then I might ask - I do feel it is important to have a ballpark idea of your opponent's strength.

You could also try google if most of your opponents are \>1800 FIDE

# Answer
> 1 votes
Some think it is a breach in etiquette, some think it isn't. I believe it is not a breach in etiquette as long as you are free not to answer.

I see the benefit of only playing the looks and the moves of your opponent; I also see the benefit of 'knowing the odds', ratings open on the table.

If you know you statistically are going to lose 4 out of 5 games against your opponent, you still have to produce the quality that got you here to earn this 1 out of 5; and vice versa. If you are oblivious of each other's rating- it is the same.

Still, it is a different game between players who know each other's rating than between players who don't. And there is the third possibility, where one side knows both ratings and the other one doesn't (add an extra star here if one manages not to know one's own rating). I do not want to make a definite choice here, I would prefer to have a freedom of.

So imagine a dialogue before a game going: Would you mind telling me your rating, please? Sure, my rating is xy, please mind not telling me your rating, in return. Or: What's your rating, please? I will not tell you mine, but feel free to look it up. Okay, thank you, I will. By the way, my rating is xy.

It's all a laugh, of course, but in regular intervals somebody's got to give. We cannot respect the wish of players X to remain unaware of the ratings of opponents Y and the wish of opponents Y to inform players X of their ratings at the same time. Or, yes, we can respect, just not fulfill both wishes.

---
Tags: tournament, etiquette
---


title: Software with tabulated notation

text:
# Question
Title: Software with tabulated notation
I am looking for a software that allows tabulated notation.

Example:

Is there any software that allows notation in this way? I would prefer desktop application software.

In ChessBase I can't find an option that allows you to view the notation in this way, but if it is possible or there is a version that allows it, tell me which version.

# Answer
> 3 votes
Not quite on point, but here are three suggestions

1. Something somewhat similar can be used online, so you might want to get in touch with admin(at)chesstree.net or simply use their site, which is found here. (May well be that admin also has developed a parser and sends you a copy of it for displaying the trees in text format.)
2. The website studyopenings offers a tabulated view of imported pgn-files, as well as exporting them, however the tabulated displaying isn't persistent.
3. Lastly, on tailuges github you'll find another option that is slightly off of what you ask for, but again getting in touch with its author may turn out to be most helpful.

Good luck in your games!

---
Tags: notation
---


# Question
Title: White is up +7 in material, why is white still losing?
Why do you think white is losing here?

# Answer
White's king is dangerously exposed. 1...Bxf4 2. gxf4 g3 and how is White going to avoid checkmate? 3. Qg2 Nh3+ 4. Kh1 Nxf4+ wins the Queen, while 3. Kg2 Qh2+ 4. Kf3 g2 threatening Qxf4+ is almost checkmate as well.

So Black wins. Don't just count material, the ultimate goal of the game is to checkmate.
> 11 votes

# Answer
In addition to the other excellent answers highlighting the number of Black pieces aimed at White's King and Allure's correct analysis, it seemed concrete variations were the only useful thing to add to this Q/A.

White is losing because all roads lead to forced checkmates for the reasons identified by the other answers. Specifically, after **1. Qb7**, Black has a forced checkmate in 19 moves. Diagram & lines courtesy of Stockfish 14+ NNUE (depth = 41+, 18225k nodes/s).

Interestingly, all of the captures and subsequent promotions with the g-pawn on Black's 7th move lead to mate in the same number of moves as 7...Qh3+.

```
[FEN "N4r1k/p7/7q/4b3/2P2Np1/1Q1Pp1P1/PP3n2/R4RK1 w - - 0 1"]

1. Qb7 Bxf4 {2. gxf4, Qd5, Qg2} 2. gxf4 {This move delays the longest.} 2...g3 3. Kg2 {3. Qg2 and 3. Rxf2 lead to getting mated quicker} 3...Qh2+ {3...Qh3+ also strong, 3...e2 is a draw} 4. Kf3 g2 {Black's only move for a win.  4...g2 is a draw} 5. Qc7 {5. Rg1, 5. Kxe3 both lead to quicker mates} 5...Re8 {5...Qh3+ also wins by force} 6. Qe5+ {6. Qc8 and 6. Rxf2 lead to quicker mates} 6...Rxe5 7. fxe5 Qh3+ {Interestingly, all of the captures and subsequent promotions with the g-pawn lead to mate in the same number of moves as 7...Qh3+.} (7... gxf1=Q 8. Rxf1 Qh3+ 9. Ke2 Ng4 10. Rf8+ Kg7 11. d4 Qg2+ 12. Kd3 e2 13. Nc7 Kxf8 14. Ne6+ Kg8 15. Nf4 Qf3+ 16. Kd2 e1=Q+ 17. Kxe1 Qf2+ 18. Kd1 Ne3+ 19. Kc1 Qc2#) (7... gxf1=R 8. Rxf1 Qh3+ 9. Ke2 Ng4 10. d4 Qg2+ 11. Kd3 Qxf1+ 12. Ke4 e2 13. Kd5 e1=Q 14. Nb6 Qf3+ 15. Kd6 Qb4+ 16. c5 Qxd4+ 17. Ke6 Qxe5+ 18. Kd7 Qb7+ 19. Kd8 Qee7#) (7... gxf1=B 8. Rxf1 Qh3+ 9. Ke2 Ng4 10. d4 Qg2+ 11. Kd3 Qxf1+ 12. Ke4 e2 13. Kd5 e1=Q 14. Nb6 Qf3+ 15. Kd6 Qb4+ 16. c5 Qxd4+ 17. Nd5 Qdxd5+ 18. Kc7 Qff7+ 19. Kb8 Qd8#) (7... gxf1=N 8. Rxf1 Qh3+ 9. Ke2 Ng4 10. Rf8+ Kh7 11. Rf7+ Kg8 12. Rg7+ Kxg7 13. d4 Qg2+ (13... Qh2+ 14. Kf3 e2 15. Ke4 Qg2+ 16. Kf5 e1=Q 17. b3 Qef2+ 18. Ke6 Qc6+ 19. Ke7 Qh4#) 14. Kd3 e2 15. c5 e1=Q 16. Kc4 Nxe5+ 17. dxe5 Qge4+ 18. Kb5 Q1b4+ 19. Ka6 Qeb7#) 8. Ke2 gxf1=Q+ 9. Rxf1 Ng4 10. Rf8+ (10. d4 Qg2+ 11. Kd3 Qxf1+ 12. Ke4 Qg2+ 13. Kf5 Qxa8 14. Kxg4 Qe4+ (14... Qf8 15. e6 e2 16. e7 Qxe7 17. Kf4 e1=Q 18. Kg4 Q7e4+ 19. Kg5 Q1h4#) 15. Kg5 Qf3 16. e6 e2 17. a3 e1=Q 18. Kg6 Qeg3+ 19. Kh6 Qh1#) 10... Kg7 11. d4 Qg2+ (11... Kxf8 12. Nb6 Qg2+ 13. Kd3 e2 14. Nd7+ Ke7 15. Kc3 e1=Q+ 16. Kb3 Qb7+ 17. Nb6 Qxb6+ 18. Kc2 Qe2+ 19. Kb1 Qbxb2#) 12. Rf2 exf2 13. Kd2 (13. Kd3 Qf3+ 14. Kc2 f1=Q 15. b3 Q1g2+ 16. Kc1 Qff1#) 13... Qf3 14. Kc2 f1=Q 15. b3 Q1e2+ 16. Kb1 Qh1#

```

With perfect play, White is already lost. There are no good options. White gets checkmated either way: 1. Nh3 is -M8, 1. Kg2 is -M9, and 1. Ng6+ is -M13. The analysis above shows 1. Qb7 leads to mate (-M19). Stockfish prefers sacrificing the Rook for the Knight with 1. Rxf2 but this seems to just lead to a longer mate (-M22).

Note: -M*x* means Black has a forced checkmate in *x* moves.
> 4 votes

# Answer
Without really analyzing this position in depth, Just at first glance. Black has four pieces aimed at White's king and White's pieces are mostly misplaced. White's rook on a1 is doing nothing and his knight on a8 is going to take a couple moves just to be a useful piece.

Black has a lot of potential threats. Qh1. Qh2, e2, Bxf4, Nh3+ etc. Yes, white is defending most of that right now but I would be willing to bet there's a really strong combination combining two or more of those threats that's pretty devastating.
> 3 votes

# Answer
Some thoughts:

* the only thing preventing white being checkmated is the queen guarding h1. Which dramatically reduces the queen's value.
* white's knight is in the corner, a terrible place in general for a knight, and very far from the action
* black has many targets: h1, g3, d3, and the threat of queening at e1. White doesn't have much except Ng6+.
* after Bxf4, gxf4 g3, it becomes a desperate battle to avoid mate.
> 2 votes

# Answer
*“If your opponent offers you a draw, try to work out why he thinks he’s worse off.”* – Nigel Short

I disagree with your premise that white is losing here, and with the answers so far. But this is based on my working-out, and not on the force of NN, so caution is advised.

# Q: Why do you think white is losing here?

I don't, and here is why: If it's white to move, then in order to be a losing position, there need be refutations of every white attempt at black's hands in the given position. I don't see any such forcing and refuting line, for several candidate moves that is; in fact, I see black being in danger here. Black is left with trying to hinder white's looming attack by means of their current initiative, heading into a perpetual check sooner or later.

Among the candidate moves are

**Rxf2, *the drastic solution***: after exf2 and Kxf2, black is asked to find Rxf4, which allows them to land a perpetual on rank 1 and 2 with white's attempt to flee via Kb3 covered by Qxb2.

**Kg2, *the sharp counter***: the threat of Rh1 must be parried, but neither Rb8 nor Q-- nor K-- do the job, so black is left with allowing Rh1, banking on the interposing Nh3. So, after Kg2, black takes on f4 with either rook or bishop, and then seeks perpetual check again after Rh1, Nh3, gxf4 and Qh4.

**Qd5, *the fast ignoramus***: activating the queen asks black to find Bxf4. If found, several sublines are playable after white takes back with gxf4, but none of them yield more than a draw for black. Black may push g3, but white calmly plays Kg2 and smiles, since both Qh2+ and Qh3+ are answered by the daring Kf3, now making fun of blacks mating attempt. Instead of g3, black had Nh3+, prolonging, and the drastic Rxf4, shortening the game; black is on the lookout for a perpetual check, and without their bishop covering b2, they need to cage in whites king near the h1 corner.

**Nc7, *the slow ignoramus***: even this slow approach can't be forcibly lead into troubles for white. Blacks best bet is still to capture on f4 with their bishop, and after gxf4, either push g3 or play Nh3+, but both attacks can be disarmed by white, who still enjoys the drastic Rxf2, as well as the daring escape with Kf3. White may even allow promotion, since black's initiative will either end in perpetual or in them losing the game, gifting half a point.

# Conclusion

To my understanding, the given position is a draw, because white has no way of stopping black from (either) delivering perpetual check (or regaining material equality in certain sublines), and because black is on a clock, having to cash in their current initiative before white consolidates and wins by force.
> 0 votes

---
Tags: analysis
---


# Question
Title: What is the maximum number of moves in a position of Crazyhouse?
We know that the maximum number of moves for a given colour in a *legal* position of standard chess (or at least record so far) is 218.

What is the record we can come up with for Crazyhouse?

Note that moves can be:

1. moves in standard chess
2. piece drops of a piece onto any empty square, or a pawn onto any empty square except on the 1st or 8th rank

A reasonable starting idea might be to have an empty board with just the two kings and White having all other pieces in its inventory. Then (let's say the kings are on e2 and d7) you have 8x2 king moves, plus piece drop of bishop, knight, rook, queen on any of 62 squares (62x4 moves), plus piece drop of a pawn on any of 44 squares for a total of 8x2 + 62x4 + 44 = 308 possible moves.

Note that, due to the stacking nature of pieces and pawns, we cannot count them individually. We may only count with what is on top of the stack.

# Answer
> 6 votes
# 446 moves

**Disclaimer**: this answer is based on the premise that we account for white moves only, and it treats having a full set of enemy pieces as having 5 options to place something.

```
[FEN "K1QQQQ1Q/Q7/Q7/6Q1/1Q6/7Q/Q6B/1QQQQQnk w - - 0 1"]

```

White has promoted to a queen a maximum of 15 times, with a complete set (Q, R, B, N, p) still at their crazy disposal. The last move was Ng1. White now has

* 2 king moves
* 28 vertical queen moves from eighth rank
* 3 lateral queen moves on eighth rank
* 31 diagonal queen moves from eight rank
* 14 moves for the queen on a7
* 15 moves for the queen on a6
* 21 moves for the queen on g5
* 20 moves for the queen on b4
* 16 moves for the queen on h3
* 16 moves for the queen on a2
* 7 bishop moves from h2
* 26 vertical queen moves from first rank
* 2 lateral queen move on first rank
* 28 diagonal queen moves from first rank
* 217 placements (41 à 5 + 3 à 4).

or a total of **446** moves.

# Answer
> 1 votes
I began the auction with a bid of **350 moves.** Optimization are abound to be found.

```
[FEN "NQQQQQQB/Q6Q/Q6K/Q6R/Q6R/Q6R/Q5RB/nQQQQQBk w - - 0 1"]

```

Here is the receipt:

* Qa2-a6: 11\*6
* Na8: 2
* Qb8-f8: 11\*5
* Qg8: 10
* Bh8: 7
* Qh7: 11
* Kh6: 3
* Rh5-h3: 6\*3
* Bh2: 5
* Rg2: 10
* Bg1: 5
* Qf1: 10
* Qe1-c1: 11\*3
* Qb1: 10
* & 3 different pieces, pawn, knight, and bishop, in White's inventory\*35 drop squares.

# Answer
> 1 votes
If I count correctly, this improvement on Peter's answer is is 432 moves. Basically, I tried to get a queen on every rank, file, and diagonal - although the long diagonal with the kings is empty, which may be a way to improve it.

```
[fen "KQQQ2QQ/Q7/7Q/7Q/Q7/Q6Q/Q6b/1Q2QQnk w - - 0 1"]

```

---
Tags: problems, chess-variants, records, crazyhouse
---


# Question
Title: Is playing stronger opponents useful as a beginner?
I have signed up to a chess website and there are very few people who are as bad as I am (rating around 800), so I have to resort to playing against people who are much better (1200+) and end up beating me very quickly.

I do analyze the games to see what went wrong but I am wondering if it's even worth going up against players much better than me, since I don't get to even the end game stage.

# Answer
As long as you're also playing players of your rating (and lower) along with the higher rated players it's okay. You don't want to be discouraged by losing every single game you play. Ideally you want to play people higher rated than you more than lower rated because it's like getting a free lesson - a higher rated player will be able to take advantage of your mistakes more than a lower rated player.

At a 800 rating, you'll want to focus on basics (basic opening principles, tactics, safety, thinking processes etc.) and review your games for common mistakes to pinpoint weaknesses and then eradicating them.

Of course, you'll also want to play slow time controls more than fast time controls as you want to be able to think about your moves and then be able to go back and correct your thinking. Faster games involve a lot of intuition and at your rating you won't really have a lot of it. So you'll want to develop that by playing slow time controls. Besides, you don't want to mess up games and then excuse yourself by saying that you didn't have enough time on your clock.

Also, you should begin reviewing some (master) chess games. A decent beginners book is Logical Chess by Irving Chernev. Don't review modern GM games yet as those are generally a lot more difficult to understand.
> 10 votes

# Answer
Playing somewhat stronger opponents is fine. If they are too strong it does not make much sense. However, there are a few things you can do that will likely very quickly improve your rating so that you have more opponents of roughly same strength.

1) Make sure you do not hang pieces.

The majority of games at the lowest level is decided by who makes the worst mistakes, blunders a quick mate or just hangs too many pieces. You have to learn to avoid this at all cost! So, play slow time controls and before each move make a blunder check to test whether your move actually hangs a piece (or even just a pawn).

2) Work on your basic tactics.

First, also your opponents will likely hang pieces from time to time. So before really starting to think deeply see whether there is something you can easily snatch off. Further, you should become acquainted with basic tactical patterns such as skewers, forks, discovered attacks, double attacks, and also basic mating patterns. There are plenty of books covering these patterns at a basic level. Note that it is not sufficient to just know the pattern, but you have to solve sufficiently many tactical exercises so that you really know it by heart. At some point you will realize that, at least easy ones, you see instantaneously without actually having to look for them. That is exactly what you want to achieve.

If you do a couple of exercises each day (first sorted by tactical topic, later also mixed problems, where the tactic you're looking for is not given), it is likely that you will very quickly see a dramatic improvement in your games.
> 2 votes

# Answer
I don't know what a rating of 800 means since you don't mention the website.

If you're getting crushed every time, you need to play weaker players - it's no fun getting mauled.

That being said, if 800 is a beginner rating, then you'll likely improve quickly if you work at the basics and you'll have more people around your rating.
> 0 votes

# Answer
it helps to play stronger players so 1000 vs your 800 would help

but playing much stronger players wont help at all

what you need is to play over grandmaster games to get a feel for what good moves are in the openings and see how they do middle games

you need to work on solving problems to learn to recognise patterns easily and use them in your games

a few key books would also help start with a book on one openign you like and learn all you can about that

you will need end games but that can come later

a book on positional play and pawn formations woudl be useful

playing weak 1000 players wont help nearly as much as focused study

playing somewhat stronger players when you hit 1800 or so will help you learn to use what the books taught you
> 0 votes

# Answer
Playing against stronger opponents, even much stronger opponents, *can* be very useful. The key as to how useful depends on what you do during and after the game to allow you to learn and improve. There are two key things can make your thrashings really useful:

1. After - Get your opponent to go over the game with you and explain what they were thinking and where they think you went wrong. Obviously this works much better over-the-board (always the best way to play your chess) rather than online.
2. During - Record the game (if you play online then that should record your moves for you) and analyse the game afterwards. Ideally you would play the game out on a real board and write down your thoughts and analysis as you go along. Then get a stronger player (helps if you are a flesh-and-blood member of a real chess club) to go over your analysis with you point out what you got right and wrong in your analysis. Finally (and failing having a real human being to help you) go through the game with an engine and see what it thinks of your analysis and improvements.

Obviously just playing mindless games, whether against stronger opponents or weaker ones, is not going to teach you anything nor help you to improve. You need to do some work afterwards to benefit.
> 0 votes

# Answer
It is always beneficial to play against stronger opponents, even if it feels frustrating to lose a lot. You learn from them while losing, but they don't learn anything at all winning against you, so actually, you are the one who is winning at the end of the day ;-)
> -1 votes

# Answer
One of the best ways to improve in chess is to play against stronger opponents. I do this and it help me a lot. But I always play against weaker players. But, of course, I study endgames. I know people who only study openings for years and never improve. In a 100 hours of study I suggest 50 hours for endgames, 30 for middle game and 20 for openings. Start with 1. e4 at the beginning and let 1, d4 or 1.Nf3 for later. Tactics are very important for a chess player and open games is better for this learning.

And play. Play a lot.

Good luck.
> -2 votes

---
Tags: rating, beginner
---


# Question
Title: Has anyone done a correlation of castling with winning and losing?
I saw this question: How often does castling occur in grandmaster games?
The statistics are interesting. The answer states that they do so about 90% of their games.

So, the move seems pretty valuable. But this then prompted in my mind the question -- has anyone done an analysis that would further prove that it is a good idea to castle? I mean, every game is unique, but does castling correlate with winning?

(I'm thinking of a straightforward ratio, simple differential analysis, a comparative winning percentage in the two subsets. But getting a valid answer might require deeper skill with statistics than I possess if there are subtleties here.)

Also, I suppose that if one can do this analysis, one could further break down the question into the comparative gain/loss of kingside and queenside castling.

**EDIT**: Sorry if this causes too much discussion of refining my question. I certainly am inviting someone to ***do*** such a statistical analysis, looking for correlations. But I was mainly asking if someone had *already done* any such thing -- asking: "Do you know of a paper/article treatment of it?" (Mind you, not one that just gives advice, but one that calculated some statistics from a game database.)

If we are going to try to work out the exact formulation of the items that could be measured, and then find a database and use the tools to perform it, that is a much harder question.

# Answer
> 3 votes
I calculated some statistics on games published by TWIC (issues 920-1437). After some cleaning and filtering of the database (see Methodological notes at the end), I had some 1.7 million games to work with of players rated 1000 to Magnus Carlsen.

# Castling *vs.* not castling

The first question is whether castling is associated with winning more often. The following table shows the average score in the database for white and black when castling and not castling.

|  | White | Black |
| --- | --- | --- |
| Castling | 0.540 | 0.468 |
| Not castling | 0.518 | 0.424 |

So, yes, not castling is associated with having a worse score in average (no surprise here). Now, this can mean several things:

* Not castling is detrimental for your play (in general).
* The better player doesn't let the other one castle, and profits from this.
* The not-castling player loses before even being able to castle.

# Castling long *vs.* Castling short

Another question I considered is about the differences when castling long or short, same side or opposite side. The next table shows the results for white. (The results for black are just the opposite.)

|  | % White Wins | % White Draws | White score |
| --- | --- | --- | --- |
| O-O / O-O | 39.4 | 27.8 | 0.533 |
| O-O / O-O-O | 43.1 | 19.9 | 0.530 |
| O-O-O / O-O | 44.5 | 19.9 | 0.545 |
| O-O-O / O-O-O | 41.8 | 26.4 | 0.551 |

There are small differences in score when castling one side or the other. The most clear changes are in the percentage of draws: castling same side is a little more drawish. And it is well known that castling on opposite sides brings a more imbalanced position.

The data indicates also that white's score is highest when both players castle long.

# The time of castling

Finally, a more interesting question is if it does matter when you castle. The following chart shows the proportion of wins and draws for different distances between both players castling. A difference of 0 means both players castle on the same move; a difference of 10 means white castles 10 moves later than black; a difference of -10 means black castles 10 moves later than white.

The proportion of draws is greatest when both players castle at the same time. While the proportion of wins increases with the distance between castling moves, with advantage (in average) for the player who castles last.

Does this mean that castling later pays off? Or rather, that the openings that let you castle later are favorable for you? I'd guess the key here is maintaining the uncertainty on which side you're going to castle, and then castling at the most convenient time and on the most convenient side. Of course, not all openings let you do that...

# Methodological notes

I used a collection of games published on TWIC (issues 920-1437) and parsed them to extract the necessary information using a custom made Python script. I kept all games with a normal result ('1-0', '0-1', '1/2-1/2'), where the Elo of players was known, where the ECO was noted, and with an initial FEN position not specified.

# Answer
> 3 votes
Just as you pointed out castling vs no castling win-loss rate depends on some factors like time control, playing style, etc. It is different for different players and would be better if you take a look at these statistics for individual players rather than overall stats.

---

Some online chess websites have the option to get insights from your game(s).

**Chess.com** has a paid feature which you can take a look at by going to Chess Insights.

Here are the insights from GM Hikaru Nakamura's games

**Lichess** provides you with a similar Insights feature at no cost. You can check it out by going here.

Here are some insights from my games:

As you can see the rate of losing the game is slightly higher when you *Don't castle*!

# Answer
> 2 votes
Your question will by its definition generate useless data, whilest your intent is very useful.

As @AbhyudayVaish pointed out, there are a lot of paid/free tools available that give you insights in the win/loss rate when castling (or not).

These 'insights' will lack nuances since:

1. There are openings that do have a good reputation when not castling (e.g. the Yuguslav variation of the Benko Gambit Accepted and a lot of variations in the Berlin Defense), so your stats might vary whether you often play those kind of openings or not. Better is to eliminate these games from the comparison.
2. Depending on the strength of the opponent not castling might be beneficial to you. (Much) weaker opponents might struggle punishing the lack of castling when it is beneficial. E.g. in my stats I actually have a higher score against weaker players (+5%) when not castling. Better is to only review performance against similar ratings.

Also note that castling just for the sake of castling (or because the opponent does it) is not the best motive to do it.

Let's assume we compare to similar rated opponents and we filter out most of those specific variations, then the answer to your question is the loss rate is at least 5 to 10% higher when not castling.

In short: **there is a clear correlation to not castling and losing.**

Maybe all those chess teachers and GMs are right after all? :-)

*For the record: the afore mentioned scores are based on the stats of three GMs and my own, so it's not really statistically representative.*

# Answer
> 1 votes
Here is a sample game between stockfish 15 and Stockfish 15 setup with white that cannot castle and black that can castle through the use of a starting position where white castle flag is none.

### White cannot castle but black can

FEN: `rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w kq - 0 1`
Time control: 1hr + 30s inc.
Engine threads: 2
Hash mb: 512
Condition: Black can castle, white cannot

```
[Event "Engine match"]
[Site "?"]
[Date "2022.05.25"]
[Round "1"]
[White "Stockfish 15"]
[Black "Stockfish 15"]
[Result "1/2-1/2"]
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w kq - 0 1"]
[SetUp "1"]
[TimeControl "3600+30"]

1.d4 { [%emt 0:04:19] [%eval -44,37] } 1...d5 { [%emt 0:01:58] [%eval -55,35] } 2.c4 { [%emt 0:00:42] [%eval -44,31] } 2...dxc4 { [%emt 0:00:49] [%eval -62,30] } 3.e3 { [%emt 0:01:52] [%eval -46,36] } 3...e6 { [%emt 0:01:51] [%eval -49,34] } 4.Nc3 { [%emt 0:00:50] [%eval -41,33] } 4...c5 { [%emt 0:03:10] [%eval -54,38] } 5.Nf3 { [%emt 0:01:16] [%eval -38,32] } 5...Nf6 { [%emt 0:01:47] [%eval -62,36] } 6.Bxc4 { [%emt 0:01:41] [%eval -29,35] } 6...Nbd7 { [%emt 0:00:44] [%eval -60,33] } 7.e4 { [%emt 0:01:02] [%eval -37,38] } 7...cxd4 { [%emt 0:01:48] [%eval -48,34] } 8.Nxd4 { [%emt 0:01:27] [%eval -20,35] } 8...Bb4 { [%emt 0:02:57] [%eval -34,37] } 9.f3 { [%emt 0:01:59] [%eval -33,38] } 9...O-O { [%emt 0:01:00] [%eval -47,31] } 10.Be2 { [%emt 0:01:10] [%eval -36,36] } 10...Qe7 { [%emt 0:04:06] [%eval -38,38] } 11.a3 { [%emt 0:02:47] [%eval -38,38] } 11...Bxc3+ { [%emt 0:00:58] [%eval -43,37] } 12.bxc3 { [%emt 0:00:53] [%eval -32,38] } 12...Nc5 { [%emt 0:04:56] [%eval -37,44] } 13.Nb3 { [%emt 0:01:09] [%eval -42,37] } 13...Nfd7 { [%emt 0:01:04] [%eval -40,39] } 14.Be3 { [%emt 0:01:11] [%eval -25,41] } 14...b6 { [%emt 0:01:05] [%eval -47,38] } 15.a4 { [%emt 0:02:49] [%eval -21,39] } 15...Rd8 { [%emt 0:03:15] [%eval -41,37] } 16.Qc2 { [%emt 0:01:27] [%eval -18,40] } 16...Qh4+ { [%emt 0:01:32] [%eval -28,37] } 17.g3 { [%emt 0:01:28] [%eval -11,42] } 17...Qf6 { [%emt 0:01:40] [%eval -22,38] } 18.Nxc5 { [%emt 0:01:14] [%eval -11,41] } 18...Nxc5 { [%emt 0:01:29] [%eval -19,42] } 19.Kf2 { [%emt 0:01:16] [%eval -12,41] } 19...Ba6 { [%emt 0:01:24] [%eval -12,43] } 20.Bd4 { [%emt 0:01:30] [%eval -10,42] } 20...Qe7 { [%emt 0:04:48] [%eval -14,41] } 21.Bxa6 { [%emt 0:01:20] [%eval -20,40] } 21...Nxa6 { [%emt 0:02:19] [%eval -12,40] } 22.a5 { [%emt 0:01:31] [%eval -11,41] } 22...Rac8 { [%emt 0:01:10] [%eval -14,43] } 23.Rhd1 { [%emt 0:02:24] [%eval -9,44] } 23...Nc5 { [%emt 0:01:02] [%eval -14,39] } 24.Kg2 { [%emt 0:01:39] [%eval -6,39] } 24...h6 { [%emt 0:01:00] [%eval -12,38] } 25.axb6 { [%emt 0:03:05] [%eval -8,40] } 25...axb6 { [%emt 0:01:12] [%eval -12,41] } 26.Bf2 { [%emt 0:00:50] [%eval -6,37] } 26...Rd7 { [%emt 0:01:34] [%eval -7,38] } 27.Qe2 { [%emt 0:01:38] [%eval -6,51] } 27...Rb7 { [%emt 0:03:03] [%eval -9,38] } 28.Qb5 { [%emt 0:01:44] [%eval -10,40] } 28...Qc7 { [%emt 0:01:05] [%eval -7,40] } 29.Rd4 { [%emt 0:01:35] [%eval -8,47] } 29...Kh7 { [%emt 0:01:06] [%eval 0,46] } 30.c4 { [%emt 0:01:11] [%eval 0,46] } 30...Nd7 { [%emt 0:00:56] [%eval 0,44] } 31.Rad1 { [%emt 0:01:06] [%eval 0,53] } 31...Nf8 { [%emt 0:01:02] [%eval 0,49] } 32.h4 { [%emt 0:01:13] [%eval 0,49] } 32...f6 { [%emt 0:01:00] [%eval 0,50] } 33.h5 { [%emt 0:01:08] [%eval 0,51] } 33...e5 { [%emt 0:01:02] [%eval 0,53] } 34.Rd6 { [%emt 0:01:09] [%eval 0,54] } 34...Qxc4 { [%emt 0:01:15] [%eval 0,59] } 35.Qxc4 { [%emt 0:01:40] [%eval 0,58] } 35...Rxc4 { [%emt 0:01:19] [%eval 0,58] } 36.Rxb6 { [%emt 0:02:03] [%eval 0,59] } 1/2-1/2

```

Black has the advantage for sure, but could not win it.

### White can castle but black cannot

FEN: `rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1`

```
[Event "Engine match"]
[Site "?"]
[Date "2022.05.25"]
[Round "1"]
[White "Stockfish 15"]
[Black "Stockfish 15"]
[Result "1/2-1/2"]
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQ - 0 1"]
[SetUp "1"]
[TimeControl "3600+30"]

1.e4 { [%emt 0:01:45] [%eval 82,34] } 1...c5 { [%emt 0:01:50] [%eval 97,36] } 2.Nf3 { [%emt 0:00:48] [%eval 111,34] } 2...Nc6 { [%emt 0:02:33] [%eval 105,33] } 3.d4 { [%emt 0:03:30] [%eval 109,34] } 3...cxd4 { [%emt 0:00:43] [%eval 100,33] } 4.Nxd4 { [%emt 0:00:57] [%eval 131,33] } 4...e5 { [%emt 0:01:13] [%eval 93,33] } 5.Nb5 { [%emt 0:01:54] [%eval 117,37] } 5...d6 { [%emt 0:02:02] [%eval 102,35] } 6.c4 { [%emt 0:01:01] [%eval 112,36] } 6...Be6 { [%emt 0:01:06] [%eval 107,34] } 7.Be2 { [%emt 0:03:19] [%eval 138,36] } 7...g6 { [%emt 0:05:48] [%eval 116,37] } 8.O-O { [%emt 0:04:57] [%eval 114,38] } 8...h5 { [%emt 0:00:46] [%eval 91,32] } 9.N1c3 { [%emt 0:00:52] [%eval 127,35] } 9...a6 { [%emt 0:01:41] [%eval 90,34] } 10.Na3 { [%emt 0:01:08] [%eval 124,37] } 10...f5 { [%emt 0:01:11] [%eval 92,32] } 11.exf5 { [%emt 0:01:37] [%eval 142,32] } 11...gxf5 { [%emt 0:01:17] [%eval 93,32] } 12.Nd5 { [%emt 0:01:29] [%eval 124,32] } 12...Rc8 { [%emt 0:01:23] [%eval 100,33] } 13.f4 { [%emt 0:03:08] [%eval 141,35] } 13...Nf6 { [%emt 0:07:48] [%eval 107,38] } 14.fxe5 { [%emt 0:02:38] [%eval 147,35] } 14...dxe5 { [%emt 0:00:52] [%eval 89,32] } 15.Bg5 { [%emt 0:00:48] [%eval 140,36] } 15...Be7 { [%emt 0:01:03] [%eval 93,33] } 16.Bxf6 { [%emt 0:03:22] [%eval 117,40] } 16...Bxf6 { [%emt 0:01:07] [%eval 78,33] } 17.Nc2 { [%emt 0:01:09] [%eval 114,38] } 17...Bg5 { [%emt 0:03:57] [%eval 100,39] } 18.Bxh5+ { [%emt 0:02:40] [%eval 103,40] } 18...Kf8 { [%emt 0:00:52] [%eval 93,37] } 19.Bg4 { [%emt 0:02:35] [%eval 100,39] } 19...Ne7 { [%emt 0:01:40] [%eval 106,38] } 20.Bxf5 { [%emt 0:01:09] [%eval 115,39] } 20...Nxf5 { [%emt 0:01:12] [%eval 103,41] } 21.Nce3 { [%emt 0:01:13] [%eval 118,40] } 21...Bxe3+ { [%emt 0:01:31] [%eval 108,42] } 22.Nxe3 { [%emt 0:01:26] [%eval 110,46] } 22...Qb6 { [%emt 0:01:41] [%eval 109,44] } 23.Qb3 { [%emt 0:01:31] [%eval 109,42] } 23...Qxb3 { [%emt 0:01:15] [%eval 97,48] } 24.axb3 { [%emt 0:01:33] [%eval 99,44] } 24...Rh5 { [%emt 0:01:36] [%eval 94,46] } 25.g4 { [%emt 0:01:15] [%eval 122,45] } 25...Rg5 { [%emt 0:01:20] [%eval 93,49] } 26.Ra5 { [%emt 0:02:09] [%eval 99,47] } 26...Ke8 { [%emt 0:01:19] [%eval 95,48] } 27.Rxe5 { [%emt 0:01:16] [%eval 99,51] } 27...Kd7 { [%emt 0:01:04] [%eval 99,47] } 28.Rd1+ { [%emt 0:01:08] [%eval 98,52] } 28...Kc7 { [%emt 0:01:02] [%eval 90,51] } 29.Rxe6 { [%emt 0:01:24] [%eval 98,49] } 29...Nxe3 { [%emt 0:01:11] [%eval 90,50] } 30.Rxe3 { [%emt 0:01:03] [%eval 98,54] } 30...Rxg4+ { [%emt 0:01:19] [%eval 90,50] } 31.Rg3 { [%emt 0:01:12] [%eval 98,54] } 31...Rh4 { [%emt 0:11:53] [%eval 89,51] } 32.Rg7+ { [%emt 0:02:37] [%eval 97,51] } 32...Kb6 { [%emt 0:00:52] [%eval 33,34] } 33.Rdd7 { [%emt 0:04:29] [%eval 95,38] } 33...Rb8 { [%emt 0:00:46] [%eval 32,37] } 34.Rg3 { [%emt 0:07:18] [%eval 28,45] } 34...Re8 { [%emt 0:01:04] [%eval 10,37] } 35.Rd2 { [%emt 0:01:56] [%eval 12,43] } 35...Re7 { [%emt 0:01:58] [%eval 9,40] } 36.h3 { [%emt 0:00:21] [%eval 12,39] } 36...Kc5 { [%emt 0:00:43] [%eval 4,44] } 37.Kf2 { [%emt 0:00:41] [%eval 10,38] } 37...Rf4+ { [%emt 0:01:20] [%eval 3,49] } 38.Kg2 { [%emt 0:00:32] [%eval 8,51] } 38...Kb4 { [%emt 0:00:56] [%eval 3,52] } 39.Rc3 { [%emt 0:00:30] [%eval 8,45] } 39...Rfe4 { [%emt 0:00:53] [%eval 3,46] } 40.Kf2 { [%emt 0:00:31] [%eval 7,43] } 40...Rf4+ { [%emt 0:00:37] [%eval 3,51] } 41.Kg3 { [%emt 0:00:37] [%eval 7,46] } 41...Rfe4 { [%emt 0:00:37] [%eval 3,50] } 42.Rf3 { [%emt 0:00:52] [%eval 7,46] } 42...Re1 { [%emt 0:00:32] [%eval 3,50] } 43.Kg2 { [%emt 0:00:40] [%eval 7,46] } 43...Rg7+ { [%emt 0:00:30] [%eval 2,47] } 44.Kh2 { [%emt 0:00:27] [%eval 0,47] } 44...Rge7 { [%emt 0:00:35] [%eval 2,48] } 45.Rg2 { [%emt 0:00:26] [%eval 0,47] } 45...Rd1 { [%emt 0:00:43] [%eval 2,47] } 46.h4 { [%emt 0:00:39] [%eval 0,49] } 46...Rh7 { [%emt 0:00:32] [%eval 0,52] } 47.Rh3 { [%emt 0:00:58] [%eval 0,50] } 47...Re1 { [%emt 0:00:28] [%eval 0,54] } 48.h5 { [%emt 0:00:31] [%eval 0,54] } 48...Re5 { [%emt 0:00:29] [%eval 0,57] } 49.h6 { [%emt 0:00:25] [%eval 0,55] } 49...Re6 { [%emt 0:00:30] [%eval 0,62] } 50.Rg7 { [%emt 0:00:40] [%eval 0,59] } 50...Rhxh6 { [%emt 0:00:47] [%eval 0,64] } 51.Rxb7+ { [%emt 0:00:22] [%eval 0,52] } 51...Rb6 { [%emt 0:00:40] [%eval 0,65] } 52.Rxb6+ { [%emt 0:00:25] [%eval 0,59] } 52...Rxb6 { [%emt 0:00:27] [%eval 0,63] } 53.Kg2 { [%emt 0:00:32] [%eval 0,60] } 53...Rd6 { [%emt 0:00:27] [%eval 0,61] } 54.Kf2 { [%emt 0:00:23] [%eval 0,60] } 54...Re6 { [%emt 0:00:26] [%eval 0,63] } 1/2-1/2

```

Surprise black is able to draw.

---
Tags: analysis, statistics, castling
---


# Question
Title: What move requires the greatest number of moves before it could be played in a game?
The move e2e4 could be played on move 1. (One half-move)

The move e7xd6 could be played no earlier than by black on move 3 (6 half-moves).

What move(s) has the latest "earliest possible move it could be played"?

A move is distinguished by:

* what type of piece is being moved
* the square the piece moves from
* the square the piece moves to
* whether it is a capture
* what piece it is being promoted to, if any (probably not actually pertinent, but still)

(And notably, not by whether it causes check or checkmate, nor which colour the piece is, nor which piece \[if any\] is being captured, nor if it's en passant.)

# Answer
> 6 votes
### Ka8-b8 (14 plies)

Earliest I could find requires 14 half-moves.

```
[FEN ""]
1. c3 d6 2. Qb3 Bh3 3. Qxb7 Kd7 4. Qxa8 Kc8 5. Qxb8+ Kxb8 6. c4 Ka8 7. c5 Kb8

```

---

Other king moves from a8 seem to work out the same.

### Ka8xa7 (14 plies)

```
[FEN ""]
1. Nc3 d6 2. Nb5 Kd7 3. Nxc7 Kc6 4. Nxa8 b6 5. Nc7 Kb7 6. Nb5 Ka8 7. Nxa7 Kxa7

```

I couldn't prove that less moves is impossible. However, it requires starting with the pawn at d7, then reaching a8 by moving the Black king 4 times. Seems difficult even with help from White pieces.

# Answer
> 16 votes
Evargalo's `Ra1-h1` for 15 plies is not correct, since this can be done in 13:

```
[FEN ""]
1. e3 h5 2. Qxh5 Rxh5 3. Bc4 Rxh2 4. Nf3 Rxh1+ 5. Ke2 Rxc1 6. Nc3 Rxc2 7. Rh1

```

However, it cannot be done in fewer than 13, making it a reasonable candidate. We can prove this as follows.

Suppose White can do it in 11 plies. This means seven White pieces get off the first rank (either by moving or being captured) in the first 10 plies. Since White only moves on five of those plies, at least two pieces get captured, and that means another ply is required to get the capturing piece off the first rank (or capture it). That is eight different plies accounted for.

Now Black cannot capture on the first rank with either of their first two moves. So all five of White's plies and the remaining three of Black's are needed to get pieces off the first rank. In particular, White makes no pawn moves. But if White makes no pawn moves, Black can't capture on the first rank with any of their first three moves, and now there aren't enough moves left.

Next, suppose Black can achieve it in 12 plies. Now we have one extra White piece to get off the first rank, but the capturing Black piece doesn't have to move off the first rank (as long as it is a rook). So in order to get everything clear in time, we need White to make at most one move which is not taking a piece off the first rank, but Black captures on the back rank with a rook on ply 6. This isn't possible - there's certainly not enough time to capture anywhere other than a1 or h1, and there's no way to get rid of both h pawns in the time (note that capturing one of them doesn't help, since the capturing piece still has to get off the file, and e.g. 1 g4 h5 2 h3 hg 3 hg Rxh1 isn't valid because White has made more than one pawn move).

\[edit\] In response to Sandro's comment, Rh1-a1 can also be done in 13 plies (and this is optimal for the same reasons).

```
[FEN ""]
1. b3 e6 2. e3 Qf6 3. Qf3 Qxa1 4. Bd3 Qxb1 5. Nh3 Qxc1+ 6. Ke2 Qb2 7. Ra1

```

\[edit\] As pointed out by corsiKa, Ra8-h8 and Rh8-a8 both require 14 plies. The analysis is similar to the above, except for Black to complete in 12 plies requires Black to move at least 4 pieces of the back rank first, with White capturing the other three and then moving off (this has to be done with the queen, since a bishop can't make two consecutive captures on the back rank, and the rooks can't get there in time). This means Black can't make more than one pawn move. That has to be the d, e or f pawn to allow the black king to get off the back rank in one move, and it has to be a light-squared pawn to allow the white queen to capture on the back rank on ply 5. However, if it is the f pawn White must eventually capture the f bishop (it can't move), but this forces the king to move at least twice since it can't stay on f7. So suppose Black moves the d pawn instead. Now White must play 3. Qxc8. If the black queen has already moved, this is check and the king can't move to d7. If not, the black queen is pinned and eventually White will play Qxd8, which forces a second king move. So this can't be done. (It's possible for Black to do either move in 14 plies - just swap sides in the examples above, with White playing any additional first move that doesn't get in the way.)

White can't do it in 13 plies. This would require either Black to make exactly one pawn move with White capturing with a rook on the back rank on ply 7, or two with White getting a rook to the back rank on ply 5, neither of which can be done.

# Answer
> 6 votes
**Ra1-h1**

This is a similar idea to Rosie's, but using a rook instead of queen makes it longer for the far away side to achieve this move.

I believe it takes 15 plies (*edit*: actually **13 plies**, see comments) for White to play this move :

1.Na3 e6 2.e4 Qf6 3.Qh5 Qxb2 4.Ba6 Qxb1 5.Ke2 Qxc1 6.h4 Qxg1 7.Rh3 Qh2 8.Ra1-h1

```
[FEN ""]
1.Na3 e6 2.e4 Qf6 3.Qh5 Qxb2 4.Ba6 Qxb1 5.Ke2 Qxc1 6.h4 Qxg1 7.Rh3 Qh2 8.Ra1h1

```

As a side note, on the other side of the board, Ra8-h8 seems to take only 14 plies :

1.e3 Nh6 2.Qf3 e5 3.Qxb7 Ba3 4.Qxb8 Qh4 5.Qxc8 Ke7 6.Qxh8 a6 7.Qxh7 Ra8-h8

```
[FEN ""]
1.e3 Nh6 2.Qf3 e5 3.Qxb7 Ba3 4.Qxb8 Qh4 5.Qxc8 Ke7 6.Qxh8 a6 7.Qxh7 Ra8h8

```

# Answer
> 6 votes
Rosie F proposed the move Qh8-a8. I can reach this move in 13 plies (White's 7th move):

```
[fen ""]

1. c4 e5 2. Qa4 Qh4 3. Qxa7 Ba3 4. Qxb8 Nf6 5. Qxc8+ Ke7 6. Qxh8 Ra4 7. Qa8

```

The key idea to is ensure that Black's 6th move is useful, which is accomplished by having the white queen open the way from the black queen's rook to escape.

# Answer
> 4 votes
Some more candidates that couldn't break the 13 mark, but may've equaled it, until someone with sharper eyes comes along:

13 Re1-e8: 1. Nf3 e5 2. d4 e4 3. Kd2 exf3 4. exf3 Ke7 5. Bc4 Kf6 6. Re1 Kf5 7. Re8
13 Re2xe8: 1. f4 e5 2. g3 Ke7 3. h4 exf4 4. Rh2 f3 5. exf3 Kd6 6. Re2 Qe8 7. Rxe8
13 Rd2-d8: 1. Nc3 e5 2. d4 exd4 3. Bf4 dxc3 4. Qxd7+ Qxd7 5. Rd1 Qg4 6. Rd2 Qxg2 7. Rd8+
11 Re2-e8: 1. f4 e5 2. g3 Qe7 3. h4 exf4 4. Rh2 Qxe2+ 5. Rxe2+ Kd8 6. Re8+

# Answer
> 3 votes
I thought Rb2-h2 could be better than Rb1 etc, but JeopardyTempest found a 12 ply variant: 1. d4 h6 2. Bxh6 Rxh6 3. e4 Rc6 4. f4 Rxc2 5. g4 Rxb2 6. h4 Rh2 (and scuttled other ideas I had)

So, it seems 13 is the fastest possible.

Some analysis: Pawns reach any place in 5 moves (10 ply) pretty easily. Knight takes 4 (8 ply). Bishop seems to need at most 12 ply (Bg1-a7, Be1-Ba5). King does K(x)a8 in 12 ply (white uses knight to remove rook, black moves b7 and d7 pawns and king 4 times). Castling is 5th move (9 ply). So, the only remaining pieces are queen and rook, which have been attempted in many other answers with the maximum of 13 ply. Out of unmentioned possibilities, Qa2-h2 is doable in 12 and I can't think of any other rook or queen move that is a contender for 13+.

# Answer
> 3 votes
What about `Kh1xh2`?

15 plies is achievable:

```
[FEN ""]
1. h4 d6 2. f3 Qd7 3. Nh3 Qxh3 4. Kf2 Qxh1 5. h5 Qh4+ 6. Kg1 Qg3 7. Kh1 Qh2+ 8. Kxh2

```

Similarly I also only found a 15 half move solution for `Ka1xa2`:

```
[FEN ""]
1. d3 Nc6 2. Bh6 Nb4 3. Kd2 Nxc2 4. Kc1 Nxa1 5. Nd2 Nc2 6. Kb1 Nb4 7. Ka1 Nxa2 8. Kxa2

```

Let's consider the latter and see if we can do better. If we could, white would only have 7 moves.

The obvious one first: It needs to be the white king. The black king would need 8 moves just to do `Ka1a2` on an otherwise empty board.

If we ignore castling for now, the white king has to move 4 times to reach a1 and once more to capture on a2.That only leaves 2 of white's moves to spare. On its way to a1 at least four pieces - the a1 rook and the piece or pawn on the b, c, and d file - either have to move out of the way or have to be captured. Since we established white has only 2 non-king moves this means black has to capture at least two of them and additionally land on a2, all within 6 moves. Can black actually use 2 pieces for that? I don't think so. If black used 2 different pieces, one has to survive and make it to a2. But the fastest black can land any piece on a2 is in 3 moves, namely with the h2 knight. In the remaining 3 moves black can only do one capture tho, since the distance is too large for knights and for queen/bishop one move has to be spent to open up the piece, one move to line up the diagonal (since neither bishop or the queen target anything on the a-d files), which leaves only one capture which we have determined is not enough to help white.

So we determined that black can only infiltrate with one piece.

Further, notice that if white were to clear a1 by themself they need to be careful not to block the path of their King again, i.e., not leave the rook on the back rank which they've spent a move to clear. But also moving the rook along the a-file takes two moves since the a-pawn would have to move first. There is the possibility that black clears the a-pawn, then moves out of the way, white plays Ra2 and black captures on e2 but this simply takes too much time since black needs 3 moves at least to capture on a2 in the first place.

This means the one black piece doing the infiltration must capture the rook and end on a2 at the same time. The only piece that can do this is the queen.

Notice that the first capture (that clears the way for the king) can only occur on black's third move. Also white may not capture the queen afterwards since we already determined one piece has to do all the infiltration and land on a2 at the end. This essentially still blocks the square the queen captured on and even worse, it also blocks all adjacent squares. Lastly, black's queen must be on a2 after black's 6th move but somehow has to allow the white king to reach a1 on white's 6th move. It's quite clear that this implies that black's 5th move can not be in white's queenside since otherwise the queen would block the king's access to a1.

So to summarize (without casling):

* White has to move the king on all but 2 moves
* Black must land the queen on a2 on their 6th move
* Black must retreat the queen on their 5th move to allow the king to reach a1
* Black can not capture on their first 3 moves

The first and last statement imply that within white's first 3 moves they have to move their king and since black cannot capture they have to make way themself. This leaves only a d-pawn move into Kd2. As soon as the king is on d2 the a3 bishop may no longer be captured since the king would be forced to take black's queen (or run from his target square). This means white has to move the bishop out, essentially locking down the first 3 moves: d3 (or d4) - bh6 (or g5/f4/e3) - kd2. From here white would have to move the king on every move and remember that at this point black still would not have had the chance to capture. It's not too hard to see that this move sequence will not work.

---

So this leaves castling as our only option. But that does not work fast enough either. After castling, the king needs 3 to make more moves (including Ka1xa2) which leaves 3 moves to clear the back rank. However, clearing the back rank certainly requires 4 moves: d4 - qd3 - bd2 - nc3. Black can also not be of any help since even if they captured on the back rank (which they couldn't even do fast enough) and moved out, they'd cover the square on which they took, disallowing white to castle.

---

So long story short: I'm pretty sure `Ka1xa2` is only possible as the 15th half move and not earlier.

# Answer
> 2 votes
I thought I had an answer which was 18 half-moves, but actually only 11 half-moves.

Ra7xh7. Assuming it's black's rook, I think this takes 7 turns to move all the pawns out of the way, one to move the rook, then one more for the capture. Meanwhile, white has to get a pawn up to h7. (Making it a capture prevents white from helping by clearing out one of the other pawns). So, 18 half-moves.

However, if it's white's rook: black moves pawns on c, d, e, f and g. Meanwhile, white plays a4, ra3, rb3, rxb7, rxa7. 11 half-moves.

```
[fen ""]

1. a4 c6 2. Ra3 d6 3. Rb3 e6 4. Rxb7 f6 5. Rxa7 g6 6. Rxh7

```

# Answer
> 2 votes
Qh8-a8.

As a White move this can happen on White's 9th i.e. the 17th ply:

1 e3 h5 2 Qxh5 Nf6 3 Qxh8 d6 4 Qxf8+ Kd7 5 Qxd8+ Kc6 6 Qxc8 Na6 7 Qxa8 g6 8 Qh8 g5 9 Qa8.

It seems not to matter much whether the queen goes from a to h or h to a.

# Answer
> 1 votes
... Ba1xPb2 entails a black pawn getting to a2, then a1=B. This needs 12 plies. For example:

1. Nc3 b5
2. Rb1 b4
3. ~ b3
4. ~ bxa2
5. ~ a1=B
6. ~ Bxb2

# Answer
> 1 votes
**Bbg3**

This is what I came up with after seeing the other answers and wondering if promotion could make this take longer and while I haven't explored it too much, I think that this bishop under-promotion idea is definitely one to consider.

```
[FEN ""]
1. d4 c5 2. dxc5 Nh6 3. c6 Ng8 4. c7 Nh6 5. cxb8=B Ng8 6. Bcf4 Nh6 7. h4 Ng8 8. Bh2 Nh6 9. Bbg3

```

# Answer
> 1 votes
Great question!

Here's another try: **bxa1=B+**

*Edit*: Boo! Didn't read the passus about + being irrelevant!

So here's a cheat that needs 16 plies.

```
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]

1. b4 c5 2. c3 cxb4 3. Qa4 Qb6 4. Na3 bxa3 5. Bb2 Nf6 6. Kd1 h6 7. Kc2 axb2 8. Kb1 bxa1=B+

```

# Answer
> 0 votes
15 half-moves are needed for d7xe8Q.

```
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"]

1. d4 d5 2. Nc3 f6 3. Nxd5 Kf7 4. Nxc7 e6 5. d5 Qe8 6. d6 Be7 7. d7 e5 8. dxe8=Q#

```

---
Tags: problems, puzzles
---


# Question
Title: What was the highest rated classical game that was lost on time?
Recently, I came across a game Vishwanathan Anand vs Veselin Topalov from Norway Chess 2022. In the second round, Anand who was playing with the black pieces won on time against Topalov as his clock ran out. The position was equal according to the engine.

Is this the highest-rated classical game that was lost on time? Or is there any other game much higher rated?

The ratings were: **Topalov** (2730) vs **Anand** (2751)

**NOTE**: By highest rated, I mean according to FIDE classical ratings and the sum of the ratings of the players. In this example, it is 2730 + 2751 = 5481

# Answer
> 9 votes
Not sure if this is the all-time highest-rated classical game ever lost on time but Magnus Carlsen's game against Veselin Topalov from Round 1 of Norway Chess 2015 was lost on time.

Yes, one more loss on time from Norway Chess itself! This time Veselin Topalov got the win :).

Carlsen was rated 2876 and Topalov was 2798 making it 2876+2798 = 5674. Here's that game:

```
[Title "Carlsen vs Topalov Norway Chess 2015"]

[FEN "1b6/1P3k2/8/6Q1/5p2/6PK/4Bq2/8 w - - 2 61"]
1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. Bg5 h6 6. Bxf6 Qxf6 7. e3 Nd7 8. Rc1 g6 9. Be2 Bg7 10. cxd5 exd5 11. b4 a6 12. a4 O-O 13. b5 axb5 14. axb5 Qd6 15. O-O Nb6 16. Qb3 Rb8 17. Nd1 Bf5 18. Nb2 Rfc8 19. Nd3 Bxd3 20. Qxd3 c5 21. dxc5 Rxc5 22. h4 Na4 23. h5 Rbc8 24. Rxc5 Nxc5 25. Qc2 gxh5 26. Nd4 Qg6 27. Nf5 Bf8 28. Rd1 Qe6 29. Rc1 Nb3 30. Qxc8 Nxc1 31. Qxc1 Qxf5 32. Qc7 Qb1+ 33. Bf1 d4 34. exd4 Qd1 35. Qe5 Bg7 36. Qe8+ Bf8 37. Qd8 Kg7 38. Qd5 b6 39. Qe5+ Kg8 40. Qf6 Bg7 41. Qxb6 Bxd4 42. Qxh6 Qg4 43. Qd6 Qd1 44. Qd8+ Kh7 45. Qc7 Kg7 46. b6 Qg4 47. b7 Qh4 48. g3 Qf6 49. Qc2 Qe5 50. Qd3 Ba7 51. Qf3 Qf6 52. Qe2 Qc3 53. Kh2 Qd4 54. Qf3 Bb8 55. Kh3 Bc7 56. Be2 Bb8 57. Bd1 f5 58. Be2 f4 59. Qxh5 Qxf2 60.Qg5+ Kf7 0-1

```

---
Tags: history, records, master-games
---


# Question
Title: Using stockfish from command line to calculate the total number of legal moves for each side after a given move
I am running stockfish 15 from the command line. I'm wondering if there is an easy way for Stockfish to report the total number of legal moves (safe, or otherwise) for each side after a given move.

For example, after entering the following commands: *position startpos moves e2e4 e7e5*, I would like stockfish to report to me that white's (or black's) total number of legal moves after e2e4 e7e5 is equal to 29 (there are 29 legal moves available for white or black after e2e4 e7e5).

Is there some way for stockfish to report this to me in the command line, and if not, is there a way to modify the existing code to accomplish this?

# Answer
> 4 votes
> For example, after entering the following commands: position startpos moves e2e4 e7e5, I would like stockfish to report to me that white's (or black's) total mobility after e2e4 e7e5 is equal to 29 (there are 29 legal moves available for white or black after e2e4 e7e5).

Note that your definition of mobility and the definition of mobility used by many chess engines differs. Chess engines generally understand mobility as an evaluation figure that's a good bit more complicated than just the total number of legal moves.

So for future searching, it might be best to use phrasing like calculating the legal move count for a given position, instead of mobility.

Anyhow, what you're asking is possible with Stockfish by using the command `go perft 1` which will display the total number of legal moves for the current position:

```
Stockfish 14.1 by the Stockfish developers (see AUTHORS file)
position startpos moves e2e4 e7e5
go perft 1
a2a3: 1
b2b3: 1
c2c3: 1
d2d3: 1
f2f3: 1
g2g3: 1
h2h3: 1
a2a4: 1
b2b4: 1
c2c4: 1
d2d4: 1
f2f4: 1
g2g4: 1
h2h4: 1
b1a3: 1
b1c3: 1
g1e2: 1
g1f3: 1
g1h3: 1
f1e2: 1
f1d3: 1
f1c4: 1
f1b5: 1
f1a6: 1
d1e2: 1
d1f3: 1
d1g4: 1
d1h5: 1
e1e2: 1

Nodes searched: 29

```

The `go perft` command more generally is used to verify that Stockfish's move generation is working correctly, by counting the total number of legal moves up to a certain depth.

In your example you only wanted the number of legal moves at a depth of 1. If for example, you wanted all of the possible legal moves from a position up till depth n, you would type `go perft n`:

```
Stockfish 14.1 by the Stockfish developers (see AUTHORS file)
go perft 2
a2a3: 20
b2b3: 20
c2c3: 20
d2d3: 20
e2e3: 20
f2f3: 20
g2g3: 20
h2h3: 20
a2a4: 20
b2b4: 20
c2c4: 20
d2d4: 20
e2e4: 20
f2f4: 20
g2g4: 20
h2h4: 20
b1a3: 20
b1c3: 20
g1f3: 20
g1h3: 20

Nodes searched: 400

```

Do note that the number of legal moves from a given position increases quite rapidly as the depth grows, so typing in large depth numbers will start taking quite a long time to calculate.

---
Tags: stockfish, programming
---


# Question
Title: Why isn't legal move filtering done at search time?
Most engines have some method of filtering out pseudo-legal moves from the actual legal ones. However, is there any reason not to keep them? With bit-boards, you can quickly filter out the ones that result in the king landing in the attack mask of the opponent's side when trying a move at search-time. Am I missing something here, or is it faster to filter out before the search?

# Answer
It is actually!

Some engines have what are known as fully legal move generators, the kind of move generator you're talking about, where only completely legal moves are returned.

This approach is fine, but not every move is actually tested during the search phase, so it's actually (generally) more efficient to test move legality on a move-by-move basis.

This is the approach used in many of the current top chess engines like Stockfish, Etheral, and Koivisto. For example, here's the relevant code in Stockfish that does this, during the search phase:

```
while ((move = mp.next_move()) != MOVE_NONE)
    if (move != excludedMove && pos.legal(move))
    {
        ...

```

Notice the call to `pos.legal`, which tests if a move is legal.
> 7 votes

---
Tags: engines, illegal-move
---