Skip to content

Commit

Permalink
express cloud eval capability with engine property
Browse files Browse the repository at this point in the history
  • Loading branch information
schlawg committed Nov 27, 2024
1 parent 540db34 commit b42c98b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 1 addition & 4 deletions ui/ceval/src/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,7 @@ export default class CevalCtrl {
}

get isCacheable(): boolean {
//>=sf16 or fsf14+nnue
return (
this.engines.active?.tech === 'NNUE' && this.engines.active.requires.includes('dynamicImportFromWorker')
);
return !!this.engines.active?.cloudEval;
}

get showingCloud(): boolean {
Expand Down
4 changes: 4 additions & 0 deletions ui/ceval/src/engines/engines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export class Engines {
tech: 'NNUE',
requires: ['sharedMem', 'simd', 'dynamicImportFromWorker'],
variants: [key],
cloudEval: true,
assets: {
version: 'sfw006',
root: 'npm/lila-stockfish-web',
Expand Down Expand Up @@ -72,6 +73,7 @@ export class Engines {
tech: 'NNUE',
requires: ['sharedMem', 'simd', 'dynamicImportFromWorker'],
minMem: 1536,
cloudEval: true,
assets: {
version: 'sfw006',
root: 'npm/lila-stockfish-web',
Expand All @@ -88,6 +90,7 @@ export class Engines {
tech: 'NNUE',
requires: ['sharedMem', 'simd', 'dynamicImportFromWorker'],
minMem: 2560,
cloudEval: true,
assets: {
version: 'sfw006',
root: 'npm/lila-stockfish-web',
Expand Down Expand Up @@ -123,6 +126,7 @@ export class Engines {
tech: 'HCE',
requires: ['sharedMem', 'simd', 'dynamicImportFromWorker'],
variants: variants.map(v => v[0]),
cloudEval: true,
assets: {
version: 'sfw006',
root: 'npm/lila-stockfish-web',
Expand Down
2 changes: 2 additions & 0 deletions ui/ceval/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface ExternalEngineInfoFromServer extends BaseEngineInfo {

export interface ExternalEngineInfo extends ExternalEngineInfoFromServer {
tech: 'EXTERNAL';
cloudEval?: false;
}

export interface BrowserEngineInfo extends BaseEngineInfo {
Expand All @@ -57,6 +58,7 @@ export interface BrowserEngineInfo extends BaseEngineInfo {
assets: { root?: string; js?: string; wasm?: string; version?: string; nnue?: string[] };
requires: Feature[];
obsoletedBy?: Feature;
cloudEval?: boolean;
}

export type EngineInfo = BrowserEngineInfo | ExternalEngineInfo;
Expand Down

0 comments on commit b42c98b

Please sign in to comment.