All Projects → niklasf → lila-openingexplorer

niklasf / lila-openingexplorer

Licence: AGPL-3.0 license
Opening explorer for lichess.org that can handle all the variants and billions of unique positions

Programming Languages

rust
11053 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to lila-openingexplorer

lila-tablebase
Tablebase server
Stars: ✭ 51 (-42.7%)
Mutual labels:  chess, lichess, http-api
lila-gif
Webservice to render Gifs of chess positions and games, and stream them frame by frame
Stars: ✭ 63 (-29.21%)
Mutual labels:  chess, lichess, http-api
chess-openings
An aggregated data set of chess opening names
Stars: ✭ 223 (+150.56%)
Mutual labels:  chess, lichess
stockfish.js
The strong open source chess engine Stockfish compiled to JavaScript and WebAssembly using Emscripten
Stars: ✭ 140 (+57.3%)
Mutual labels:  chess, lichess
pgn-tactics-generator
Generate chess puzzles / tactics from a pgn file
Stars: ✭ 83 (-6.74%)
Mutual labels:  chess, lichess
chessground
Chessground React Wrapper
Stars: ✭ 15 (-83.15%)
Mutual labels:  chess, lichess
chessops
Chess and chess variant rules and operations in TypeScript
Stars: ✭ 66 (-25.84%)
Mutual labels:  chess, lichess
Lila
♞ lichess.org: the forever free, adless and open source chess server ♞
Stars: ✭ 10,315 (+11489.89%)
Mutual labels:  chess, lichess
liground
A free, open-source and modern Chess Variant Analysis GUI for the 21st century
Stars: ✭ 41 (-53.93%)
Mutual labels:  chess, lichess
should-i-play-f6
Chess project to analyze the statistical effect of playing f3 (as white) or f6 (as black) on the outcome of the game.
Stars: ✭ 15 (-83.15%)
Mutual labels:  chess, lichess
bot-o-tron
Try out lichess' bot interface
Stars: ✭ 36 (-59.55%)
Mutual labels:  chess, lichess
liPGN
This program uses the lichess REST API to retrieve all the games of a user and transform them into a big PGN file that you can then import into your favourite game analysis tool (ie. scid)
Stars: ✭ 14 (-84.27%)
Mutual labels:  chess, lichess
Chessboardjsx
🔲 Chessboard built for React
Stars: ✭ 180 (+102.25%)
Mutual labels:  chess
Zerofish
An implementation of the AlphaZero algorithm for chess
Stars: ✭ 34 (-61.8%)
Mutual labels:  chess
Neural Chessboard
♔ An Extremely Efficient Chess-board Detection for Non-trivial Photos ♔
Stars: ✭ 163 (+83.15%)
Mutual labels:  chess
Droidfish
DroidFish Android Chess App
Stars: ✭ 155 (+74.16%)
Mutual labels:  chess
fn
No description or website provided.
Stars: ✭ 28 (-68.54%)
Mutual labels:  http-api
protochess
Online multiplayer chess website that lets you build custom pieces/boards. Written in Svelte + Rust.
Stars: ✭ 95 (+6.74%)
Mutual labels:  chess
Chess Alpha Zero
Chess reinforcement learning by AlphaGo Zero methods.
Stars: ✭ 1,868 (+1998.88%)
Mutual labels:  chess
ymir-js
This toolkit is created to make it easier for you to develop games like chess, checkers, go, match 3 puzzle and more. It is still under development.
Stars: ✭ 30 (-66.29%)
Mutual labels:  chess

lila-openingexplorer

Test

Opening explorer for lichess.org, capable of handling trillions of positions, featuring:

Usage

Run server

  1. Install recent stable Rust (rustup recommended).

  2. git submodule update --init

  3. Set some environment variables used at build time: set -a && source .env && set +a

  4. ulimit -n 131072 && EXPLORER_LOG=lila_openingexplorer=debug cargo run --release

⚠️ In a production environment, administrative endpoints must be protected using a reverse proxy. It's best to whitelist only /masters, /lichess, and /player.

Index games

  1. Download database dumps from https://database.lichess.org/.

  2. Index (optionally works directly with compressed files):

    cd index-pgn
    cargo run --release -- *.pgn.zst
    

