Skip to content

Split game logic out of engine.rs into a game.rs module #2

Description

@brianhliou

banqi_rust/src/engine.rs (~1,980 lines) interleaves the game model (types, board, move generation, rules) with the search (αβ + Star1, TT, quiescence, eval). Sibling repo misty-flip-jungle keeps these in separate modules (game.rs vs engine.rs); this repo and misty-jungle do not.

Split the game logic into banqi_rust/src/game.rs, matching flip-jungle:

  • Move state / board / move-gen / rules to game.rs; have engine.rs reference them via crate::game::….
  • Add pub mod game; in banqi_rust/src/lib.rs.
  • Add #[path = "../../banqi_rust/src/game.rs"] mod game; in banqi-engine/src/main.rs, before the engine include, mirroring flip-jungle's main.rs.

Safety: the UCI binary carries golden/parity tests; cargo test -p banqi-engine must stay green (the engine reproduces the Python engine byte-for-byte).

Priority: low. Structural hygiene, not a functional change; the monolith works. Tracked so the misty engine repos converge on one module layout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions