Skip to content

Commit

Permalink
Merge pull request #163 from ujh/release-0.2.2
Browse files Browse the repository at this point in the history
Release 0.2.2
  • Loading branch information
ujh committed May 5, 2015
2 parents 29a0a06 + c30288d commit c6a8172
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 26 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
target/
*-benchmark*
.project

# Ignore gogui-twogtp output in the root directory
/*.sgf
/*.dat
/*.html
/*.lock
13 changes: 9 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.2.2 [](https://github.com/ujh/iomrascalai/compare/0.2.1...master) (unreleased)
## 0.2.2 [](https://github.com/ujh/iomrascalai/compare/0.2.1...0.2.2)

* A two liberty solver (can prove if a group with up to two stones is
dead)
Expand All @@ -10,9 +10,14 @@

### Performance

After running 100 games on 9x9 with komi 6.5 and a time limit of 5
minutes (sudden death) the win rate against GnuGo 3.8 level 0 was **X%
± Y%** for the default engine with 8 threads.
After running 200 games on 9x9 with komi 6.5 and a time limit of 5
minutes (sudden death) the win rate against GnuGo 3.8 level 0 was **70%
± 3.2%** for the default engine with 8 threads.

After running 200 games on 13x13 with komi 6.5 and a time limit of 10
minutes (sudden death) the win rate against GnuGo 3.8 level 0 was **11%
± 2.2%** for the default engine with 8 threads.


## 0.2.1 [](https://github.com/ujh/iomrascalai/compare/0.2.0...0.2.1)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

description = "An AI for the game of Go"
name = "iomrascalai"
version = "0.2.2-rc1"
version = "0.2.2"
authors = ["Urban Hafner <contact@urbanhafner.com>",
"Thomas Poinsot <thomas.poinsot1@gmail.com>",
"Igor Polyakov <iopguy+iomrasclai@gmail.com>"]
Expand Down
23 changes: 19 additions & 4 deletions bin/benchmark
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,38 @@
DIR=$( cd $(dirname "${BASH_SOURCE[0]}") && pwd )
cd "$DIR/.."

set -ex
set -x

FN="gnugo-benchmark"
SHA=`git rev-parse HEAD`

cargo build --release
rm -f $FN*

THREADS=8

GNUGO="gnugo --mode gtp --level 0 --chinese-rules --positional-superko --capture-all-dead --score aftermath --play-out-aftermath"
IOMRASCALAI="./target/release/iomrascalai -r chinese -t $THREADS -l"
REFEREE="$GNUGO"
SIZE=9
GAMES=100
GAMES=200
TIME="5m"

FN="$SHA-9x9"

gogui-twogtp -auto -black "$GNUGO" -white "$IOMRASCALAI" \
-size $SIZE -alternate -games $GAMES -sgffile $FN \
-time $TIME -referee "$REFEREE" -verbose -debugtocomment
rm -f $FN.html
gogui-twogtp -analyze $FN.dat




SIZE=13
TIME="10m"
FN="$SHA-13x13"

gogui-twogtp -auto -black "$GNUGO" -white "$IOMRASCALAI" \
-size $SIZE -alternate -games $GAMES -sgffile $FN \
-time $TIME -referee "$REFEREE" -verbose -debugtocomment
rm -f $FN.html
gogui-twogtp -analyze $FN.dat
4 changes: 2 additions & 2 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ impl Config {
priors: UctPriorsConfig {
capture_many: 30,
capture_one: 15,
empty: 10,
empty: 20,
neutral_plays: 10,
neutral_wins: 5,
self_atari: 10,
use_empty: false,
use_empty: true,
},
reuse_subtree: true,
tuned: true,
Expand Down
25 changes: 13 additions & 12 deletions src/engine/uct/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@ impl Node {
.iter()
.map(|&m| Node::new(m, self.config))
.collect();
if self.children.len() <= (game.size() * game.size() / 10) as usize {
let size = game.size() as usize;
if self.children.len() <= (size * size / 10) {
if !self.config.play_out_aftermath || game.winner() == game.next_player() {
//don't pass if we're losing on the board on CGOS, but otherwise it's OK
self.children.push(Node::new(Pass(game.next_player()), self.config));
}
}

self.descendants = self.children.len();
}
}
Expand All @@ -172,31 +173,31 @@ impl Node {
.iter()
.map(|m| self.new_leaf(board, m))
.collect();

self.priors(&mut children, board);
self.children = children;

if self.children.len() <= (board.size() * board.size() / 10) as usize {
let size = board.size() as usize;
if self.children.len() <= (size * size / 10) {
let player = board.next_player();
if !self.config.play_out_aftermath || board.winner() == player {
//don't pass if we're losing on the board on CGOS, but otherwise it's OK
self.children.push(Node::new(Pass(player), self.config));
}

}
}


self.descendants = self.children.len();
not_terminal
}

pub fn priors(&self, children: &mut Vec<Node>, board: &Board) {
let color = board.next_player().opposite();

let in_danger = board.chains().iter()
.filter(|chain| chain.color() == color && chain.coords().len() == 1 && chain.liberties().len() <= 2);

for one_stone in in_danger {
if let Some(solution) = board.capture_ladder(one_stone) {
if let Some(node) = children.iter_mut().find(|c| c.m() == solution) {
Expand All @@ -205,10 +206,10 @@ impl Node {
}
}
}

let in_danger = board.chains().iter()
.filter(|chain| chain.color() == color && chain.coords().len() > 1 && chain.liberties().len() <= 2);

for many_stones in in_danger {
if let Some(solution) = board.capture_ladder(many_stones) {
if let Some(node) = children.iter_mut().find(|c| c.m() == solution) {
Expand Down Expand Up @@ -240,7 +241,7 @@ impl Node {
}
node
}

fn in_empty_area(&self, board: &Board, m: &Move) -> bool {
m.coord().manhattan_distance_three_neighbours(board.size())
.iter()
Expand Down
2 changes: 1 addition & 1 deletion src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
************************************************************************/

pub fn version() -> &'static str {
"0.2.2-rc1"
"0.2.2"
}

0 comments on commit c6a8172

Please sign in to comment.