Skip to content

fix(pr): pin analysis engine config per calculateGamePR run - #150

Merged
nodots merged 1 commit into
developmentfrom
fix/pr-analysis-config-pin
Aug 26, 2026
Merged

nodots merged 1 commit into
developmentfrom
fix/pr-analysis-config-pin

Conversation

@nodots

@nodots nodots commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Problem

The gnubg engine config is a mutable process-global shared with robot turn execution. Once robots configure per-skill settings (nodots/backgammon-ai#65), PR analysis inherits whatever the last robot turn left behind — including grading a robot's moves with the robot's own move-selection settings, which yields equity loss 0 and PR 0.0 for every robot game.

Fix

calculateGamePR re-asserts a complete ANALYSIS_HINTS_CONFIG (2-ply, Huge filter, noise 0, pruning) at the start of every run, via a new optional configure hook on AiModuleInterface. The config is complete on purpose: partial configs merge into whatever the previous caller left behind.

Known limitation: a robot turn in another game can still interleave mid-analysis (the config is process-global); this pins the common sequential case.

Tests

Two new cases in PerformanceRatingCalculator.test.ts (configure called per run with the full config; module without configure tolerated). Suite: 22 passed. The 3 gnuPositionId suite failures are pre-existing on this machine (native addon missing gnubg.weights), untouched by this change.

Related: nodots/backgammon-ai#65, nodots/backgammon-api fix/robot-pr-pending-and-analysis-config.

https://claude.ai/code/session_01JUcWgZDmavXuK6Xkeejd5W

The gnubg engine config is a mutable process-global shared with robot
turn execution. Once robots configure per-skill settings, PR analysis
inherited whatever the last robot turn left behind — including the case
where the robot's own move-selection settings graded the robot's moves,
yielding equity loss 0 and PR 0.0 for every robot.

calculateGamePR now re-asserts a complete ANALYSIS_HINTS_CONFIG
(2-ply, Huge filter, noise 0, pruning) at the start of every run via an
optional configure hook on AiModuleInterface.

Claude-Session: https://claude.ai/code/session_01JUcWgZDmavXuK6Xkeejd5W
@nodots
nodots merged commit c68fb47 into development Aug 26, 2026
1 check passed
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