Play: the engine's strength only in its name, no Elo tag (desktop and Android)
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run

The owner: these are the engines' own ratings, «без поля эло, просто
число» — «Maia 1550», «Rodent V 2400 (Tal)»; the player's own rating keeps
its Elo tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-26 16:33:38 +03:00
parent 07a9e120b1
commit 56a30622fd
4 changed files with 22 additions and 12 deletions

View file

@ -20,7 +20,8 @@ All notable changes are listed here. Versions follow [Semantic Versioning](https
600–2600, Rodent V 800–3000 (its UCI_Elo). The dialog says that these are the engines'
ratings, not a person's Elo. (1.5's slider showed Maia's strength measured on the
Lichess blitz scale; a remembered strength keeps its number.) Android too: Maia
600–2600.
600–2600. The engine's strength is in its name in the game («Maia 1550»),
with no Elo tag for it.
- Offer Maia a draw (desktop and Android): she accepts when she is clearly worse, or
when the position is about level (at most +0.2 for her) and has kept its character for
her last three moves; after a refusal, again two of her moves later. She judges with

View file

@ -2137,7 +2137,6 @@ impl GameView {
&start.user_name,
start.user_elo,
&start.rival_name(),
start.strength,
&start.clock.map_or_else(|| "-".to_owned(), |tc| tc.pgn()),
) {
g.set_tag(&name, &value);

View file

@ -82,7 +82,6 @@ pub fn maia_game_tags(
&user_name,
None,
&format!("Maia {strength}"),
strength,
"-",
)
.into_iter()
@ -229,9 +228,10 @@ impl MaiaPlayer {
)
})?;
let strength = strength.clamp(PHONE_MIN, PHONE_MAX);
let p = self.maia.predict(&history, strength, opponent.unwrap_or(strength));
choose(&p, 1.0, random)
.map(|m| m.to_uci(CastlingMode::Standard).to_string())
let p = self
.maia
.predict(&history, strength, opponent.unwrap_or(strength));
choose(&p, 1.0, random).map(|m| m.to_uci(CastlingMode::Standard).to_string())
}
}

View file

@ -132,16 +132,16 @@ pub fn pause(clock: Option<(Duration, u32)>, ply: usize, only_move: bool) -> Dur
// ----- the game's tags -----------------------------------------------------------------
/// The tags of a game against a program (as Lichess writes one): `event` in the app's
/// language, the user's name ("?" unknown) and rating, the program's name («Maia 1500»,
/// «Rodent V 2400 (Tal)») and strength, the time control in PGN ("-": none). The rest
/// (date, result) is the game's.
/// language, the user's name ("?" unknown) and rating, the program's name with its
/// strength («Maia 1500», «Rodent V 2400 (Tal)»: the engine's own scale, so no Elo tag
/// for it — the owner's decision), the time control in PGN ("-": none). The rest (date,
/// result) is the game's.
pub fn game_tags(
event: &str,
user: Color,
user_name: &str,
user_elo: Option<u32>,
program: &str,
strength: u32,
time_control: &str,
) -> Vec<(String, String)> {
let maia = program.to_owned();
@ -151,8 +151,8 @@ pub fn game_tags(
user_name.trim().to_owned()
};
let (white, black, we, be, wt, bt) = match user {
Color::White => (you, maia, user_elo, Some(strength), "human", "program"),
Color::Black => (maia, you, Some(strength), user_elo, "program", "human"),
Color::White => (you, maia, user_elo, None, "human", "program"),
Color::Black => (maia, you, None, user_elo, "program", "human"),
};
let mut tags = vec![
("Event".to_owned(), event.to_owned()),
@ -380,6 +380,16 @@ impl Judge {
mod tests {
use super::*;
#[test]
fn the_engine_has_its_strength_in_its_name_and_no_elo() {
let tags = game_tags("Game", Color::Black, "Roman", Some(1500), "Maia 1550", "-");
let get = |k: &str| tags.iter().find(|(n, _)| n == k).map(|(_, v)| v.as_str());
assert_eq!(get("White"), Some("Maia 1550"));
assert_eq!(get("WhiteElo"), None);
assert_eq!(get("BlackElo"), Some("1500"));
assert_eq!(get("WhiteType"), Some("program"));
}
#[test]
fn maia_resigns_only_when_hopeless() {
use uci::Score;