Skip to content

[DO NOT MERGE until backend #235 is deployed] Saved analysis says which engine made it - #336

Draft
ashtonanderson wants to merge 2 commits into
mainfrom
claude/analysis-engine-tag
Draft

ashtonanderson wants to merge 2 commits into
mainfrom
claude/analysis-engine-tag

Conversation

@ashtonanderson

@ashtonanderson ashtonanderson commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Caution

DO NOT MERGE until CSSLab/maia-platform-backend#235 is merged AND deployed.
Without it, saved analysis comes back unlabelled, so every saved position would be searched again on every visit, for every visitor. Being merged isn't enough: check that the live get_engine_analysis returns an engine field first.

Saved analysis now says which engine made it, and evals from an older engine get redone when their position is visited. Today a game analysed before #334 keeps Stockfish 17's evals and move marks for good, under a label saying Stockfish 19.

What changes

  • Every search records its engine, and it's saved with the eval.
  • A saved eval from another engine, or with none, shows at once and is searched again when its position is visited. It stays on show until that search finishes, then is replaced and saved with its engine.
  • Once redone, a position stays done for everyone, so this cost is paid once per position.
  • Unchanged: evals from the server's own analysis, and lower targets such as Learn From Mistakes at depth 12.

stockfishSearchIsDone (src/lib/analysis.ts) is now the one definition of "done", used by the analysis page, full-game analysis and drills.

Things to know

  • Plies nobody visits keep Stockfish 17's eval and colour, so an old game can still mix the two until its positions are visited.
  • Full-game analysis now redoes older evals, so it takes longer on old games.
  • The human bars work: human-bar-2 ignores cached evals for now, and could use older_engine instead.

Testing

  • Checks: npm test (97), npx tsc --noEmit and npm run lint pass.
  • In a browser, with the backend's routes answered by a test script: a saved eval from this engine starts no search. One with no engine and planted values of -7.77 showed at 0.48 s, stayed until the search finished, and was replaced at 3.67 s and saved with its engine.
  • Cost on games with saved analysis, 6 paired loads per device: no later within the noise. Phone: board 2.34 → 2.46 s (+0.10 s paired), saved results on show 4.64 → 4.54 s. Desktop: board 0.34 s on both, saved results 0.83 → 0.72 s.
  • Not tested: this frontend against the real backend change, on a real iPhone, or stepping and battery on old games. The search itself still uses the CPU for a few seconds on each position it redoes.

🤖 Generated with Claude Code

ashtonanderson and others added 2 commits November 5, 2026 04:20
…vals are redone

Saved analysis had no engine, and the backend replaces an eval only at a greater
depth, so a game analysed before Stockfish 19 kept Stockfish 17's evals and marks
for good, under a label saying Stockfish 19, and later saves couldn't change them.

Every search now records its engine and saves it. A saved eval from another engine,
or without one, shows at once, and is searched again when its position is visited;
it stays on show until that search finishes, then is replaced and saved with its
engine. Evals from the server's own analysis aren't affected.

Needs the backend to store the engine first: without it, saved analysis comes back
unlabelled, and every saved position would be searched on every visit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
maia-platform-frontend Ready Ready Preview Nov 5, 2026 4:32am UTC

Request Review

@ashtonanderson ashtonanderson changed the title Saved analysis says which engine made it, and older evals are redone [DO NOT MERGE until backend #235 is deployed] Saved analysis says which engine made it Nov 5, 2026

This branch was successfully deployed

1 active deployment
Preview — d00a71f3 Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant