Repository navigation
Conversation
Adds maia3.scoring.Maia3Scorer, which returns Maia3's log-probability of given moves in given positions, and a maia3-score command that scores the moves of PGN games to JSONL or CSV. Scoring defaults to real move history and fp32; --no-use-history and --use-amp (use_history / use_amp in Python) match maia3-uci's defaults.
DomHudson
force-pushed
the
feat/move-scoring
branch
from
October 21, 2026 21:45
9e477f8 to
fa280a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a way to get Maia3's log-probability of given moves in given positions, both from Python and from the command line.
maia3.scoring.Maia3Scorer: loads a model the same waymaia3-ucidoes (built-in aliases, Hugging Face download, or a local checkpoint). It featurizes positions or whole PGN games and returns batched log-probabilities, with illegal moves masked out.Maia3Scorer.from_pretrained("maia3-5m"), orMaia3Scorer(cfg)with a config frommaia3.uci.parse_args.featurize_position(board, moves, self_elo, oppo_elo)takes history from the board's move stack;featurize_game(game, white_elo, black_elo)featurizes every ply of a game.ValueError; it is not silently scored as-inf.maia3-score: scores the moves of PGN games to JSONL or CSV, writing one row per move (game, ply, fen, move, played, self_elo, oppo_elo, logp).--moves allscores every legal move, not just the played one.maia3-uci's option parser.Defaults that differ from
maia3-uciBoth can be switched, and both are documented in the README.
maia3-uci's default with--use-uci-history)--no-use-history/use_history=False--use-amp/use_amp=True(CUDA only)Without matching settings, scores won't exactly match the policy that
maia3-ucireports for the same position. That's why the README calls this out.Testing
tests/test_scoring.pyuses a small randomly initialized model, so it needs no download. It checks that:Maia3UCIEngine's policy in both history modes, which also covers the black-side mirroring;Also checked by hand with the released 5M model, through both the CLI and the README's Python example. The mixed-precision test needs CUDA and was skipped in CPU-only runs.
Install the test dependency with
pip install -e .[test]and runpytest tests.