Monitoring

/monitor

Example:

curl http://localhost:9002/monitor

Response in InfluxDB line protocol:

opening_explorer indexing=11u,lichess_cache=24982u,masters_cache=24988u,masters=160396858u,masters_game=2519908u,lichess=118926608160u,lichess_game=4225491015u,player=8474288392u,player_status=89981u

/monitor/db/<prop>

/monitor/cf/<cf>/<prop>

Example:

curl http://localhost:9002/monitor/cf/lichess/rocksdb.stats
** Compaction Stats [lichess] **
Level    Files   Size     Score Read(GB)  Rn(GB) Rnp1(GB) Write(GB) Wnew(GB) Moved(GB) W-Amp Rd(MB/s) Wr(MB/s) Comp(sec) CompMergeCPU(sec) Comp(cnt) Avg(sec) KeyIn KeyDrop Rblob(GB) Wblob(GB)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  L0      1/0   34.75 MB   0.2     64.3     0.0     64.3     157.5     93.2       0.0   1.6      1.4      3.5  46068.07           3002.68      2760   16.691   1763M    92M       0.0       0.0
  L1      4/0   205.48 MB   0.8    172.6    93.2     79.4     165.5     86.1       0.0   1.8      3.7      3.5  48254.63           3779.43       207  233.114   4758M   164M       0.0       0.0
  L2     52/0    2.49 GB   1.0    321.9    81.7    240.3     317.2     77.0       4.4   3.9      3.5      3.4  94232.38           6840.29      1345   70.061   8967M   121M       0.0       0.0
  L3    591/0   24.95 GB   1.0    338.4    78.2    260.1     333.0     72.9       3.1   4.3      3.5      3.5  97870.15           7213.25      1532   63.884   9448M   146M       0.0       0.0
  L4   3367/0   90.71 GB   0.4     81.3    48.6     32.7      79.9     47.2      27.5   1.6      3.7      3.6  22451.14           1770.16       904   24.835   2281M    35M       0.0       0.0
  L6  47776/0    2.78 TB   0.0      0.0     0.0      0.0       0.0      0.0       0.0   0.0      0.0      0.0      0.00              0.00         0    0.000       0      0       0.0       0.0
 Sum  51791/0    2.90 TB   0.0    978.5   301.6    676.9    1053.2    376.3      35.0  10.9      3.2      3.5 308876.38          22605.81      6748   45.773     27G   560M       0.0       0.0
 Int      0/0    0.00 KB   0.0      0.0     0.0      0.0       0.0      0.0       0.0   0.0      0.0      0.0      0.00              0.00         0    0.000       0      0       0.0       0.0

** Compaction Stats [lichess] **
Priority    Files   Size     Score Read(GB)  Rn(GB) Rnp1(GB) Write(GB) Wnew(GB) Moved(GB) W-Amp Rd(MB/s) Wr(MB/s) Comp(sec) CompMergeCPU(sec) Comp(cnt) Avg(sec) KeyIn KeyDrop Rblob(GB) Wblob(GB)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Low      0/0    0.00 KB   0.0    978.5   301.6    676.9     956.6    279.7       0.0   0.0      3.5      3.4 288675.78          20752.87      4203   68.683     27G   560M       0.0       0.0
High      0/0    0.00 KB   0.0      0.0     0.0      0.0      96.6     96.6       0.0   0.0      0.0      4.9  20200.60           1852.94      2545    7.937       0      0       0.0       0.0

Blob file count: 0, total size: 0.0 GB, garbage size: 0.0 GB, space amp: 0.0

