[EDIT 21th April 2017] Now with support for all variants!
One of lichess most distinctive features is the in-depth game analysis. We want the best tools to analyse - and learn from - our games.
This post will not go through all of the tasty analysis features; instead I want to talk to you about computer analysis specifically.
The duality of chess computer analysis
As you may know, there exist two complementary ways of getting help from Stockfish, our artificial intelligence assistant.
1. Server analysis
The server analysis runs the entire game through lichess' servers. Using more than 220 Stockfish CPUs, donated by the community, evaluations are computed for the entire game. It powers the advantage chart, counts and reveals the players mistakes, and can suggest alternate lines. Furthermore, since the evaluations are run on lichess servers, they can be trusted and help with cheat detection. And, once someone requests a server analysis, it becomes available for everyone to learn from!
2. Local evaluation
This downloads and runs a Stockfish instance inside your browser. This way, you can get position evaluations, and alternate lines suggestion, for any move that you might try on the board. It also works well on the opening explorer and in studies.
To the point!
All this is fine and dandy, but we can do even better. The local evaluation makes your computer work hard, then the analysis is displayed once, then it's lost forever. All that valuable CPU work is not shared with other chess lovers around the word. How many computers are busy evaluating the same positions? Can we save power and improve analysis quality for everyone?
notice the green CLOUD tag here?
These last few weeks, we have been experimenting with "cloud analysis". The idea is not new, and chessbase has been doing that for a while.
It's about sending to lichess, and getting from lichess, the result of previous local evaluations. Here's how it works:
You enable local evaluation
If lichess already has an evaluation for the position, you receive it, and done! Instant evaluation, without using your CPU.
If not, your local Stockfish starts computing the position normally. When it gets a solid understanding of the position, it will send the result of its work back to lichess.
Next time you or someone face the same position, the work is reused.
Whenever you see the green CLOUD tag (picture above), it means someone has already computed the position evaluation, so you don't have to. Click the little blue plus sign if you want to compute it anyway, and reach higher depths, and send a better evaluation.
Some facts about lichess cloud analysis
As of today, there are 900,000 evaluated positions in the database. It's growing, fast.
We store multiple evaluations for each position, to accomodate different multiple line settings.