summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-12-21 19:40:02 -0500
committerMicha White <botahamec@outlook.com>2023-12-21 19:40:02 -0500
commita8c2d7499de2215e2ffb3c755361a339e5b798d3 (patch)
tree83416ce7982943c9da09659f1627a150925b9652 /engine
parentd68f3fe96cf635f172804f728aafea9adabec6f1 (diff)
Fix warnings
Diffstat (limited to 'engine')
-rw-r--r--engine/src/lib.rs18
-rw-r--r--engine/src/main.rs2
-rw-r--r--engine/src/stackvec.rs35
3 files changed, 4 insertions, 51 deletions
diff --git a/engine/src/lib.rs b/engine/src/lib.rs
index fdb50e6..8f9fde2 100644
--- a/engine/src/lib.rs
+++ b/engine/src/lib.rs
@@ -3,10 +3,10 @@
#![feature(maybe_uninit_slice)]
use std::num::{NonZeroU8, NonZeroUsize};
-use std::sync::atomic::{AtomicBool, AtomicU8, AtomicUsize, Ordering};
+use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc;
use std::thread::JoinHandle;
-use std::time::{Duration, Instant};
+use std::time::Duration;
use parking_lot::Mutex;
@@ -18,7 +18,7 @@ pub use transposition_table::{TranspositionTable, TranspositionTableRef};
mod eval;
mod lazysort;
mod stackvec;
-mod tablebase;
+//mod tablebase;
mod transposition_table;
pub const ENGINE_NAME: &str = "Ampere";
@@ -46,11 +46,7 @@ struct EvaluationTask<'a> {
cancel_flag: AtomicBool,
end_ponder_flag: AtomicBool,
- start_time: Instant,
- current_depth: AtomicU8,
- selective_depth: AtomicU8,
nodes_explored: AtomicUsize,
- principle_variation: Mutex<Vec<Move>>,
}
#[derive(Debug, Default, Clone)]
@@ -205,11 +201,7 @@ impl<'a> Engine<'a> {
let cancel_flag = AtomicBool::new(false);
let end_ponder_flag = AtomicBool::new(false);
- let start_time = Instant::now();
- let current_depth = AtomicU8::new(0);
- let selective_depth = AtomicU8::new(0);
let nodes_explored = AtomicUsize::new(0);
- let principle_variation = Mutex::new(Vec::new());
let task = EvaluationTask {
position,
@@ -220,11 +212,7 @@ impl<'a> Engine<'a> {
cancel_flag,
end_ponder_flag,
- start_time,
- current_depth,
- selective_depth,
nodes_explored,
- principle_variation,
};
let task = Arc::new(task);
diff --git a/engine/src/main.rs b/engine/src/main.rs
index 3b41418..32e0f62 100644
--- a/engine/src/main.rs
+++ b/engine/src/main.rs
@@ -11,7 +11,7 @@ const DEPTH: u8 = 19;
struct BasicFrontend;
impl Frontend for BasicFrontend {
- fn debug(&self, msg: &str) {}
+ fn debug(&self, _: &str) {}
fn report_best_move(&self, best_move: model::Move) {
println!("{best_move}");
diff --git a/engine/src/stackvec.rs b/engine/src/stackvec.rs
index 9c00461..cfdef2b 100644
--- a/engine/src/stackvec.rs
+++ b/engine/src/stackvec.rs
@@ -39,10 +39,6 @@ impl<T, const CAPACITY: usize> StackVec<T, CAPACITY> {
}
}
- pub fn capcity(&self) -> usize {
- CAPACITY
- }
-
pub fn len(&self) -> usize {
self.len
}
@@ -61,39 +57,8 @@ impl<T, const CAPACITY: usize> StackVec<T, CAPACITY> {
unsafe { MaybeUninit::slice_assume_init_mut(&mut self.values[..self.len]) }
}
- pub fn as_ptr(&self) -> *const T {
- self.values.as_ptr().cast()
- }
-
- pub fn as_mut_ptr(&mut self) -> *mut T {
- self.values.as_mut_ptr().cast()
- }
-
- pub fn try_push(&mut self, value: T) -> Option<()> {
- self.values.get_mut(self.len)?.write(value);
- self.len += 1;
- Some(())
- }
-
pub fn push(&mut self, value: T) {
self.values[self.len].write(value);
self.len += 1;
}
-
- pub fn pop(&mut self) -> Option<T> {
- if self.is_empty() {
- return None;
- }
-
- // safety: this value will no longer be used, and the value is valid
- // because it appears in the valid part of the array
- unsafe {
- self.len -= 1;
- Some(std::ptr::read(self.as_ptr().add(self.len())))
- }
- }
-
- pub fn clear(&mut self) {
- self.len = 0;
- }
}