Skip to content
FengchiWPublic

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Hushhush

An analysis engine for RPS V6 — a 9x9 rock-paper-scissors variant — compiled to WebAssembly, with the JavaScript an analysis board needs on top of it: searching a position, several lines at once, interrupting a search the instant the user clicks elsewhere, and turning a finished game into per-move judgements and an accuracy percentage.

By Wilson Wang. Free software under the GNU GPL v3 or later.

This repository is source only. It is the corresponding source for the compiled rps-engine.wasm distributed with the Hushhush browser build, which is what the GPL requires travel with that binary. It does not include a trained network — see Networks.

What is here

Path What it is
js/ the analysis layer: engine wrapper, rules model, accuracy, game reports
demo/ a working analysis board, and the best worked example of the API
build/ everything needed to compile the engine: pinned upstream, patch, replaced files, exact flags
test/smoke.mjs checks a built engine boots, searches and stops
serve.py static server that sets the two required headers
API.md the full API reference
NOTICE.md what is GPL here and what is not
SOURCE.md how to rebuild, and how to verify your build

Building

The engine is not vendored. It is a pinned upstream commit of Fairy-Stockfish plus one patch, which is smaller and easier to audit than a copy.

git clone https://github.com/fairy-stockfish/Fairy-Stockfish.git
cd Fairy-Stockfish
git checkout $(python3 -c "import json;print(json.load(open('../build/engine-upstream.json'))['commit'])")
git apply ../build/patches/rps-v6.patch
cd ..

source ~/emsdk/emsdk_env.sh
make -C build           # -> dist/rps-engine.js, dist/rps-engine.wasm

SOURCE.md has the full detail, including the expected checksums — the build is reproducible, so you can confirm your binary matches the distributed one byte for byte.

Running it

python3 serve.py        # http://localhost:8080/demo/

The search runs on real threads, which means SharedArrayBuffer, which browsers only grant to a cross-origin isolated page. The host must send:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

serve.py sets them. Without them the engine cannot start a single thread, and the demo says so rather than failing silently. GitHub Pages and plain S3 cannot set these headers; Netlify, Vercel, Cloudflare Pages and any server you control can.

Using it

import { RpsEngine, analyseGame } from './js/index.js';

const engine = await RpsEngine.create({ threads: 4, hash: 128 });
const analysis = await engine.analyse({ fen, moves, depth: 22, multipv: 3 });

analysis.bestmove;         // 'e3f2'
analysis.lines[0].pv;      // ['c5c6', 'e7d8', ...]

API.md is the full reference: every option, the result shapes, whole-game reports and accuracy, the two FEN dialects, and deployment notes.

Networks

The engine evaluates with an NNUE network loaded at run time. No network is included in this repository.

The network used by the official Hushhush build, rps-v6.nnue, is © 2026 Wilson Wang, all rights reserved. It is trained data rather than source code — the engine is not linked against it, loads it as a file, and runs without it on its handcrafted evaluation (RpsEngine.create({ useNetwork: false })). It is therefore not part of this program's corresponding source, and no licence to reuse, redistribute or train from it is granted.

Build from this repository and supply your own network if you want a build you can license freely.

Licence

GPL-3.0-or-later (COPYING.txt).

Derived from Fairy-Stockfish, itself derived from Stockfish, and modified in September 2026 to add the 9x9 rps-v6 variant, a WebAssembly port, and the analysis layer in js/. Upstream copyright notices are preserved.

If you redistribute this — and serving it from a web page counts — you must pass on the source and this licence. API.md section 11 says what that takes in practice. NOTICE.md summarises the whole picture in a page.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages