Skip to content

Feature/maia integration#730

Open
xiaoas wants to merge 49 commits intofranciscoBSalgueiro:feature/maia-integrationfrom
xiaoas:feature/maia-integration
Open

Feature/maia integration#730
xiaoas wants to merge 49 commits intofranciscoBSalgueiro:feature/maia-integrationfrom
xiaoas:feature/maia-integration

Conversation

@xiaoas
Copy link
Contributor

@xiaoas xiaoas commented Mar 5, 2026

  • Bumped pgn_reader from 0.26.0 to 0.29.0
  • Bumped shakmaty from 0.27 to 0.30.0
  • adding maia typed engine to local engine form. Allow maia onnx engines to get added.
  • added maia integration in backend. Added maia_eval which is the simplest command for calling maia.

franciscoBSalgueiro and others added 30 commits February 28, 2026 00:51
Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
…ng silently ignored.

Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
…ariation-comment-encoding-db

Add support for variations, commments and NAGs in move encoding
The cleanSan() function had two bugs that prevented castling via
keyboard input:

1. A length > 2 guard blocked 2-char inputs like "OO" and "00" from
   being recognized as kingside castling.
2. Literal string matching only caught exact lowercase hyphenated
   forms ("o-o", "o-o-o"), missing "O-O", "0-0", "OO", "00", etc.

Replace with regex-based normalization that accepts any combination
of O/o/0 with optional hyphens for both kingside and queenside
castling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the Lichess API returns an error (rate limit, server error), it
responds with HTML instead of JSON. The code was calling res.json()
before checking res.ok, causing a SyntaxError crash. Now checks
res.ok first and throws a descriptive error message.

Closes franciscoBSalgueiro#707

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Suppress all compiler warnings in release builds:
- Gate specta_typescript import behind #[cfg(debug_assertions)]
- Allow deprecated shell().open() with TODO to migrate to tauri-plugin-opener
- Silence dead_code warnings for White/Black structs, MmapSearchIndex fields
  and methods, and decode_moves function

Closes franciscoBSalgueiro#659

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Chess.com exports include [%timestamp N] annotations alongside [%clk]
in PGN comments. Since chessops only recognizes [%clk], the timestamp
annotations were left in the comment text, cluttering the display.

Now strips [%timestamp N] from comment text after parsing, keeping
the display clean while preserving [%clk] clock data.

Closes franciscoBSalgueiro#708

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…algueiro#633)

Two bugs in practice mode:

1. goToNext() always followed child 0 (main line) instead of the
   drill path, so pressing right arrow after going back could land
   on wrong variations instead of the practice line.

2. goToNext() played move sounds unconditionally, even when at the
   practice position where forward navigation should be blocked
   until the answer is revealed.

Add a practicePath field to the tree store that the practice panel
sets when starting a drill. When set, goToNext follows the drill
path instead of always taking child 0, and blocks silently (no
sound, no position change) at the end of the path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… be fetched in engineSettingsForm.

Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
…ranciscoBSalgueiro#670)

The root cause was twofold:

1. Engine settings (Threads/Hash) were always read from the engine's
   global defaults (opponent.engine.settings) but updates were spread
   into an orphaned key that was never read back. Added an
   engineSettings field to OpponentSettings to store per-opponent
   overrides, and read from it in both OpponentForm and BoardGame.

2. Switching Human->Engine always reset GoMode to { Depth, 24 },
   discarding any previous value. Now preserves the existing go
   value when switching back to engine mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ELO fields (white_elo, black_elo) to the binary search index
(SearchGameEntry) so the parallel mmap scan can rank games by rating.

Replace the naive "first 10 matches" sampling with a bounded min-heap
that retains only the 10 highest-rated games during the scan. This
ensures the sample games shown in position search are genuinely the
highest-rated games containing that position, not arbitrary ones.

Bump search index version from 3 to 4; old .ecsi files are detected
as invalid and regenerated automatically on first search.

Fixes franciscoBSalgueiro#673

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ranciscoBSalgueiro#634)

When games are deleted, players/events/sites that were created during
game import are left behind as orphaned rows. This adds cleanup of
those orphaned records (and their Info table counts) to all three
game deletion functions: delete_db_game, delete_duplicated_games,
and delete_empty_games.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verifies that delete_orphaned_data correctly removes players, events,
and sites no longer referenced by any game, preserves the sentinel
"Unknown" rows and still-referenced records, and updates Info table
counts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
BaseEngine has no Drop impl and main.rs has no RunEvent::ExitRequested
handler, so engine child processes can outlive the app. Well-behaved
engines (Stockfish, Komodo) mask this by exiting on stdin close, but
engines that ignore EOF survive indefinitely as orphans.

- Add Drop impl to BaseEngine calling child.start_kill()
- Add kill_sync() to BaseEngine and EngineProcess for non-async contexts
- Add RunEvent::ExitRequested handler to kill all active engine processes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
franciscoBSalgueiro and others added 19 commits March 3, 2026 15:53
…erformance and reduce unnecessary allocations

Enhance lexer to support new visitor methods for handling tags, movetext, and comments, improving PGN parsing

Add Maia engine support in the main application, including session management and evaluation commands

Create a new ONNX module for handling Maia evaluations, integrating with the existing engine architecture

Update engine form to support Maia ONNX files, including runtime selection and Elo configuration

Refactor engine settings page to accommodate new Maia engine settings and Elo adjustments

Improve error handling in engine configuration retrieval and ensure compatibility with UCI and Maia engines

Update translations for new engine types and settings, ensuring consistency across multiple languages

Refactor state management for engine settings, ensuring proper handling of runtime and configuration changes

Fix various minor issues in the UI components related to engine management and settings display

Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
Signed-off-by: xiaoas <xiaoqilin82@gmail.com>
@xiaoas
Copy link
Contributor Author

xiaoas commented Mar 5, 2026

@franciscoBSalgueiro While merging upstream changes, I've also reimplemented pgn_reader::Visitor for some newly added structs. Which makes me wonder if it's possible to merge this change to master first?

Considering the feature is gated behind an added maia engine it's uncommon for users to stumble upon under-tested features. Also there have been substantial refactors (this commit) that would be beneficial to merge into master.

If you think keeping the changes to a feature branch would be better, please reset this branch to master to allow this PR to continue. I somehow messed up the merging process and integrated latest master instead.

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.

4 participants