Skip to content

Commit

Permalink
chore: ahh right lru, well this aint much of a verification
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed Jun 26, 2024
1 parent cee928b commit d474c69
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/mcts/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ impl Tree {
fn verify_node(&self, ptr: NodePtr, position: ataxx::Position) -> Result<(), String> {
let node = self.node(ptr);

let mut child_visits = 0;
let mut policy_sum = 0.0;
for edge in node.edges.iter() {
if !(edge.scores >= 0.0 && edge.scores <= edge.visits as f64) {
Expand All @@ -97,9 +96,6 @@ impl Tree {
policy_sum += edge.policy;

if edge.ptr == -1 {
if edge.visits > 1 {
return Err("multiple visits to an unexpanded edge".to_string());
}
continue;
}

Expand All @@ -112,15 +108,6 @@ impl Tree {
return Err(format!("sum of all the policies is {}, not 1", policy_sum));
}

let parent = self.edge(node.parent_node, node.parent_edge);
if !position.is_game_over() && parent.visits - 1 != child_visits {
println!("{}", position);
Err(format!(
"edge total visits is {} while sum of child visits is {}",
parent.visits, child_visits
))
} else {
Ok(())
}
Ok(())
}
}

0 comments on commit d474c69

Please sign in to comment.