GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lichess-org/stockfish.js: The strong open source chess engine Stockfish compiled to JavaScript and WebAssembly using Emscripten

BranchesTags
Open more actions menu

Latest commit

 

History

6,050 Commits
6,050 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
deploy
deploy
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
AUTHORS
AUTHORS
 
 
Copying.txt
Copying.txt
 
 
Dockerfile
Dockerfile
 
 
Readme.md
Readme.md
 
 
Readme.upstream.md
Readme.upstream.md
 
 
Top CPU Contributors.txt
Top CPU Contributors.txt
 
 
appveyor.yml
appveyor.yml
 
 
build.sh
build.sh
 
 
package.json
package.json
 
 
preamble.js
preamble.js
 
 

Repository files navigation

stockfish.js

The strong open source chess engine Stockfish compiled to JavaScript and WebAssembly using Emscripten. See it in action for local computer analysis on lichess.org.

npm Passively maintained

Important

Maintained with bugfixes to keep supporting older browsers, but active development is happening on https://github.com/lichess-org/stockfish-web

Releases

About 1.4MB uncompressed, 250 KB gzipped.

Building

Install Emscripten and uglifyjs, then:

./build.sh

Or using Docker:

docker run --user $(id -u):$(id -g) --volume $(pwd):/home/builder/stockfish.js:rw niklasf/emscripten-for-stockfish

Usage

var wasmSupported = typeof WebAssembly === 'object' && WebAssembly.validate(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));

var stockfish = new Worker(wasmSupported ? 'stockfish.wasm.js' : 'stockfish.js');

stockfish.addEventListener('message', function (e) {
  console.log(e.data);
});

stockfish.postMessage('uci');

Changes to original Stockfish

  • Expose as web worker.
  • Web workers are inherently single threaded. Limit to one thread.
  • Break down main iterative deepening loop to allow interrupting search.
  • Limit total memory to 32 MB.
  • Disable Syzygy tablebases.
  • Disable benchmark.

Acknowledgements

Thanks to @nmrugg for doing the same thing with Stockfish 6, to @ddugovic for his multi-variant Stockfish fork and to the Stockfish team for ... Stockfish.

About

The strong open source chess engine Stockfish compiled to JavaScript and WebAssembly using Emscripten

Topics

chessemscriptenlichessstockfishwebassembly

Resources

Readme
GPL-3.0 license

Code of conduct

Code of conduct

Security policy

Security policy
Activity
Custom properties

Stars

258 stars

Watchers

17 watching

Forks

41 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.