Skip to content

[WIP] Complete search routine extraction and clean up main.rs#8

Closed
Copilot wants to merge 1 commit intocopilot/vscode1759757398573from
copilot/fix-b96b2b3a-ed30-4e97-8a02-e63d0000460a
Closed

[WIP] Complete search routine extraction and clean up main.rs#8
Copilot wants to merge 1 commit intocopilot/vscode1759757398573from
copilot/fix-b96b2b3a-ed30-4e97-8a02-e63d0000460a

Conversation

Copy link

Copilot AI commented Oct 6, 2025

Coding agent has begun work on Complete search routine extraction and clean up main.rs and will replace this description as work progresses.

See problem context

Finish the refactor by moving all remaining search methods and evaluation from main.rs into board.rs. Specifically, extract:

  • fn evaluate(&self) -> i32 including full piece-square tables and material evaluation code.
  • fn negamax(&mut self, tt: &mut TranspositionTable, depth: u32, alpha: i32, beta: i32) -> i32 with alpha-beta, TT probing and storing, quiescence base case.
  • fn quiesce(&mut self, tt: &mut TranspositionTable, alpha: i32, beta: i32) -> i32 including standing pat and tactical move generation.
  • fn generate_tactical_moves(&mut self) -> Vec<Move> and its helper fn generate_pawn_tactical_moves.

After moving these, remove the corresponding methods from main.rs, and update main.rs to only declare modules:

mod types; mod zobrist; mod utils; mod board; mod perft;
use std::io::{self, BufRead, Write};
use std::time::{Duration, Instant};
use types::*; use zobrist::*; use utils::*; use board::Board;
fn main() { /* existing UCI loop unchanged */ }

Ensure cargo build passes with no logic changes.

Original prompt

Complete search routine extraction and clean up main.rs
Finish the refactor by moving all remaining search methods and evaluation from main.rs into board.rs. Specifically, extract:

  • fn evaluate(&self) -> i32 including full piece-square tables and material evaluation code.
  • fn negamax(&mut self, tt: &mut TranspositionTable, depth: u32, alpha: i32, beta: i32) -> i32 with alpha-beta, TT probing and storing, quiescence base case.
  • fn quiesce(&mut self, tt: &mut TranspositionTable, alpha: i32, beta: i32) -> i32 including standing pat and tactical move generation.
  • fn generate_tactical_moves(&mut self) -> Vec<Move> and its helper fn generate_pawn_tactical_moves.

After moving these, remove the corresponding methods from main.rs, and update main.rs to only declare modules:

mod types; mod zobrist; mod utils; mod board; mod perft;
use std::io::{self, BufRead, Write};
use std::time::{Duration, Instant};
use types::*; use zobrist::*; use utils::*; use board::Board;
fn main() { /* existing UCI loop unchanged */ }

Ensure cargo build passes with no logic changes.

Created from VS Code via the [GitHub Pull Request](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) extension.

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants