Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Branching factor, etc

Author: Dann Corbit

Date: 18:24:32 08/29/02

Go up one level in this thread


On August 29, 2002 at 20:40:44, David Hanley wrote:

>Ok, i have my program working and fairly complete--it has all the rules in and
>plays decent positional chess.  I'm pleased.
>
>I implemented all the mechanisms that i think i'm supposed to--nullmove, hash
>move first, then two killers, then winning static exchange moves sorted by
>expected material win, then moves sorted by their history score.  I sort moves
>at the root with each iterative deepening.
>
>However, the branching factor seems 'off.' My branching factor seems to vary
>between 4 and 7.  For example, here's an 8 ply search from the opening position:
>
>Score: -53
>Searched 414821 total nodes
>Got 114215 hash hits (27 percent hits)
>There were 240894 quiesce nodes
>The pawn hash contains 17855 entries
>Branching factor is 4.522705
>
>Here's a 6 ply search a bit later: (white just thought and chose e3)
>
>+---+---+---+---+---+---+---+---+
>| R | N |   | Q | K | B |   | R |
>+---+---+---+---+---+---+---+---+
>| P | P | P |   | P | P | P | P |
>+---+---+---+---+---+---+---+---+
>|   |   |   |   |   | N |   |   |
>+---+---+---+---+---+---+---+---+
>|   |   |   | P |   | B |   |   |
>+---+---+---+---+---+---+---+---+
>|   |   |   |*p |   |   |   |   |
>+---+---+---+---+---+---+---+---+
>|   |   |*n |   |*p |*n |   |   |
>+---+---+---+---+---+---+---+---+
>|*p |*p |*p |   |   |*p |*p |*p |
>+---+---+---+---+---+---+---+---+
>|*r |   |*b |*q |*k |*b |   |*r |
>+---+---+---+---+---+---+---+---+
>Score: -44
>Searched 134392 nodes
>Got 27504 hash hits (20 percent hits)
>There were 87728 quiesce nodes
>The pawn hash contains 6098 entries
>Branching factor is 5.999756
>
>
>I guess i wonder if i'm fussing over nothing.  Or perhaps if my search is broken
>somehow.  I tried turning off move sorting and launched a search from the
>opening position.  It seems to indicate to me that the move sorting is having a
>big positive effect.  Here's a six ply search from the opening position, no move
>sorting:
>
>Score: -55
>Searched 591677 nodes
>Got 128337 hash hits (21 percent hits)
>There were 395070 quiesce nodes
>The pawn hash contains 31050 entries
>Branching factor is 7.623291
>
>It took more nodes than the 8 ply search with sorting!
>
>Maybe i should be happy with my code, but i hear people talking of branching
>factors like two and three.  So maybe i should look for a bug.
================================================
Yace looked at less than ten percent of that many nodes:
================================================
white ( 1): sd 6
search depth=6
white ( 1): go
usetime = 9999999999.00, mintime = 9999999999.00 maxtime = 9999999999.00 tl
9999999999.00 ml 0
         1   0.025   0.27  1t  1.e4 {0}
        20   0.030   0.27  1.  1.e4 {0}
        42   0.037   0.00  2t  1.e4 e5 {0}
       117   0.044   0.00  2.  1.e4 e5 {0}
       296   0.050   0.19  3t  1.e4 d5 2.Nc3 {0}
       382   0.057   0.19  3.  1.e4 d5 2.Nc3 {0}
       917   0.065   0.00  4t  1.e4 d5 2.Nc3 Nf6 {0}
      2708   0.075   0.00  4.  1.e4 d5 2.Nc3 Nf6 {0}
      5475   0.088   0.18  5t  1.e4 d5 2.exd5 Qxd5 3.Nc3 Qd4 {0}
      6798   0.098   0.19  5t+ 1.d4 d5 2.Nc3 Nf6 3.Nf3 {0}
      6938   0.103   0.19  5t  1.d4 d5 2.Nc3 Nf6H 3.Nf3H {0}
      9347   0.121   0.19  5.  1.d4 d5 2.Nc3 Nf6 3.Nf3 {0}
     13968   0.138   0.00  6t  1.d4 d5 2.Nc3 Nf6 3.Nf3 Nc6 {0}
     34240   0.210   0.00  6.  1.d4 d5 2.Nc3 Nf6 3.Nf3 Nc6 {0}
     34240   0.214   0.00  6f. 1.d4 d5 2.Nc3 Nf6 3.Nf3 Nc6 {0}
