Skip to content

Commit 0fa1f07

Browse files
committed
implement fixed shift fancy magic bitboards
1 parent 922ba7e commit 0fa1f07

33 files changed

+2879
-760
lines changed

Cargo.lock

Lines changed: 11 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage)'] }
1515
[dependencies]
1616
arrayvec = { version = "0.7.3", default-features = false, features = ["std"] }
1717
byteorder = { version = "1.5.0", default-features = false, features = ["std"] }
18-
cozy-chess = { version = "0.3.3", default-features = false, features = ["std"] }
1918
ctor = { version = "0.2.8", default-features = false }
2019
derive_more = { version = "1.0.0-beta.6", default-features = false, features = [
2120
"add",
@@ -32,6 +31,8 @@ derive_more = { version = "1.0.0-beta.6", default-features = false, features = [
3231
"mul_assign",
3332
"not",
3433
] }
34+
rand = { version = "0.8.5", default-features = false, features = ["std", "min_const_gen"] }
35+
rand_pcg = { version = "0.3.1", default-features = false }
3536
rayon = { version = "1.10.0", default-features = false }
3637
ruzstd = { version = "0.7.0", default-features = false, features = ["std"] }
3738

benches/search.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use criterion::{criterion_group, criterion_main, Criterion, SamplingMode, Throughput};
22
use lib::search::{Depth, Engine, Limits, Options, ThreadCount};
3-
use lib::{chess::Position, util::Integer};
3+
use lib::{nnue::Evaluator, util::Integer};
44
use std::thread::available_parallelism;
55
use std::time::{Duration, Instant};
66

7-
fn bencher(reps: u64, positions: &[Position], options: Options, limits: Limits) -> Duration {
7+
fn bencher(reps: u64, positions: &[Evaluator], options: Options, limits: Limits) -> Duration {
88
let mut time = Duration::ZERO;
99

1010
for pos in positions {
@@ -20,7 +20,7 @@ fn bencher(reps: u64, positions: &[Position], options: Options, limits: Limits)
2020
}
2121

2222
fn bench(c: &mut Criterion) {
23-
let positions: Vec<Position> = FENS.iter().map(|p| p.parse().unwrap()).collect();
23+
let positions: Vec<Evaluator> = FENS.iter().map(|p| p.parse().unwrap()).collect();
2424
let options = match available_parallelism() {
2525
Err(_) => Options::default(),
2626
Ok(cores) => match cores.get() / 2 {

lib/chess.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
mod bitboard;
2+
mod board;
3+
mod castles;
24
mod color;
35
mod file;
6+
mod magic;
47
mod mirror;
58
mod r#move;
69
mod outcome;
@@ -10,10 +13,14 @@ mod position;
1013
mod rank;
1114
mod role;
1215
mod square;
16+
mod zobrist;
1317

1418
pub use bitboard::*;
19+
pub use board::*;
20+
pub use castles::*;
1521
pub use color::*;
1622
pub use file::*;
23+
pub use magic::*;
1724
pub use mirror::*;
1825
pub use outcome::*;
1926
pub use perspective::*;
@@ -23,3 +30,4 @@ pub use r#move::*;
2330
pub use rank::*;
2431
pub use role::*;
2532
pub use square::*;
33+
pub use zobrist::*;

0 commit comments

Comments
 (0)