# Jianwu 8,400-game 700 ms tournament — Cloudflare Pages edition

## What you get

A standalone static website for running **real Fairy-Stockfish WASM** Jianwu games, with seven difficulty presets, 21 pairings, 200 opening rounds (two colors per round), 700 ms per engine move and a 120-ply cap. It has no Pages Functions, D1 tables, secret keys, or external JS packages.

**Deploy as a NEW Cloudflare Pages project**, not as a replacement for the live Jianwu gaming website. Upload the complete deploy ZIP using Pages > Create project > Direct Upload > Drag and drop. All files must be at site root; use the provided ZIP. Open the new HTTPS `*.pages.dev` URL. Cloudflare's `_headers` file enables the cross-origin isolation required by this particular threaded Fairy-Stockfish WASM build. Do not unzip an HTML file and open it using `file://`.

This is **browser-run computing**, not Cloudflare server-side computing. The website must be open and active while playing. Mobile app switching, screen locking, browser power-saving, closing the tab, or device overheating may pause/kill the worker. Use a desktop or laptop for sustained extended runs. The Cloudflare hosting plan does not automatically execute matches. Browser battery, CPU, RAM and storage can be significant.

## Running

1. Open the site in Chrome, wait for the local database to restore the initial **89 previously verified** 700 ms games.
2. Select `All 21 pairings` and `10 games` for a first test, press **Start / Resume**. The first startup downloads one 1.6 MB WASM module for each engine instance, and validates the Jianwu FEN.
3. Watch the status; each completed game is immediately verified and saved in IndexedDB. **Pause after game** saves the ongoing game first. **Stop now** discards only the current unfinished game.
4. Export **all games JSON** regularly as a backup; export **standings CSV** and **pairings CSV** to analyze. Import a JSON file from another device to merge. The same game ID can only be stored once; conflicting game histories are rejected, never overwritten.
5. You can run separate pairings on separate devices then merge JSON exports. The website does **not** send results to a central Cloudflare database; the browser's storage is unique to each device and exact site origin. Imported games are replay-checked for move legality, but an import cannot prove that an external machine really used Fairy-Stockfish to choose its moves.

All historical games come bundled in `seed_89_verified_games.json`, including 84 games from the initial 700 ms round robin and five real continuation games. The website auto-loads the seed only on a fresh storage origin. Restore them with `Restore original 89 games` after a reset.

### Tournament schedule and cap

- Exactly 400 games per pairing, 8,400 target games total, with 200 color-swapped openings per pairing.
- The original 84 games use their original historical openings, and five continuation games preserve their recorded openings; new rounds use the seeded algorithm from the 8,400-game Node runner.
- All seven presets use their **v0.16.5 skill values**: Training −20 with 80% alternative legal moves; Novice −20; Beginner −12; Easy −4; Intermediate 5; Advanced 14; Full Strength 20.
- Game outcomes are authoritative from Jianwu's `outcome()` rules. A game that reaches the artificial 120-ply cap while nonterminal is **not a genuine rules draw**; it scores half a point solely in the provisional rating model.
- For rated game calibration these are *relative Elo offsets*, not WSA ratings, official chess ratings or human-equivalent ratings. Device performance may affect strength at a fixed `go movetime` setting.
- Rating fitting uses a Bradley–Terry logistic model with a color term, normally distributed relative Elo priors (500 Elo SD), and a color-effect prior (100 Elo SD), matching the provided Python tournament analysis. Intervals rely on these modeling assumptions. A 100 ms tournament is not mixed into this dataset.

### Important data warning

**Export JSON regularly**, especially before clearing browser data, changing devices, switching domains or deploying a replacement project. IndexedDB is not a remote backup. Incognito data is ephemeral. A browser restart preserves completed games under normal storage conditions, but the match in progress is lost.

### Verify on local computer

For local browser testing only (not necessary to deploy), serve these files with any static HTTP server that adds the COOP and COEP headers in `_headers`. Cloudflare Pages automatically applies them to static assets. `file://` cannot load the threaded WASM engine.

`tests/` contains deterministic tests of opening seeding, rating calculations and the original JSON dataset. Genuine WASM game execution must be verified on a cross-origin isolated HTTPS site; local tests do not prove all Android browser combinations can run two threaded engines.

### Attribution and scope

Third-party Fairy-Stockfish license and source attribution must be preserved. This ZIP includes the same engine build used by Jianwu v0.16.5; it does not modify its binaries or upstream license. The separate browser tournament neither accesses nor modifies Jianwu's online matchmaking, ratings, account sessions or D1 database.