Uptime(secs): 610745.6 total, 3.5 interval
Flush(GB): cumulative 96.595, interval 0.000
AddFile(GB): cumulative 0.000, interval 0.000
AddFile(Total Files): cumulative 0, interval 0
AddFile(L0 Files): cumulative 0, interval 0
AddFile(Keys): cumulative 0, interval 0
Cumulative compaction: 1053.16 GB write, 1.77 MB/s write, 978.51 GB read, 1.64 MB/s read, 308876.4 seconds
Interval compaction: 0.00 GB write, 0.00 MB/s write, 0.00 GB read, 0.00 MB/s read, 0.0 seconds
Stalls(count): 1028 level0_slowdown, 1018 level0_slowdown_with_compaction, 0 level0_numfiles, 0 level0_numfiles_with_compaction, 0 stop for pending_compaction_bytes, 1809 slowdown for pending_compaction_bytes, 0 memtable_compaction, 0 memtable_slowdown, interval 0 total count
Block cache LRUCache@0x7feb60a3f150#4001884 capacity: 40.00 GB usage: 39.97 GB table_size: 524288 occupancy: 6030149 collections: 1018 last_copies: 5 last_secs: 0.039008 secs_since: 408
Block cache entry stats(count,size,portion): DataBlock(165238,10.35 GB,25.885%) FilterBlock(22233,29.11 GB,72.7832%) IndexBlock(22348,499.64 MB,1.21981%) Misc(1,0.00 KB,0%)

** File Read Latency Histogram By Level [lichess] **

** DB Stats **
Uptime(secs): 610745.6 total, 3.5 interval
Cumulative writes: 0 writes, 0 keys, 0 commit groups, 0.0 writes per commit group, ingest: 0.00 GB, 0.00 MB/s
Cumulative WAL: 0 writes, 0 syncs, 0.00 writes per sync, written: 0.00 GB, 0.00 MB/s
Cumulative stall: 00:00:0.000 H:M:S, 0.0 percent
Interval writes: 0 writes, 0 keys, 0 commit groups, 0.0 writes per commit group, ingest: 0.00 MB, 0.00 MB/s
Interval WAL: 0 writes, 0 syncs, 0.00 writes per sync, written: 0.00 GB, 0.00 MB/s
Interval stall: 00:00:0.000 H:M:S, 0.0 percent

Public HTTP API

See https://lichess.org/api#tag/Opening-Explorer.

/masters

/lichess

/player

Example:

curl https://explorer.lichess.ovh/player?player=foo&color=white&play=e2e4

Query parameters:

name type default description
variant string chess antichess, atomic, chess (or standard, chess960, fromPosition), crazyhouse, horde, kingOfTheHill, racingKings, threeCheck
fen string starting position of variant FEN of the root position
play string empty Comma separated moves in UCI notation. Play additional moves starting from fen. Required to find an opening name, if fen is not an exact match for a named position.
player string required Username to filter for
color string required Filter for games where player is white or black
modes string all Comma separated list of game modes (rated, casual) to filter for
speeds string all Comma separated list of speeds (ultraBullet, bullet, blitz, rapid, classical, correspondence) to filter for
since string 0000-01 Year-Month. Filter for games played in this month or later
until string 3000-12 Year-Month. Filter for games played in this month or earlier

Response: Streamed application/x-ndjson with rows as follows.

Will start indexing, immediately respond with the current results, and stream more updates until indexing is complete. The stream is throttled and deduplicated. Empty lines may be sent to avoid timeouts.

{
    "white": 10, // total number of white wins from this position
    "draws": 1,
    "black": 22,
    "moves": [
        {
            "uci": "e7e5",
            "san": "e5",
            "white": 6, // total number of white wins with this move.
                        // more may transpose to resulting position.
            "draws": 1,
            "black": 9,
            "averageOpponentRating": 1500, // or null
            "game": { // only game for this move.
                      // would not actually be sent, because there are multiple
                      // games in this case, but for example:
                "id": "uPdCG6Ts",
                "winner": "black",
                "speed": "correspondence",
                "mode": "casual",
                "white": {
                    "name": "foo",
                    "rating": 1500
                },
                "black": {
                    "name": null,
                    "rating": null
                },
                "year": 2015,
                "month": "2015-09"
            }
        },
        // ...
    ],
    "recentGames": [ // currently up to 15 recent games.
                     // limit is up to discussion.
        {
            "uci": "e7e5",
            "id": "uPdCG6Ts",
            "winner": "black",
            "speed": "correspondence",
            "mode": "casual",
            "white": {
                "name": "foo",
                "rating": 1500
            },
            "black": {
                "name": null,
                "rating": null
            },
            "year": 2015,
            "month": "2015-09"
        },
        // ...
    ],
    "opening": {
        "eco": "B00",
        "name": "King's Pawn"
    }
}

License

Licensed under the GNU Affero General Public License v3. See the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].