Auto-Elo in V4

202 views
Skip to first unread message

Wilhelm

unread,
Mar 5, 2026, 4:22:51 AMMar 5
to PicoChess

A) The Auto-Elo mode in V4 does not work correctly.
It can be selected and configured through the menu, but afterwards the engine still calculates with its maximum strength.

The following error message appears in the log file:

ERROR     engine - _engine_rating: invalid option set for UCI_Elo=((1566 / 50 + 1) * 50), exception=unsupported operator: Div

Maybe someone can help identify the cause of this problem.



B) Suggestion for improvement

In both versions, the rating value in Auto-Elo mode is reduced down to 0. As a result, at some point the Elo value no longer changes, even if all games are won or lost. This is probably not what the developer or the user intended.

In my opinion it would be better to set a lower limit for the rating value, for example 25 or 30. This would ensure that the engine’s Elo rating could still change by about ±2 points per game.

For my own setup I solved this issue as follows:

def _save_rating(self, new_rating: Rating):
    write_picochess_ini("pgn-elo", max(500, int(new_rating.rating)))
    write_picochess_ini("rating-deviation", max(26, int(new_rating.rating_deviation)))

There are certainly better and more elegant solutions.

RandyR

unread,
Mar 9, 2026, 5:44:24 PMMar 9
to PicoChess
Hi Wilhelm,

I had a chance to look at the auto-Elo issue. Yes, there seems to be a problem in engine.py. Here is the error I am seeing in v4.2.3:

2026-03-09 14:25:07.274   ERROR     engine - _engine_rating: invalid option set for UCI_Elo=max(1320, int(1164 / 50 + 1) * 50), exception=unsupported function call: Name(id='int', ctx=Load())

I'm sure Johan can solve it. :^)

Randy

Johan Sjöblom

unread,
Mar 10, 2026, 6:51:25 AMMar 10
to PicoChess
Yes, Good testing, thanx. I did see the post earlier, but I ran out of time while building 4.2.3. I will most likely make a hotfix to the master code to fix this, at latest in the weekend.
-- Johan

Wilhelm

unread,
Apr 26, 2026, 4:05:46 AMApr 26
to PicoChess
Using AI, I modified the section "def safe_eval_elo(expr):" in engine.py (lines 56 to 97).

The error message no longer appears, and the engine calculates using the Auto-Elo value. At least I manage to win. :)

There's still one minor issue:
Before the game starts, the browser window displays the engine's maximum playing strength: "Player (1682) vs Patricia 5.0 (Auto Elo) (3309)"
However, as soon as the engine makes its first move on the board, this changes: "Player (1682) vs Patricia 5.0 (Auto Elo) (1700)"

Greetings and thanks to everyone who contributes their time to this project 
Wilhelm
engine.py

Johan Sjöblom

unread,
Apr 26, 2026, 8:16:25 AMApr 26
to PicoChess
Theres finally an issue opened for this: https://github.com/JohanSjoblom/picochess/issues/384
Reply all
Reply to author
Forward
0 new messages