fall back to wasm rather than asmjs if pnacl fails
Unlike PNaCl WASM is very reliable if the initial feature check passes.
This commit is contained in:
parent
87aa66753e
commit
d8b2818ef1
|
@ -578,10 +578,10 @@ export default class AnalyseCtrl {
|
|||
console.log('Local eval failed after depth ' + (ceval && ceval.depth), lastError);
|
||||
if (this.ceval.pnaclSupported) {
|
||||
if (ceval && ceval.depth >= 20 && !ceval.retried) {
|
||||
console.log('Remain on native stockfish for now');
|
||||
console.log('Remain on native Stockfish for now');
|
||||
ceval.retried = true;
|
||||
} else {
|
||||
console.log('Fallback to ASMJS now');
|
||||
console.log('Fallback to WASM/ASMJS now');
|
||||
this.instanciateCeval(true);
|
||||
this.startCeval();
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ export default function(opts: CevalOpts): CevalCtrl {
|
|||
};
|
||||
|
||||
const pnaclSupported: boolean = !opts.failsafe && 'application/x-pnacl' in navigator.mimeTypes;
|
||||
const wasmSupported = !opts.failsafe && typeof WebAssembly === 'object' && WebAssembly.validate(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
|
||||
const wasmSupported = typeof WebAssembly === 'object' && WebAssembly.validate(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
|
||||
const minDepth = 6;
|
||||
const maxDepth = storedProp<number>(storageKey('ceval.max-depth'), 18);
|
||||
const multiPv = storedProp(storageKey('ceval.multipv'), opts.multiPvDefault || 1);
|
||||
|
|
Loading…
Reference in a new issue