f5463f8686
Some browsers don't report navigator.deviceMemory to keep fingerprintability to a minimum. Currently, lila assumes that such a machine provides at most 256MB RAM, thus setting a 32MB max hashtable limit. This was a reasonable starting point when Stockfish was pure JavaScript in a single thread, but with up 16 core WASM support this limitation is a bit more painful. Modify the memory estimation: if the browser is modern enough to have full WASM/SharedArrayBuffer support, and thus run the parallel WASM versions, assume the machine has at least 2GB of RAM. If it doesn't, assume 512MB. This gives a maximum hashtable of 256MB and 64MB, respectively. The assumed minimum RAM values roughly correspond to Firefox's official system requirements for the 32-bit and 64-bit version. Although that doesn't necessarily correspond to WASM support, it's a reasonable starting point for a guess. Note that guessing wrong isn't harmful, it just gives the user the option to shoot themselves in the foot, and even that is limited because we still only use 1/8th of the guessed system RAM. |
||
---|---|---|
.. | ||
@build/rollupProject | ||
@types | ||
analyse | ||
ceval | ||
challenge | ||
chat | ||
chess | ||
cli | ||
common | ||
dasher | ||
dgt | ||
editor | ||
game | ||
insight | ||
learn | ||
lobby | ||
msg | ||
notify | ||
nvui | ||
palantir | ||
puz | ||
puzzle | ||
racer | ||
round | ||
serviceWorker | ||
simul | ||
site | ||
speech | ||
storm | ||
swiss | ||
tournament | ||
tournamentCalendar | ||
tournamentSchedule | ||
tree | ||
README.md | ||
build | ||
gulpfile.js | ||
package.json | ||
tsconfig.base.json | ||
tsconfig_module.base.json |
README.md
Client-side modules
CSS
cd ui/
yarn install # only the first time
gulp css
This incrementally rebuilds the sass for all ui/ modules on file change.
Hack
The structure of a CSS module is as follows:
- css/
- forum/
- _forum.scss # imports the files below
- _post.scss
- _search.scss
- ...
- build/
- _forum.scss # imports dependencies and `../forum/forum`.
- forum.light.scss # generated
- forum.dark.scss # generated
- forum.transp.scss # generated