lichess-org / stockfish.wasm

WebAssembly port of the strong chess engine Stockfish
https://npmjs.com/package/stockfish.wasm
GNU General Public License v3.0
271 stars 46 forks source link

Max memory for analysis on Firefox = 32MB #27

Closed andsvb2 closed 3 years ago

andsvb2 commented 3 years ago

Hi,

I don't know if this is indeed a new issue, something related to issue #3 or a configuration problem, but in Firefox the possible memory values in the analysis page is 16MB or 32MB. On Google Chrome I can adjust the memory between 16MB - 1GB.

Inspecting the slider on Firefox and Chrome show this difference:

Firefox:

<div class="setting">
    <label for="analyse-memory">Memory</label>
    <input id="analyse-memory" type="range" min="4" max="5" step="1">
    <div class="range_value">32MB</div>
</div>

On Firefox inspector there is a overflow bubble with the message This element is causing an element to overflow.. The bubble is at the end of each inline inside the block.

Chrome:

<div class="setting">
<label for="analyse-memory">Memory</label>
<input id="analyse-memory" type="range" min="4" max="10" step="1">
<div class="range_value">1GB</div></div>

I'm not a developer, so I couldn't figure out what information would be relevant to this issue or if it is related to the section Current limitations.

Thank you for your work.

System OS: EndeavourOS Kernel: Linux 5.10.7-zen1-1-zen x86_64 CPU: i7-6500U Skylake Memory size: 16 GB DDR3 Firefox version: 84.0.2 Chrome version: 87.0.4280.141

niklasf commented 3 years ago

Unfortunately Firefox does not implement navigator.deviceMemory, yet. So there's no reliable way to check that the client will have sufficient memory.

Fortunately the strength gained by larger hashtables is pretty marginal in the grand scheme of things, so I think it's better to wait than add a hacky workaround.

Edit: Note that being careful with memory allocations is a choice made in lila. This package does not enforce such a limit, besides the 1 GiB limitation.

andsvb2 commented 3 years ago

So it was one of the current limitations.

I appreciate the information and apologize for sending this non-issue.

niklasf commented 3 years ago

No worries. Just recently I learned that a long-standing limitation (#26) was no longer an issue, so it's good to check from time to time.