Ticket #161: gunnar_7_11.5b.diff

File gunnar_7_11.5b.diff, 4.0 KB (added by gunnar, 4 years ago)

Previous patch + addition of the crashing position as new testcase.

  • engine/combination.c

    RCS file: /cvsroot/gnugo/gnugo/engine/combination.c,v
    retrieving revision 1.58
    diff -u -r1.58 combination.c
     
    409409  memset(forbidden, 0, sizeof(forbidden)); 
    410410  memset(defense_points, 0, sizeof(defense_points)); 
    411411 
     412  compute_aa_status(other, safe_stones); 
     413  compute_aa_values(other); 
     414 
    412415  /* Accept illegal ko capture here. */ 
    413416  if (!tryko(move, color, NULL)) 
    414417    /* Really shouldn't happen. */ 
    415418    abortgo(__FILE__, __LINE__, "trymove", move); 
    416419 
    417   compute_aa_status(other, safe_stones); 
    418   compute_aa_values(other); 
    419  
    420420  increase_depth_values(); 
    421421 
    422422  aa_val = do_atari_atari(other, &apos, &defense_point, defense_points, 
     
    519519 
    520520/* Helper function for computing the aa_status for all opponent's strings. 
    521521 * If safe_stones is given, we just copy the information from there. 
     522 * If called at stackp > 0, safe_stones must be provided since the 
     523 * dragon_data is not valid then. 
    522524 */ 
    523525 
    524526static void 
     
    529531  SGFTree *save_sgf_dumptree = sgf_dumptree; 
    530532  int save_count_variations = count_variations; 
    531533  int save_verbose = verbose; 
     534 
     535  gg_assert(safe_stones || stackp == 0); 
     536   
    532537  sgf_dumptree = NULL; 
    533538  count_variations = 0; 
    534539  if (verbose) 
     
    573578   */ 
    574579  for (pos = BOARDMIN; pos < BOARDMAX; pos++) { 
    575580    if (board[pos] == other 
    576         && worm[pos].origin == pos 
    577         && worm[pos].liberties == 2 
     581        && find_origin(pos) == pos 
     582        && countlib(pos) == 2 
    578583        && aa_status[pos] == ALIVE) { 
    579584      int libs[2]; 
    580585      findlib(pos, 2, libs); 
     
    588593      if (!owl_substantial(pos)) { 
    589594        int pos2; 
    590595        for (pos2 = BOARDMIN; pos2 < BOARDMAX; pos2++) 
    591           if (ON_BOARD(pos2) && is_worm_origin(pos2, pos)) 
     596          if (board[pos2] == other && find_origin(pos2) == pos) 
    592597            aa_status[pos2] = INSUBSTANTIAL; 
    593598      } 
    594599    } 
  • regression/9x9.tst

    RCS file: /cvsroot/gnugo/gnugo/regression/9x9.tst,v
    retrieving revision 1.31
    diff -u -r1.31 9x9.tst
     
    341341loadsgf games/cgos/390115.sgf 28 
    342342670 reg_genmove white 
    343343#? [E7] 
     344 
     345# There's actually nothing difficult with this position, it's only 
     346# necessary to avoid a few obvious blunders. The real reason for this 
     347# test is that a fix for an atari-atari problem introduced a crash in 
     348# this position. Fixing the crash instead reintroduced an atari-atari 
     349# mistake in ninestones:220. Let's make sure we won't get a crash here 
     350# once more. See also tickets #77 and #161. 
     351loadsgf games/atari-crash.sgf 
     352680 reg_genmove white 
     353#? [H7] 
  • regression/ninestones.tst

    RCS file: /cvsroot/gnugo/gnugo/regression/ninestones.tst,v
    retrieving revision 1.52
    diff -u -r1.52 ninestones.tst
     
    6464190 owl_defend J9 
    6565#? [0]* 
    6666 
     67# See also 9x9:680 and tickets #77 and #161. 
    6768loadsgf games/nngs/thor-gnugo-3.3.12-200212170003.sgf 108 
    6869220 reg_genmove black 
    6970#? [P9|P8] 
  • new file regression/games/atari-crash.sgf

    RCS file: regression/games/atari-crash.sgf
    diff -N regression/games/atari-crash.sgf
    - +  
     1(;GM[1]FF[4]SZ[9]KM[7.5]HA[0]GN[GNU Go 3.7.10 stepped on a bug] 
     2;B[ec];W[ee];B[cf];W[dd];B[dc];W[cd];B[ge];W[eg];B[gg];W[be];B[eh];W[dg] 
     3;B[fh];W[cc];B[dh];W[cg];B[fd];W[cb];B[ch];W[fa];B[bg];W[bf];B[ed];W[bh] 
     4;B[gf];W[gc];B[eb];W[ea];B[da];W[gb];B[db];W[hd];B[gd];W[he];B[hf];W[bi] 
     5;B[ie];W[ic];B[hb];W[ha];B[ib];W[fb];B[ef];W[df];B[if];W[ca];B[de];W[ff] 
     6;B[fg];W[ce];B[ac];W[fe];B[ab];W[ad];B[aa];W[ci];B[ah];W[di];B[ag];W[af] 
     7;B[fi];W[ai];B[ag];W[bg];B[ei] 
     8)