update ceval to sf12+

ceval-12
Niklas Fiekas 2020-12-15 00:17:26 +01:00
parent 9044b67891
commit 47596bcfa2
5 changed files with 22 additions and 23 deletions

View File

@ -46,7 +46,7 @@ object features {
"Deep Stockfish 12+ server analysis"
),
tr(unlimited)(
"Instant local Stockfish 11+ analysis"
"Instant local Stockfish 12+ analysis"
),
tr(unlimited)(
a(href := "https://lichess.org/blog/WN-gLzAAAKlI89Xn/thousands-of-stockfish-analysers")(
@ -125,7 +125,7 @@ object features {
a(href := routes.Tournament.home())("Arena tournaments")
),
tr(check)(
"Board editor and analysis board with Stockfish 11+"
"Board editor and analysis board with Stockfish 12+"
),
tr(unlimited)(
a(href := routes.Puzzle.home())("Tactics puzzles")

View File

@ -72,32 +72,31 @@ class WebWorker extends AbstractWorker {
}
class ThreadedWasmWorker extends AbstractWorker {
static instances: {Stockfish?: any, StockfishMv?: any} = {};
private sf?: any;
private static protocols: {Stockfish?: Promise<Protocol>, StockfishMv?: Promise<Protocol>} = {};
private static sf: {Stockfish?: any, StockfishMv?: any} = {};
private name: 'Stockfish' | 'StockfishMv';
boot(): Promise<Protocol> {
const name = officialStockfish(this.workerOpts.variant) ? 'Stockfish' : 'StockfishMv';
ThreadedWasmWorker.instances[name] ||= lichess.loadScript(this.url, {sameDomain: true}).then(_ => window[name]());
return ThreadedWasmWorker.instances[name].then((sf: any) => {
this.sf = sf;
this.name = officialStockfish(this.workerOpts.variant) ? 'Stockfish' : 'StockfishMv';
ThreadedWasmWorker.protocols[this.name] ||= lichess.loadScript(this.url, {sameDomain: true}).then(_ => window[this.name]()).then((sf: any) => {
ThreadedWasmWorker.sf[this.name] = sf;
const protocol = new Protocol(this.send.bind(this), this.workerOpts);
sf.addMessageListener(protocol.received.bind(protocol));
protocol.init();
return protocol;
});
return ThreadedWasmWorker.protocols[this.name]!;
}
destroy() {
// Terminated instances to not get freed reliably
// (https://github.com/ornicar/lila/issues/7334). So instead of
// destroying, just stop instances and keep them around for reuse.
this.send('stop');
this.sf = undefined;
this.protocol.sync?.stop();
}
send(cmd: string) {
this.sf?.postMessage(cmd);
ThreadedWasmWorker.sf[this.name]?.postMessage(cmd);
}
}

View File

@ -70,7 +70,7 @@ function threatButton(ctrl: ParentCtrl): VNode | null {
function engineName(ctrl: CevalCtrl): VNode[] {
const version = ctrl.engineName();
return [
h('span', version ? { attrs: { title: version } } : {}, ctrl.technology == 'wasmx' ? 'Stockfish 11+' : 'Stockfish 10+'),
h('span', version ? { attrs: { title: `${version} (classical)` } } : {}, ctrl.technology == 'wasmx' ? 'Stockfish 12+' : 'Stockfish 10+'),
ctrl.technology == 'wasmx' ? h('span.wasmx', { attrs: { title: 'Multi-threaded WebAssembly (fastest)' } }, 'wasmx') :
(ctrl.technology == 'wasm' ? h('span.wasm', { attrs: { title: 'Single-threaded WebAssembly fallback (second fastest)' } }, 'wasm') :
h('span.asmjs', { attrs: { title: 'Single-threaded JavaScript fallback (very slow)' } }, 'asmjs'))

View File

@ -20,9 +20,9 @@
"highcharts": "=4.2.5",
"hopscotch": "^0.3.1",
"jquery-bar-rating": "^1.2.2",
"stockfish-mv.wasm": "=0.4.0",
"stockfish-mv.wasm": "^0.5.0",
"stockfish.js": "^10.0.2",
"stockfish.wasm": "=0.8.0",
"stockfish.wasm": "^0.9.0",
"tablesort": "^5.1",
"zxcvbn": "^4.4.2"
},

View File

@ -4128,20 +4128,20 @@ stdout-stream@^1.4.0:
dependencies:
readable-stream "^2.0.1"
stockfish-mv.wasm@=0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/stockfish-mv.wasm/-/stockfish-mv.wasm-0.4.0.tgz#0a33aeb4e7f2c3c6abfec10b84fbba5b8cddaa5b"
integrity sha512-ZgW8T4iYP90Z2PZOJ3IdzmO5bW92IR3kjvX+287ZxdZq3FgBGWjmbg/rfbcNgme9n3IRx2qlVnhiMEgZE66DEw==
stockfish-mv.wasm@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/stockfish-mv.wasm/-/stockfish-mv.wasm-0.5.0.tgz#79a700850267296fce4af4363072f37db173360b"
integrity sha512-MKDCakp6vVvvf5FlLoM6gNUI4o8UoN/c8smAoc8N7bb26cmRtNqrsEG5YExDkiGy/B6dRouZBkZIR96vjbmkMg==
stockfish.js@^10.0.2:
version "10.0.2"
resolved "https://registry.yarnpkg.com/stockfish.js/-/stockfish.js-10.0.2.tgz#c8206aa3b0290171ace52b463a74112ea1f83989"
integrity sha512-treB3AYcdvRJ9SDPOyL0R2NcEAtQgG432nStfRzR4wzVELGQ6iVoeBHwvirHTfocNOTims7XNkK3SADaocsJmQ==
stockfish.wasm@=0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/stockfish.wasm/-/stockfish.wasm-0.8.0.tgz#99efc6eb7e47f3c14b03dfef1aa7991115a16650"
integrity sha512-vcvOZY86ifxnNn5NivG1PoG2JvLaa8T8y2ERa5WvzdDr5HC2UGs8ty7gzZd0aHVtPJEfl2+S6Vm0ycRioKDOUA==
stockfish.wasm@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/stockfish.wasm/-/stockfish.wasm-0.9.0.tgz#b3b6b420216d3f07f3b9d39a8aa40cc4562b58c1"
integrity sha512-Y5nqyi+RgV1VCEfHpK1iryK9NlKXCaNku5rvr6JIM8LHHWw2tnDAPldShysmtvRl9FBFKCchtlLR6ciCDgBAyw==
stream-combiner@~0.0.4:
version "0.0.4"