Program: 175839
Project: 175839
Buggy source:
@Override public void computeBatch(Runnable whenDone,List<App> batch){
  Pix2Pix p2=new Pix2Pix(batch.get(0));
  BufferedImage bi=new BufferedImage(resolution * 2,resolution,BufferedImage.TYPE_3BYTE_BGR);
  Graphics2D g=(Graphics2D)bi.getGraphics();
  List<MiniFacade> mfb=batch.stream().map(x -> (MiniFacade)x.hasA).collect(Collectors.toList());
  for (  MiniFacade mf : mfb) {
    if (mf.featureGen instanceof CGAMini)     mf.featureGen=new FeatureGenerator(mf,mf.featureGen);
    DRectangle bounds=new DRectangle(resolution,0,resolution,resolution);
    DRectangle mini=Pix2Pix.findBounds(mf);
    g.setColor(Color.black);
    g.fillRect(resolution,0,resolution,resolution);
    mini=mf.postState == null ? mf.getAsRect() : mf.postState.outerFacadeRect;
    DRectangle mask=new DRectangle(mini);
{
      mask=mask.scale(resolution / Math.max(mini.height,mini.width));
      mask.x=(resolution - mask.width) * 0.5 + resolution;
      mask.y=0;
    }
    g.setColor(CMPLabel.Facade.rgb);
    if (mf.postState == null) {
      Pix2Pix.cmpRects(mf,g,mask,mini,CMPLabel.Facade.rgb,Collections.singletonList(new FRect(mini,mf)));
      Pix2Pix.cmpRects(mf,g,mask,mini,CMPLabel.Window.rgb,mf.featureGen.getRects(Feature.WINDOW));
    }
 else {
      for (      Loop<? extends Point2d> l : mf.postState.skelFaces)       g.fill(Pix2Pix.toPoly(mf,mask,mini,l));
      g.setColor(CMPLabel.Background.rgb);
      for (      LoopL<Point2d> ll : mf.postState.occluders)       for (      Loop<Point2d> l : ll)       g.fill(Pix2Pix.toPoly(mf,mask,mini,l));
      Pix2Pix.cmpRects(mf,g,mask,mini,CMPLabel.Window.rgb,new ArrayList<>(mf.postState.generatedWindows));
    }
    mask.x-=resolution;
    Meta meta=new Meta(mf,mask);
    p2.addInput(bi,meta,mf.app.styleZ);
  }
  p2.submit(new Job(new JobResult(){
    @Override public void finished(    Map<Object,File> results){
      String dest;
      try {
        for (        Map.Entry<Object,File> e : results.entrySet()) {
          Meta meta=(Meta)e.getKey();
          dest=Pix2Pix.importTexture(e.getValue(),-1,specLookup,meta.mask);
          if (dest != null) {
            meta.mf.app.coarse=meta.mf.app.texture=dest;
          }
        }
      }
 catch (      Throwable e) {
        e.printStackTrace();
      }
      whenDone.run();
    }
  }
));
}

Fixed version (ground truth):
@Override public void computeBatch(Runnable whenDone,List<App> batch){
  Pix2Pix p2=new Pix2Pix(batch.get(0));
  BufferedImage bi=new BufferedImage(resolution * 2,resolution,BufferedImage.TYPE_3BYTE_BGR);
  Graphics2D g=(Graphics2D)bi.getGraphics();
  List<MiniFacade> mfb=batch.stream().map(x -> (MiniFacade)x.hasA).collect(Collectors.toList());
  for (  MiniFacade mf : mfb) {
    if (mf.featureGen instanceof CGAMini)     mf.featureGen=new FeatureGenerator(mf,mf.featureGen);
    DRectangle bounds=new DRectangle(resolution,0,resolution,resolution);
    DRectangle mini=Pix2Pix.findBounds(mf);
    g.setColor(Color.black);
    g.fillRect(resolution,0,resolution,resolution);
    mini=mf.postState == null ? mf.getAsRect() : mf.postState.outerFacadeRect;
    if (mini == null)     continue;
    DRectangle mask=new DRectangle(mini);
{
      mask=mask.scale(resolution / Math.max(mini.height,mini.width));
      mask.x=(resolution - mask.width) * 0.5 + resolution;
      mask.y=0;
    }
    g.setColor(CMPLabel.Facade.rgb);
    if (mf.postState == null) {
      Pix2Pix.cmpRects(mf,g,mask,mini,CMPLabel.Facade.rgb,Collections.singletonList(new FRect(mini,mf)));
      Pix2Pix.cmpRects(mf,g,mask,mini,CMPLabel.Window.rgb,mf.featureGen.getRects(Feature.WINDOW));
    }
 else {
      for (      Loop<? extends Point2d> l : mf.postState.skelFaces)       g.fill(Pix2Pix.toPoly(mf,mask,mini,l));
      g.setColor(CMPLabel.Background.rgb);
      for (      LoopL<Point2d> ll : mf.postState.occluders)       for (      Loop<Point2d> l : ll)       g.fill(Pix2Pix.toPoly(mf,mask,mini,l));
      Pix2Pix.cmpRects(mf,g,mask,mini,CMPLabel.Window.rgb,new ArrayList<>(mf.postState.generatedWindows));
    }
    mask.x-=resolution;
    Meta meta=new Meta(mf,mask);
    p2.addInput(bi,meta,mf.app.styleZ);
  }
  p2.submit(new Job(new JobResult(){
    @Override public void finished(    Map<Object,File> results){
      String dest;
      try {
        for (        Map.Entry<Object,File> e : results.entrySet()) {
          Meta meta=(Meta)e.getKey();
          dest=Pix2Pix.importTexture(e.getValue(),-1,specLookup,meta.mask);
          if (dest != null) {
            meta.mf.app.coarse=meta.mf.app.texture=dest;
          }
        }
      }
 catch (      Throwable e) {
        e.printStackTrace();
      }
      whenDone.run();
    }
  }
));
}