Skip to content

Commit

Permalink
Implement a texel tuner and use it to tune the current eval params
Browse files Browse the repository at this point in the history
This tuner borrows heavily from
https://github.com/GediminasMasaitis/texel-tuner, which was used for
tuning the existing evaluation parameters.

There was, however, a bug with my implementation which caused mobility
scores to be computed incorrectly, due to not considering board
orientation for blockers. As a result, tuning, even with the same
implementation, results in a fairly sizeable Elo gain.

Elo   | 28.53 +- 11.44 (95%)
SPRT  | 8.0+0.08s Threads=1 Hash=16MB
LLR   | 2.95 (-2.94, 2.94) [0.00, 5.00]
Games | N: 2014 W: 712 L: 547 D: 755
Penta | [54, 218, 356, 267, 112]
  • Loading branch information
jgilchrist committed Dec 4, 2024
1 parent 305ba36 commit a167027
Show file tree
Hide file tree
Showing 13 changed files with 1,161 additions and 117 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Tune all evaluation parameters with https://github.com/GediminasMasaitis/texel-tuner (53.17 +- 16.76)
* Evaluate piece mobility (41.36 +- 13.82)
* Add a texel tuner in-repo and tune, resolving an issue where mobility scores were not computed correctly (28.53 +- 11.44)

### Misc

Expand Down
211 changes: 211 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
rust-version = "1.83"

[features]
default = ["dep:clap"]
default = ["dep:clap", "dep:rayon", "dep:indicatif"]
release = []

[build-dependencies]
Expand All @@ -15,8 +15,10 @@ cc = "1.2.2"
arrayvec = "0.7.6"
clap = { version = "4.5.21", features = ["derive"], optional = true }
colored = "2.1.0"
indicatif = { version = "0.17.9", optional = true }
nom = "7.1.1"
rand = "0.8.5"
rayon = { version = "1.8.1", optional = true }

[dev-dependencies]
paste = "1.0.15"
Expand Down
5 changes: 5 additions & 0 deletions src/chess/bitboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ impl Bitboard {
// If we go west and land on H, we wrapped around.
Self(self.0 << 7) & Self::NOT_H_FILE
}

#[inline(always)]
pub fn flip_vertically(self) -> Self {
Self(u64::swap_bytes(self.0))
}
}

pub struct SquareIterator(Bitboard);
Expand Down
Loading

0 comments on commit a167027

Please sign in to comment.