Ticket #132: gunnar_7_10.12.diff

File gunnar_7_10.12.diff, 4.8 kB (added by gunnar, 3 years ago)

Fixes for some of the testcases added in gunnar_7_10.11.

  • engine/aftermath.c

    RCS file: /cvsroot/gnugo/gnugo/engine/aftermath.c,v
    retrieving revision 1.60
    diff -u -r1.60 aftermath.c
     
    9393 * 4. Extend an invincible string towards an opponent string or an own 
    9494 *    non-invincible string. 
    9595 * 5. Split a big eyespace of an alive own dragon without invincible 
    96  *    strings into smaller pieces. 
     96 *    strings into smaller pieces. Do not play self-atari here. 
    9797 * 6. Play a liberty of a dead opponent dragon. 
    9898 * 
    9999 * Steps 2--4 are interleaved to try to optimize the efficiency of the 
     
    437437    if (board[pos] != EMPTY || distance[pos] != -1) 
    438438      continue; 
    439439 
     440    /* Do not play self-atari here. */ 
     441    if (is_self_atari(pos, color)) 
     442      continue; 
     443     
    440444    memset(mx, 0, sizeof(mx)); 
    441445     
    442446    for (k = 0; k < 8; k++) { 
  • engine/dragon.c

    RCS file: /cvsroot/gnugo/gnugo/engine/dragon.c,v
    retrieving revision 1.161
    diff -u -r1.161 dragon.c
     
    310310    if (ON_BOARD(str) && board[str] != EMPTY) 
    311311      dragon[str] = dragon[dragon[str].origin]; 
    312312 
     313  identify_thrashing_dragons(); 
     314   
    313315  /* Owl threats. */ 
    314316  for (str = BOARDMIN; str < BOARDMAX; str++) 
    315317    if (ON_BOARD(str)  
     
    329331        int acode = DRAGON2(str).owl_attack_code; 
    330332        int dcode = DRAGON2(str).owl_defense_code; 
    331333        int defense_point, second_defense_point; 
    332          
     334 
    333335        if (get_level() >= 8 
    334336            && !disable_threat_computation 
    335337            && (owl_threats  
     
    418420  semeai(); 
    419421  time_report(2, "  semeai module", NO_MOVE, 1.0); 
    420422   
    421   identify_thrashing_dragons(); 
    422  
    423423  /* Count the non-dead dragons. */ 
    424424  lively_white_dragons = 0; 
    425425  lively_black_dragons = 0; 
  • engine/owl.c

    RCS file: /cvsroot/gnugo/gnugo/engine/owl.c,v
    retrieving revision 1.249
    diff -u -r1.249 owl.c
     
    20502050           * attack with this move. 
    20512051           * 
    20522052           * If the move is suicide for us, try to find a backfilling 
    2053            * move to play instead. 
     2053           * move to play instead. Do this also if the move is a 
     2054           * send-two-return-one sacrifice. 
    20542055           */ 
    20552056          const char *name = "defense move"; 
    20562057 
    2057           if (is_suicide(dpos, other)) { 
     2058          if (is_suicide(dpos, other) || send_two_return_one(dpos, other)) { 
    20582059            int dpos2; 
    20592060            for (k = 0; k < 4; k++) { 
    20602061              if (board[dpos + delta[k]] == other 
  • engine/value_moves.c

    RCS file: /cvsroot/gnugo/gnugo/engine/value_moves.c,v
    retrieving revision 1.168
    diff -u -r1.168 value_moves.c
     
    9595  /* Do some thresholding. */ 
    9696  if (fewlibs > 4) 
    9797    fewlibs = 4; 
     98  if (to_move && is_ko(pos, color, NULL) && fewlibs > 1) 
     99    fewlibs = 1; 
    98100  if (fewlibs == 0 && own_strings == 1) 
    99101    own_strings = 0; 
    100102 
     
    160162  for (ii = BOARDMIN; ii < BOARDMAX; ii++) { 
    161163    if (!ON_BOARD(ii)) 
    162164      continue; 
     165 
     166    /* Don't consider send-two-return-one moves here. */ 
     167    if (send_two_return_one(ii, color)) 
     168      continue; 
    163169     
    164170    for (k = 0; k < MAX_REASONS; k++) { 
    165171      int r = move[ii].reason[k]; 
     
    31413147                        + move[pos].reverse_followup_value); 
    31423148    } 
    31433149 
    3144     tot_value += 0.05 * move[pos].secondary_value; 
     3150    tot_value += soft_cap(0.05 * move[pos].secondary_value, 0.4); 
    31453151    if (move[pos].secondary_value != 0.0) 
    3146       TRACE("  %1m: %f - secondary\n", pos, 0.05 * move[pos].secondary_value); 
     3152      TRACE("  %1m: %f - secondary\n", pos, 
     3153            soft_cap(0.05 * move[pos].secondary_value, 0.4)); 
    31473154 
    31483155    if (move[pos].numpos_shape + move[pos].numneg_shape > 0) { 
    31493156      /* shape_factor has already been computed. */ 
  • engine/worm.c

    RCS file: /cvsroot/gnugo/gnugo/engine/worm.c,v
    retrieving revision 1.71
    diff -u -r1.71 worm.c
     
    832832    for (k = 0; k < liberties; k++) { 
    833833      int pos = libs[k]; 
    834834      if (!attack_move_known(pos, str)) { 
    835         /* Try to attack on the liberty. */ 
    836         if (trymove(pos, other, "make_worms", str)) { 
     835        /* Try to attack on the liberty. Don't consider 
     836         * send-two-return-one moves. 
     837         */ 
     838        if (!send_two_return_one(pos, other) 
     839            && trymove(pos, other, "make_worms", str)) { 
    837840          if (board[str] == EMPTY || attack(str, NULL)) { 
    838841            if (board[str] == EMPTY) 
    839842              dcode = 0;