@@ -25,18 +25,17 @@ use board::Black;
2525use board:: Board ;
2626use board:: Play ;
2727use playout:: NoEyesPlayout ;
28+ use playout:: NoEyesWithPassPlayout ;
2829use playout:: Playout ;
2930use ruleset:: KgsChinese ;
3031
31- use rand:: weak_rng;
3232use test:: Bencher ;
3333
3434#[ test]
3535fn should_add_the_passed_moves_as_the_first_move ( ) {
3636 let board = Board :: new ( 9 , 6.5 , KgsChinese ) ;
37- let mut rng = weak_rng ( ) ;
3837 let playout = NoEyesPlayout :: new ( ) ;
39- let result = playout. run ( & board, & Play ( Black , 1 , 1 ) , & mut rng ) ;
38+ let result = playout. run ( & board, & Play ( Black , 1 , 1 ) ) ;
4039 assert_eq ! ( Play ( Black , 1 , 1 ) , result. moves( ) [ 0 ] ) ;
4140}
4241
@@ -47,25 +46,43 @@ fn max_moves() {
4746}
4847
4948#[ bench]
50- fn bench_9x9_playout_speed ( b : & mut Bencher ) {
49+ fn no_eyes_09x09 ( b : & mut Bencher ) {
5150 let board = Board :: new ( 9 , 6.5 , KgsChinese ) ;
52- let mut rng = weak_rng ( ) ;
5351 let playout = NoEyesPlayout :: new ( ) ;
54- b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) , & mut rng ) )
52+ b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) ) )
5553}
5654
5755#[ bench]
58- fn bench_13x13_playout_speed ( b : & mut Bencher ) {
56+ fn no_eyes_13x13 ( b : & mut Bencher ) {
5957 let board = Board :: new ( 13 , 6.5 , KgsChinese ) ;
60- let mut rng = weak_rng ( ) ;
6158 let playout = NoEyesPlayout :: new ( ) ;
62- b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) , & mut rng ) )
59+ b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) ) )
6360}
6461
6562#[ bench]
66- fn bench_19x19_playout_speed ( b : & mut Bencher ) {
63+ fn no_eyes_19x19 ( b : & mut Bencher ) {
6764 let board = Board :: new ( 19 , 6.5 , KgsChinese ) ;
68- let mut rng = weak_rng ( ) ;
6965 let playout = NoEyesPlayout :: new ( ) ;
70- b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) , & mut rng) )
66+ b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) ) )
67+ }
68+
69+ #[ bench]
70+ fn with_pass_09x09 ( b : & mut Bencher ) {
71+ let board = Board :: new ( 9 , 6.5 , KgsChinese ) ;
72+ let playout = NoEyesWithPassPlayout :: new ( ) ;
73+ b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) ) )
74+ }
75+
76+ #[ bench]
77+ fn with_pass_13x13 ( b : & mut Bencher ) {
78+ let board = Board :: new ( 13 , 6.5 , KgsChinese ) ;
79+ let playout = NoEyesWithPassPlayout :: new ( ) ;
80+ b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) ) )
81+ }
82+
83+ #[ bench]
84+ fn with_pass_19x19 ( b : & mut Bencher ) {
85+ let board = Board :: new ( 19 , 6.5 , KgsChinese ) ;
86+ let playout = NoEyesWithPassPlayout :: new ( ) ;
87+ b. iter ( || playout. run ( & board, & Play ( Black , 1 , 1 ) ) )
7188}
0 commit comments