bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] GNUBG gammon bug


From: Jim Segrave
Subject: Re: [Bug-gnubg] GNUBG gammon bug
Date: Mon, 21 Jul 2003 08:43:14 +0200
User-agent: Mutt/1.2.5.1i

On Sun 20 Jul 2003 (23:07 -0700), Ned Cross wrote:
> ummm, position attached.

The 0 gammons and 0 backgammons was the bug referred to in my earlier
posting. I committed a fix last night. The problem was that after
rolling out a game, gnubg calls a routine SanityCheck which makes sure
that none of the win/wing/winbg/loseg/losebg probabilities are less
than 0 or greater than 1. It then checks if the side on roll has men
borne off and if so, forces the loseg and losebg values to 0. The bug
was that this routine was being called with the board reversed, so it
concluded the opponent had men borne off and cleared the gammon and
backgammon results. 

I did my testing with rollouts of positions which didn't already have
men off, so I failed to spot this rather obvious blunder. It only took
a couple of minutes to find what was happening once I saw the
impossible 0 gammon and backgammon rates on the position I was
commenting on.
 
> black (O, 2 pts) vs. white (X, 4 pts) (Match to 9)
> 
> Game number 5
> 
> Move number 87: X to play 12
> 
>  GNU Backgammon  Position ID: /wMAADTbzQQEAA
>                  Match ID   : UYkoASAAIAAA
>  +13-14-15-16-17-18------19-20-21-22-23-24-+     O: black
>  |             X    | O |                O | O   2 points
>  |                  |   |                O | O   
>  |                  |   |                O | O   
>  |                  |   |                O | O   
>  |                  |   |                A |    
> v|                  |BAR|                  |     9 point match
>  |                  |   |                  |    
>  |                  |   |                  |     
>  |                  |   |    X             |     
>  |             X    |   | X  X  X  X     X |     Rolled 12
>  |       X     X    |   | X  X  X  X     X |     4 points
>  +12-11-10--9--8--7-------6--5--4--3--2--1-+     X: white (Cube: 2)
> Pip counts: O 35, X 86
> 
> * white moves 10/7
> 
> Cube analysis
> 2-ply cubeless equity  +0.509 (Money:  +0.512)
>   0.764 0.000 0.000 - 0.236 0.017 0.000
> Cubeful equities:
>   2-ply cubeful 100% speed [world class]
> 1. No double            +0.767
> 2. Double, pass         +1.000  ( +0.233)
> 3. Double, take         +0.686  ( -0.081)
> Proper cube action: No redouble, take (25.8%)
> Alert: bad move ( +0.000)
> 
> Rolled 12 (-0.004):
> *    1. Rollout          10/7                         Eq.:  +0.849
>        0.763 0.000 0.000 - 0.237 0.000 0.000 CL  +0.500 CF  +0.849
>       [0.002 0.000 0.000 - 0.002 0.360 0.003 CL   0.004 CF  +0.008]
>         Full cubeful rollout with var.redn.
>         648 games, Mersenne Twister dice gen. with seed 1177798656 and 
> quasi-random dice
>         Play:  2-ply cubeful 50% speed
>         keep the first 0 0-ply moves and up to 8 more moves within equity 0.16
>         Skip pruning for 1-ply moves.
>         Cube: 2-ply cubeful 50% speed
>         Different evaluations after 7 plies:
>         Play: 0-ply cubeful
>         Cube: 0-ply cubeful
>      2. Rollout          5/2                          Eq.:  +0.835 ( -0.014)
>        0.764 0.000 0.000 - 0.236 0.000 0.000 CL  +0.496 CF  +0.835
>       [0.001 0.000 0.000 - 0.001 0.452 0.014 CL   0.004 CF  +0.007]
>         Full cubeful rollout with var.redn.
>         648 games, Mersenne Twister dice gen. with seed 1177798656 and 
> quasi-random dice
>         Play:  2-ply cubeful 50% speed
>         keep the first 0 0-ply moves and up to 8 more moves within equity 0.16
>         Skip pruning for 1-ply moves.
>         Cube: 2-ply cubeful 50% speed
>         Different evaluations after 7 plies:
>         Play: 0-ply cubeful
>         Cube: 0-ply cubeful
>      3. Cubeful 2-ply    17/15 10/9                   Eq.:  +0.665 ( -0.183)
>        0.742 0.000 0.000 - 0.258 0.021 0.000
>      4. Cubeful 2-ply    17/14                        Eq.:  +0.664 ( -0.185)
>        0.740 0.000 0.000 - 0.260 0.018 0.000
>      5. Cubeful 2-ply    10/9 8/6                     Eq.:  +0.661 ( -0.188)
>        0.741 0.000 0.000 - 0.259 0.024 0.000
>      6. Cubeful 2-ply    17/15 5/4                    Eq.:  +0.653 ( -0.196)
>        0.735 0.000 0.000 - 0.265 0.017 0.000
> 
> 
> Output generated Sun Jul 20 22:59:36 2003
> by GNU Backgammon 0.14-devel 1.1177 030717 (Text Export version 1.47)
> 
> 
> 
> ----- Original Message ----- 
> From: "Ned Cross" <address@hidden>
> To: <address@hidden>
> Cc: <address@hidden>
> Sent: Sunday, July 20, 2003 10:51 PM
> Subject: Re: [Bug-gnubg] GNUBG gammon bug
> 
> 
> > Possibly related, I'm not sure...I just did a rollout today of the attached
> > position, and strangely GNU reported a 0.0% chance of losing a gammon.
> > GNU's 2-ply eval showed gammon percentages around 2-3% for each of the top
> > two plays, as did Snowie 4 evals and rollouts.
> > 
> > Interestingly enough, I originally decided to rollout the position because
> > GNU 2-ply eval listed 5/2 as the top move (10/7 as second best, but a
> > significant error), while Snowie 4 listed 10/7 as best, with 5/2 far down
> > the list.  Performing a rollout with both bots gave the result that they
> > BOTH changed their minds...Snowie rollout (2-ply with 3-ply cube, 324 trials
> > with VR), preferred 5/2 and GNU rollout preferred 10/7.
> > 
> > I don't know if the gammon percentages would make a difference in GNU's
> > choice of "best move", but it seems like a problem in either the rollouts or
> > the reporting of rollout results.
> > 
> > Ned
> > 
> > ----- Original Message ----- 
> > From: "Jim Segrave" <address@hidden>
> > To: <address@hidden>
> > Cc: <address@hidden>
> > Sent: Sunday, July 20, 2003 3:57 PM
> > Subject: Re: [Bug-gnubg] GNUBG gammon bug
> > > I'm very glad you raised this, it caused me to find and fix a rather
> > > stupid bug in the new rollout code. Having fixed it, the answer is:
> > >
> > 
> _______________________________________________
> Bug-gnubg mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-gnubg


-- 
Jim Segrave           address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]