Skip to content

Mate score should be displayed higher on the graph than TB-wins #276

@xu-shawn

Description

@xu-shawn

Example: https://tcec-chess.com/#div=sf&game=44&season=28
Image

I believe the reason for this is in the eval clamping code in graph.js:

tcecgui/js/graph.js

Lines 150 to 169 in 11385d2

function clamp_eval(eval_) {
if (NON_EVALS.has(eval_))
return undefined;
if (!isNaN(eval_)) {
eval_ *= 1;
if (!Number.isFinite(eval_))
return Clamp(eval_, -EVAL_CLAMP, EVAL_CLAMP);
return eval_;
}
if (eval_ && eval_.includes('-'))
eval_ = -EVAL_CLAMP;
else if (eval_ != undefined)
eval_ = EVAL_CLAMP;
else
eval_ = 0;
return eval_;
}

Here, mate scores are set to ±128, but TB wins, which are usually beyond this range (from 199-200 in SF's case), do not get clamped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions