lichess.org
Donate

Computer Chess Analysis

In the blog link in #11 it says

"This non-linear function helps the trainer select the mistakes that really matter; the ones that decide if a game will be won or lost."

However, ever mistake is an opportunity to learn. I would like some control over what is counted as an inaccuracy/mistake/blunder.
So far I've been discussing full game analysis. Chess programs also have a variety of features that occur dynamically.

Let's consider Fritz-12's abilities in this. Under Training -> Hints, there are 6 check boxes that can turn on these features.

- The feature "Dynamic Hints" is interesting; it is almost the idea I have for the A/D network. Once it is checked, during a move, lines are drawn indicating attack/defense. Green arrows are used for defense and red arrows for attack. A thick red line indicates a win of material. Not all attacks/defenses are drawn.

- The feature "Opening Hints" displays arrows based on the opening book chosen.

- The feature "Threatened squares" displays a colored background on a pieces as follows: (from the docs)
* A red square means that the pieces is under attack and not sufficiently defended, or that it is being attacked by a piece of lesser value. This is usually a pretty serious danger signal and means you must take active measures to avoid losing a piece.
* Yellow means that the piece is under attack, but it is just sufficiently defended. You must be careful about removing any defending piece.
* Green means the piece has enemy contact but is well defended. Usually it is okay to remove a defending piece.

This could be another way to do the A/D network.

- The feature "Spy" shows using colored arrows what the engine is planning to do tactically. Colored arrows are used to show two moves by the computer.

- The feature "Explain All Moves" does the following: (from the doc)
This will opens a new window with a list of all legal moves in the current position, sorted according to their value. The best move is listed first. The program will periodically recompile the list, searching one move deeper in the process.
For each move there is a short characterisation. If you click any of the moves, the principal variation that would follow displays at the top of the screen, along with the resulting evaluation. Coloured arrows and squares on the board (to illustrate the point) may appear.

For example in the Colle System at White's 5th move we see comments like:
5.dxc5 An exchange
5.Be2 Bad development - piece moves again
5.Nbd2 Blocks Bc1
5.Bb5+ Gives a check
5. Qe2 Loses material: B <=> P+P

Some of these comments are silly (Gives a check), others are wrong (5.Qe2 only loses material if White exchanges).

- The feature "Show Plans" depicts with arrows the best line for both sides. I find this very confusing because there are too many arrows.

There are other dynamic features in Fritz. The program will give a hint, a suggestion, show an immediate threat, and show the move it is expecting the opponent to play. It has a graphic way of showing how tactical a position is.

Fritz also comes with a special engine, that runs along side the engine of choice, which can be turned on to display a native language positional evaluation of a position. Sometimes this produces good results and other times it says silly things such as "exchanges material".

Continuing #13...

Similarly, Lichess/Stockfish, Chessmaster, and other chess programs have dynamic features to help analyze a game. It is necessary to play the game move by move with these features turned on, and to give the program time for consideration. You must stay aware of any feedback the program is giving, whether it be variations, or highlighting, or other types of feedback.

It can easily take 2-3 hrs to go over a game in this way.
Many computer chess programs have the ability to classify the opening of a game. They can tell you the ECO code and the name of the opening. However, there are a few issues; a) transpositions and b) reverse openings. On Lichess, the functionality is under "Opening book & tablebase" button in a study, and it does not handle either of these.

As an example of a reverse opening in a non trivial case consider this position:



Sicilian Defense: Dragon Variation, Classical Variation: Reversed.
Also known as
A22 English Opening: King's English Variation, Two Knights Variation, Reversed Dragon

Here at least the second name says Reversed Dragon, but in general Lichess will only give you the fact that it is a reverse opening if the word "reversed" is in the ECO name. There are only 6 such cases in the ECO classifications!

I should say something here about 0/0/0 games and the silly average-centipawn-loss stat.
Misunderstandings about "depth" and "positions evaluated" by AB engines such as Stockfish.

People often use short cuts when speaking/writing to quickly get their point across without being pedantic. That does not mean they do not know what is going on, and that technically they are incorrect. A simple example from chess is an annotation in a game that says "draw by perpetual check". Almost everyone knows what that means even though technically there is no such drawing rule in the rules of chess. Technically, such a draw would have to be by agreement, or by the 3 fold repetition of position rule.

There is a post in stackexchange where people were arguing about whether an AB engine was evaluating *all* positions for some depth. The argument is silly and misleading because the people are talking past each other. The intent was one of those short cuts as discussed in the paragraph above. The intended meaning was that the AB engine gets the same evaluation *as if* it had evaluated all positions to some depth. Arguing that the engine does not "evaluate" those positions that were cut-off, makes it sound as if the engine might have missed something. It also makes it sound like you don't understand the AB algorithm or the minimax algorithm.

The point of the AB algorithm is that it gets the same answer as the minimax algorithm would; as if it had evaluated all positions, and so as a short cut we just say that all the positions were analyzed. Technically that is incorrect, but knowledgeable people know what is meant.

See the following links for definitions of terms:
en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning
en.wikipedia.org/wiki/Minimax#Minimax_algorithm_with_alternate_moves

I refer to chess engines that use the Alpha/Beta algorithm (first link) as an AB engine.
I refer to the algorithm in the second link as the minimax algorithm.
Stumbled across this site: decodechess.com/first-ai-chess-tutor/
Very interesting attempt to implement what I've been talking about. Looking into how they do tactics explanation, I see them doing what I call the A/D network.
The analysis by decodechess has some issues. I'm investigating that in this chapter


Some other links found by using google to search lichess.

* github.com/ddugovic/python-chess-annotator
This program reads a PGN and creates two tags in the PGN headers; WhiteACPL, and BlackACPL. It also seems to put variations and score/nodes throughout. These ACPL values are the average centipawn loss for each side. The program has command line arguments for which engine to use, how long to spend analyzing the gams(s), the number of threads to use, and the verbosity.

* github.com/fsmosca/chess-artist
"A python script that can annotate chess games in pgn file with static evaluation or search score of an engine, can annotate an epd file with acd, acs, bm, and ce opcodes, can test engine with epd test suite and can generate chess puzzles."

* chesstempo.com/pgn-viewer
You need a paid account to use this for analysis. Looking at the documentation, it seems the analysis feature is not natural language based, but only the engine variations.
It is all too easy to find that Lichess analysis gives different results than running Stockfish at the same point. They clearly do not have the same parameters set for Stockfish.

This topic has been archived and can no longer be replied to.