Learn fractional win-rate advantage instead of unbounded plus/minus #9

Merged
jheaps merged 1 commits from feature/fractional-learned-weights into master 2026-08-31 13:43:09 -06:00
Owner

Piece-square and feature weights now converge to a presence-weighted fractional win-rate per cell (percent of games won with a piece there minus percent lost), tracked via running visits/score sums instead of an incrementally clamped nudge.

The training signal is also scaled by how much of a game's result is NOT already explained by the winner's average material edge (via the standard centipawn win-probability curve), so a piece no longer gets credit merely for existing on the winning side of a material blowout in the endgame.

No ABI changes — all changes are internal to native/chess_engine.

Verified with a standalone smoke test: backward-compatible loading of old-format weight files, correct fractional accumulation, a ~125x smaller update for a materially-dominant win vs. an even-material win on the same square, and a full save/load round-trip.

Piece-square and feature weights now converge to a presence-weighted fractional win-rate per cell (percent of games won with a piece there minus percent lost), tracked via running visits/score sums instead of an incrementally clamped nudge. The training signal is also scaled by how much of a game's result is NOT already explained by the winner's average material edge (via the standard centipawn win-probability curve), so a piece no longer gets credit merely for existing on the winning side of a material blowout in the endgame. No ABI changes — all changes are internal to native/chess_engine. Verified with a standalone smoke test: backward-compatible loading of old-format weight files, correct fractional accumulation, a ~125x smaller update for a materially-dominant win vs. an even-material win on the same square, and a full save/load round-trip.
jheaps added 1 commit 2026-08-31 13:42:36 -06:00
Piece-square and feature weights now converge to a presence-weighted
fractional win-rate per cell (percent of games won with a piece there
minus percent lost), tracked via running visits/score sums instead of
an incrementally clamped nudge. The training signal is also scaled by
how much of a game's result is NOT already explained by the winner's
average material edge (via the standard centipawn win-probability
curve), so a piece no longer gets credit merely for existing on the
winning side of a material blowout in the endgame.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018CmAti1baCjidbJM2HeJfk
jheaps merged commit b7c9227bb8 into master 2026-08-31 13:43:09 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jheaps/JoshHeaps.Net#9