feat : add multi threaded stockfish 16
This commit is contained in:
@@ -5,6 +5,34 @@
|
|||||||
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
|
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
|
||||||
"cleanUrls": true,
|
"cleanUrls": true,
|
||||||
"trailingSlash": false,
|
"trailingSlash": false,
|
||||||
"predeploy": ["npm run lint", "npm run build"]
|
"predeploy": ["npm run lint", "npm run build"],
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"source": "/",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"key": "Cross-Origin-Embedder-Policy",
|
||||||
|
"value": "require-corp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cross-Origin-Opener-Policy",
|
||||||
|
"value": "same-origin"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "/engines/stockfish-wasm/stockfish-nnue-16.js",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"key": "Cross-Origin-Embedder-Policy",
|
||||||
|
"value": "require-corp"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Cross-Origin-Opener-Policy",
|
||||||
|
"value": "same-origin"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,44 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
const { PHASE_PRODUCTION_BUILD } = require("next/constants");
|
||||||
const nextConfig = {
|
|
||||||
output: "export",
|
const nextConfig = (phase) =>
|
||||||
|
/** @type {import('next').NextConfig} */ ({
|
||||||
|
output: phase === PHASE_PRODUCTION_BUILD ? "export" : undefined,
|
||||||
trailingSlash: false,
|
trailingSlash: false,
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
images: {
|
images: {
|
||||||
unoptimized: true,
|
unoptimized: true,
|
||||||
},
|
},
|
||||||
};
|
headers:
|
||||||
|
phase === PHASE_PRODUCTION_BUILD
|
||||||
|
? undefined
|
||||||
|
: () => [
|
||||||
|
{
|
||||||
|
source: "/",
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
key: "Cross-Origin-Embedder-Policy",
|
||||||
|
value: "require-corp",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "Cross-Origin-Opener-Policy",
|
||||||
|
value: "same-origin",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: "/engines/stockfish-wasm/stockfish-nnue-16.js",
|
||||||
|
headers: [
|
||||||
|
{
|
||||||
|
key: "Cross-Origin-Embedder-Policy",
|
||||||
|
value: "require-corp",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "Cross-Origin-Opener-Policy",
|
||||||
|
value: "same-origin",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = nextConfig;
|
module.exports = nextConfig;
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
14
public/engines/stockfish-wasm/stockfish-nnue-16.js
Normal file
14
public/engines/stockfish-wasm/stockfish-nnue-16.js
Normal file
File diff suppressed because one or more lines are too long
BIN
public/engines/stockfish-wasm/stockfish-nnue-16.wasm
Normal file
BIN
public/engines/stockfish-wasm/stockfish-nnue-16.wasm
Normal file
Binary file not shown.
@@ -6,7 +6,7 @@ export class Stockfish16 extends UciEngine {
|
|||||||
const isWasmSupported = Stockfish16.isWasmSupported();
|
const isWasmSupported = Stockfish16.isWasmSupported();
|
||||||
|
|
||||||
const enginePath = isWasmSupported
|
const enginePath = isWasmSupported
|
||||||
? "engines/stockfish-wasm/stockfish-nnue-16-single.js"
|
? "engines/stockfish-wasm/stockfish-nnue-16.js"
|
||||||
: "engines/stockfish.js";
|
: "engines/stockfish.js";
|
||||||
|
|
||||||
super(EngineName.Stockfish16, enginePath);
|
super(EngineName.Stockfish16, enginePath);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default function EvaluationBar({ height }: Props) {
|
|||||||
alignItems="center"
|
alignItems="center"
|
||||||
width="2rem"
|
width="2rem"
|
||||||
height={height}
|
height={height}
|
||||||
border={`1px solid black`}
|
border="1px solid black"
|
||||||
borderRadius="5px"
|
borderRadius="5px"
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default function Accuracies() {
|
|||||||
lineHeight={1}
|
lineHeight={1}
|
||||||
padding={1}
|
padding={1}
|
||||||
fontWeight="bold"
|
fontWeight="bold"
|
||||||
border={`1px solid #424242`}
|
border="1px solid #424242"
|
||||||
>
|
>
|
||||||
{`${gameEval?.accuracy.white.toFixed(1)} %`}
|
{`${gameEval?.accuracy.white.toFixed(1)} %`}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -37,7 +37,7 @@ export default function Accuracies() {
|
|||||||
lineHeight={1}
|
lineHeight={1}
|
||||||
padding={1}
|
padding={1}
|
||||||
fontWeight="bold"
|
fontWeight="bold"
|
||||||
border={`1px solid #424242`}
|
border="1px solid #424242"
|
||||||
>
|
>
|
||||||
{`${gameEval?.accuracy.black.toFixed(1)} %`}
|
{`${gameEval?.accuracy.black.toFixed(1)} %`}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
Reference in New Issue
Block a user