34240 Nodes, 24.82% Leavenodes, 160000 Nodes/sec
27160 eval, 58.52% score, 98849 genmoves, 14.28% captures le 95/84
ext: pawn 0, rcp 26, chk 226, repchk 60, null 0, prune 599
htable: 28874 store, 0 rejected, 34372 probe, 28.1% f/p, 33.4% f/s
entries 5416665 age 1 renew 0
egtb probes 0, found 0 max_depth 14
white ( 1): d4
================================================
GLC-218 shows an even more drastic difference:
================================================
>sd 6
>go
 fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
 Game finished test: 0
  time limit 10.00 (1 moves left)  max time limit 10.00
 Generating internal KP-K end-game table...
 Done (0.320 secs)
 Game stage: Opening
 Current eval: 0.000
 Ply  Time   Score   Nodes  Principal Variation
  6   0.02  +0.000    6174  Nf3 Nf6 2. Nc3 Nc6 3. d3 e6
  6   0.04  +0.000   12970  Nf3 Nf6 2. Nc3 Nc6 3. d3 e6
 local:  t=0.05  nps=259404.0  n=12970 (37.2% / 62.8%)  fh=91.7%
 total:  t=0.05  nps=259404.0  n=12970  draws=0
 trans:  probes=4826  hits=858 (17.78%)  draft=342 (7.09%)
 tcuts:  exact=7 (0.15%)  upper=309 (6.40%)  lower=9 (0.19%)
 tstor:  exact=18 (1.52%)  upper=920 (77.83%)  lower=244 (20.64%)
 ext:  check=25  recap=13  ppush=0  1rep=3  thrt=0
 q-moves:  gen=2712  tested=2040  made/un=941  max-dep=5
 max eval diff:  part-1=0.721  part-2=0.809
 !m Ng1-f3 0 1
move g1f3
  time left 10.00
 -> Score=0  PV=Nf3 Nf6 2. Nc3 Nc6 3. d3 e6
 Game finished test: 0
>



================================================
Gnu Chess:
================================================
GNU Chess 5.04aTE

Transposition table:  Entries=1024K Size=32768K
Pawn hash table: Entries=16K Size=1024K
White (1) : post
White (1) : book off
book now off.
White (1) : sd 6
Search to a depth of 6
White (1) : go
Thinking...
Root = -35, Phase = 1 Depth = 6
Ply   Time     Eval      Nodes   Principal-Variation
 1+   0.01     41         1      Nf3
 1.   0.02     41        21      Nf3
 2&   0.02    -10        61      Nf3 Nf6
 2.   0.04    -10        99      Nf3 Nf6
 3&   0.04     40       203      Nf3 Nf6 Nc3
 3.   0.06     40       222      Nf3 Nf6 Nc3
 4&   0.07    -10       376      Nf3 Nf6 Nc3 Nc6
 4.   0.08    -10       869      Nf3 Nf6 Nc3 Nc6
 5&   0.10     29      2001      Nf3 Nf6 Nc3 Nc6 e4
 5.   0.12     29      3056      Nf3 Nf6 Nc3 Nc6 e4
 6&   0.14    -10      5771      Nf3 Nf6 Nc3 Nc6 e4 e5
 6.   0.21    -10     17175      Nf3 Nf6 Nc3 Nc6 e4 e5

Time = 0.2 Rate=83407 Nodes=[15329/1846/17175] GenCnt=19137
Eval=[4444/7463] RptCnt=0 NullCut=746 FutlCut=2442
Ext: Chk=203 Recap=25 Pawn=167 OneRep=19 Horz=1 Mate=0 KThrt=19
Material=[3600/3600 : 4400/4400] Lazy=[177/129] MaxPosnScore=[226/204]
Hash: Success=25% Collision=6% Pawn=73%

black  KQkq
r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . N . .
P P P P P P P P
R N B Q K B . R


My move is : Nf3

================================================
Phalanx needs less than 10K nodes:
================================================
Depth=6, Value=31, Time=0.18, Last turn=0.00, Nodes=9829, N/s=54605
PV = Pd2-d4  Pd7-d5  Ng1-f3  Nb8-c6  Pe2-e3  Ng8-f6
my move is Pd2-d4
1. ... d2d4
[ black, 1 ]

================================================
Genesis:
================================================
White(1): bookoff
opening book off.
White(1): on
depth   time  score   variation
  1->   0.01   0.22   1. d2d4
                      nodes 21  nps 2100  q 0%  hhits 0%
  2->   0.02   0.00   1. d2d4 d7d5
                      nodes 73  nps 7300  q 2%  hhits 1%
  3->   0.04   0.18   1. d2d4 d7d5 2. g1f3
                      nodes 204  nps 10200  q 3%  hhits 19%
  4->   0.08   0.03   1. e2e4 g8f6 2. e4e5 f6e4
                      nodes 1812  nps 45300  q 18%  hhits 16%
  5->   0.15   0.17   1. e2e4 e7e5 2. d2d4 d7d5 3. g1f3 d5e4 4. f3e5
                      nodes 3941  nps 56300  q 24%  hhits 7%
  6->   0.60   0.01   1. d2d4 d7d5 2. c1e3 g8f6 3. b1c3
                      nodes 34531  nps 76565  q 27%  hhits 13%
----------------------------------------------------------
nodes 40582  time 0.60  nps 67524
leaf 24179  q 10898  eval 29531
null 4205  null-cut 2053
hhits 5205  hexact 2751  hleaves 2751
hput 7847  hoverwrites 0
leaves 59%  quiesc 26%  null 10%
null-cut 65%  aspwin-suc 100%
hhits 12%  hoverwrites 0%  husage 0%
White(1): d2d4



This page took 0.01 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.