Program: 83593
Project: 83593
Buggy source:
@Override public void onDrawFrame(GL10 gl){
  long dt=FramerateCounter.tick();
  if (Constants.sBenchmarkMode) {
    dt=Pax.UPDATE_INTERVAL_MS;
  }
  mGame.update(dt);
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
  if (!mGame.isPaused()) {
    mStarField.update(dt);
  }
  drawStars(gl,mStarField,mStarPainter,mGameWidth,mGameHeight);
  if (Constants.sShowParticles) {
    drawParticles(gl,Emitter.SMOKE);
  }
  for (  Player player : mGame.mPlayers) {
    for (    Entity entity : player.mEntities[Entity.FIGHTER]) {
      Fighter fighter=(Fighter)entity;
      mHighlight.drawTrail(gl,fighter.mTrailVertices,fighter.mVertexColors);
    }
  }
  if (Constants.sShowCollisionBoxes) {
    for (int i=0; i < 2; i++) {
      QuadtreePainter.draw(gl,mGame.mPlayers[i].mEntities[Ship.FIGHTER].mBodies,mLineVertices,i == 0,mRotation);
    }
  }
  if (Constants.sShowShips) {
    mPrimitivePainter.setStrokeColor(1,1,1,0.5f);
    mPrimitivePainter.setFillColor(1,1,1,0);
    final float minShieldWidth=mPixelSize * 2;
    float[][] c=Painter.TEAM_COLORS;
    for (    int entityType : ENTITY_LAYERS) {
      for (int i=0; i < Game.NUM_PLAYERS; i++) {
        Player player=mGame.mPlayers[i];
        Painter[] painters=mPlayerEntityPainters.get(player);
        for (        Entity entity : player.mEntities[entityType]) {
          if (painters[entityType] != null) {
            painters[entityType].draw(gl,entity);
          }
 else {
            float[] shieldColors={1,1,1};
            float shieldWidth=entity.diameter * 0.15f * ((float)entity.health) / entity.originalHealth;
            if (shieldWidth < minShieldWidth) {
              float shieldStrength=shieldWidth / minShieldWidth;
              shieldWidth=minShieldWidth;
              for (int j=0; j < 3; j++) {
                shieldColors[j]=c[i][j] * (1 - shieldStrength) + shieldStrength;
              }
            }
            mCircle.draw(gl,entity,shieldColors[0],shieldColors[1],shieldColors[2]);
            mCircle.draw(gl,entity,entity.diameter - shieldWidth,c[i][0],c[i][1],c[i][2]);
          }
        }
      }
    }
  }
  if (Constants.sShowParticles) {
    drawParticles(gl,Emitter.SPARK);
    drawParticles(gl,Emitter.LASER_HIT);
    drawParticles(gl,Emitter.MISSILE_HIT);
    drawParticles(gl,Emitter.BOMB_HIT);
    drawParticles(gl,Emitter.SHIP_EXPLOSION);
    drawParticles(gl,Emitter.UPGRADE_EFFECT);
  }
  if (mGame.getState() == Game.State.IN_PROGRESS) {
    drawButtons(gl);
  }
  if (Constants.sShowFPS) {
    float x=(mGameWidth / 2) - 100;
    float y=(mGameHeight / 2) - 100;
    float dy=-(DIGIT_HEIGHT + LINE_SPACING);
    drawNumber(gl,x,y,FramerateCounter.getFPS(),1f,1);
    drawNumber(gl,x,y + dy,FramerateCounter.getRecentJitter(),0.5f);
    drawNumber(gl,x,y + dy * 2,FramerateCounter.getMaxJitter(),0.5f);
    for (int i=0; i < 2; i++) {
      if (mGame.mPlayers[i].isAI()) {
        float a=1;
        float r=(i == 0) ? 0 : 1;
        float g=.5f;
        float b=(i == 0) ? 1 : 0;
        AIWeights weights=mGame.mPlayers[i].getAIWeights();
        int n=weights.w.length;
        x=(DIGIT_WIDTH + LETTER_SPACING) * 7.5f - mGameWidth / 2;
        y=LINE_SPACING / 2 - dy * n * i;
        for (int j=0; j < n; j++) {
          drawNumber(gl,x,y,weights.w[j],a,r,g,b);
          y+=dy;
        }
        float[] buildScores=mGame.mPlayers[i].getAIBuildScores();
        n=buildScores.length;
        x*=-1;
        y=LINE_SPACING / 2 - dy * n * i;
        for (int j=0; j < n; j++) {
          drawNumber(gl,x,y,buildScores[j],a,r,g,b);
          y+=dy;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void onDrawFrame(GL10 gl){
  long dt=FramerateCounter.tick();
  if (Constants.sBenchmarkMode) {
    dt=Pax.UPDATE_INTERVAL_MS;
  }
  mGame.update(dt);
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
  if (!mGame.isPaused()) {
    mStarField.update(dt);
  }
  drawStars(gl,mStarField,mStarPainter,mGameWidth,mGameHeight);
  if (Constants.sShowParticles) {
    drawParticles(gl,Emitter.SMOKE);
  }
  for (  Player player : mGame.mPlayers) {
    for (    Entity entity : player.mEntities[Entity.FIGHTER]) {
      Fighter fighter=(Fighter)entity;
      mHighlight.drawTrail(gl,fighter.mTrailVertices,fighter.mVertexColors);
    }
  }
  if (Constants.sShowCollisionBoxes) {
    for (int i=0; i < 2; i++) {
      QuadtreePainter.draw(gl,mGame.mPlayers[i].mEntities[Ship.FIGHTER].mBodies,mLineVertices,i == 0,mRotation);
    }
  }
  if (Constants.sShowShips) {
    mPrimitivePainter.setStrokeColor(1,1,1,0.5f);
    mPrimitivePainter.setFillColor(1,1,1,0);
    final float minShieldWidth=mPixelSize * 2;
    float[][] c=Painter.TEAM_COLORS;
    for (    int entityType : ENTITY_LAYERS) {
      for (int i=0; i < Game.NUM_PLAYERS; i++) {
        Player player=mGame.mPlayers[i];
        Painter[] painters=mPlayerEntityPainters.get(player);
        for (        Entity entity : player.mEntities[entityType]) {
          if (painters[entityType] != null) {
            painters[entityType].draw(gl,entity);
          }
 else {
            float[] shieldColors={1,1,1};
            float shieldWidth=entity.diameter * 0.15f * ((float)entity.health) / entity.originalHealth;
            if (shieldWidth < minShieldWidth) {
              float shieldStrength=shieldWidth / minShieldWidth;
              shieldWidth=minShieldWidth;
              for (int j=0; j < 3; j++) {
                shieldColors[j]=c[i][j] * (1 - shieldStrength) + shieldStrength;
              }
            }
            mCircle.draw(gl,entity,shieldColors[0],shieldColors[1],shieldColors[2]);
            mCircle.draw(gl,entity,entity.diameter - shieldWidth,c[i][0],c[i][1],c[i][2]);
          }
        }
      }
    }
  }
  if (Constants.sShowParticles) {
    drawParticles(gl,Emitter.SPARK);
    drawParticles(gl,Emitter.LASER_HIT);
    drawParticles(gl,Emitter.MISSILE_HIT);
    drawParticles(gl,Emitter.BOMB_HIT);
    drawParticles(gl,Emitter.SHIP_EXPLOSION);
    drawParticles(gl,Emitter.UPGRADE_EFFECT);
  }
  if (mGame.getState() == Game.State.IN_PROGRESS) {
    drawButtons(gl);
  }
  if (Constants.sShowFPS) {
    float ex=DIGIT_SPACING * 2 - mGameWidth / 2;
    float x=-(ex + DIGIT_WIDTH);
    float y=(mGameHeight / 2) - 100;
    float dy=-(DIGIT_HEIGHT + LINE_SPACING);
    drawNumber(gl,x,y,FramerateCounter.getFPS(),0.6f,1);
    drawNumber(gl,x,y + dy,FramerateCounter.getRecentJitter(),0.4f);
    drawNumber(gl,x,y + dy * 2,FramerateCounter.getMaxJitter(),0.4f);
    for (int i=0; i < 2; i++) {
      if (mGame.mPlayers[i].isAI()) {
        float a=1;
        float r=(Painter.TEAM_COLORS[i][0] + 1) / 2;
        float g=(Painter.TEAM_COLORS[i][1] + 1) / 2;
        float b=(Painter.TEAM_COLORS[i][2] + 1) / 2;
        AIWeights weights=mGame.mPlayers[i].getAIWeights();
        int n=weights.w.length;
        x=ex + DIGIT_WIDTH * 7 + DIGIT_SPACING * 6;
        y=LINE_SPACING / 2 - dy * n * i;
        for (int j=0; j < n; j++) {
          drawNumber(gl,x,y,weights.w[j],a,r,g,b);
          y+=dy;
        }
        float[] buildScores=mGame.mPlayers[i].getAIBuildScores();
        n=buildScores.length;
        x=-(ex + DIGIT_WIDTH);
        y=LINE_SPACING / 2 - dy * n * i;
        for (int j=0; j < n; j++) {
          drawNumber(gl,x,y,buildScores[j],a,r,g,b);
          y+=dy;
        }
      }
    }
  }
}