Skip to content

UCI engine makes LucasChess hangs on Windows. I have a simple fix. #7

Description

@iandevpro

Hi!

Thanks a lot for publishing maia-3!
I tried to use on Windows with LucasChess app, which has possibility to add UCI engines.

  1. I installed engine with "python -m pip install .", it created a set of .exe files.
  2. Configured LucasChess to use one of the engines C:\Python\Scripts\maia3-5m.exe
  3. LucasChess hangs when starting game

I had a suspicion, that on Windows stderr is wrapped to go to stdout and LucasChess is confused to parse non-UCI messages like warning, etc.
I commented them out, did again "python -m pip install ." - and it worked!

Here is a simple fix below.

Thanks,
Ian

--- uci.py.orig 2026-05-27 20:27:59.225321200 -0700
+++ uci.py      2026-06-02 21:57:16.078947400 -0700
@@ -149,12 +149,12 @@
     renamed = {k.replace("smolgen", "gab"): v for k, v in state_dict.items()}

     missing, unexpected = model.load_state_dict(renamed, strict=False)
-    if missing:
-        print(f"warning: missing keys: {missing[:5]}{'...' if len(missing) > 5 else ''}",
-              file=sys.stderr, flush=True)
-    if unexpected:
-        print(f"warning: unexpected keys: {unexpected[:5]}{'...' if len(unexpected) > 5 else ''}",
-              file=sys.stderr, flush=True)
+#    if missing:
+#        print(f"warning: missing keys: {missing[:5]}{'...' if len(missing) > 5 else ''}",
+#              file=sys.stderr, flush=True)
+#    if unexpected:
+#        print(f"warning: unexpected keys: {unexpected[:5]}{'...' if len(unexpected) > 5 else ''}",
+#               file=sys.stderr, flush=True)

     model.eval()
     return model
@@ -244,7 +244,7 @@
             spec = getattr(self.cfg, "model_spec", None)
             if spec is None:
                 raise RuntimeError("No model or checkpoint was configured.")
-            print(f"resolving Maia3 checkpoint for {spec.display_name}", file=sys.stderr, flush=True)
+            # print(f"resolving Maia3 checkpoint for {spec.display_name}", file=sys.stderr, flush=True)
             self.cfg.checkpoint_path = resolve_checkpoint_path(
                 spec,
                 checkpoint_filename=self.cfg.checkpoint_filename,
@@ -255,9 +255,9 @@
                 token=self.cfg.hf_token,
             )

-        print(f"loading Maia3 checkpoint {self.cfg.checkpoint_path}", file=sys.stderr, flush=True)
+        # print(f"loading Maia3 checkpoint {self.cfg.checkpoint_path}", file=sys.stderr, flush=True)
         self.model = load_model(self.cfg)
-        print("Maia3 ready", file=sys.stderr, flush=True)
+        # print("Maia3 ready", file=sys.stderr, flush=True)

     def _reset_history(self):
         self.history.clear()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions