anchor.diff:          let create (s : ISurface) =
               match SurfaceCompilers.compile ctx signature s with
                   | Success program -> program
  -                | Error e -> failwithf "[GL] surface compilation failed: %s" e
  +                | Error e -> 
  +                    Log.error "[GL] surface compilation failed: %s" e
  +                    failwithf "[GL] surface compilation failed: %s" e
   
           programCache.GetOrCreate<ISurface>(surface, {
               create = fun b      -> create b
  
positive.code:             )
  
          member x.Create(data : IBuffer) =
              let shared = get data
              shared.Acquire()
              shared :> Buffer
  
          member x.Update(b : Buffer, data : IBuffer) : Buffer =
              match b with
                  | :? RefCountedBuffer as b ->
                      
                      let newShared = get data
                      if newShared = b then
                          b :> Buffer
                      else
                          newShared.Acquire()
                          b.Release()
                          newShared :> Buffer
                  | _ ->
                      ctx.Upload(b, data)
                      b
  
          member x.Delete(b : Buffer) =
              match b with
                  | :? RefCountedBuffer as b -> b.Release()
                  | _ -> ctx.Delete b
  
      type ArrayBufferManager(ctx : Context) =
          let cache = ConcurrentDictionary<Array, RefCountedBuffer>()
  
          let get (b : Array) =
  
negative.code:             )
  
          member x.Create(data : Array) =
              if active then
                  let shared = get data
                  shared.Acquire()
                  shared :> Buffer
              else
                  ctx.CreateBuffer data
  
          member x.Update(b : Buffer, data : Array) : Buffer =
              if active then
                  match b with
                      | :? RefCountedBuffer as b ->
                      
                          let newShared = get data
                          if newShared = b then
                              b :> Buffer
                          else
                              newShared.Acquire()
                              b.Release()
                              newShared :> Buffer
                      | _ ->
                          ctx.Upload(b, data)
                          b
              else
                  ctx.Upload(b, data)
                  b
  
          member x.Delete(b : Buffer) =
              if active then
                  match b with
                      | :? RefCountedBuffer as b -> b.Release()
                      | _ -> ctx.Delete b
              else
                  ctx.Delete b
  
      type TextureManager(ctx : Context, active : bool) =
          let cache = ConcurrentDictionary<ITexture, RefCountedTexture>()
  
          let get (b : ITexture) =
              cache.GetOrAdd(b, fun v -> 
                  RefCountedTexture(
                      ctx,
                      (fun () -> ctx.CreateTexture b),
                      (fun () -> cache.TryRemove b |> ignore)
                  )
              )
  
          member x.Create(data : ITexture) =
              if active then
                  let shared = get data
                  shared.Acquire()
                  shared :> Texture
              else
                  ctx.CreateTexture data
  
          member x.Update(b : Texture, data : ITexture) : Texture =
              if active then
                  match b with
                      | :? RefCountedTexture as b ->
                      
                          let newShared = get data
                          if newShared = b then
                              b :> Texture
                          else
                              newShared.Acquire()
                              b.Release()
                              newShared :> Texture
                      | _ ->
                          ctx.Upload(b, data)
                          b
              else
                  ctx.Upload(b, data)
                  b
  
          member x.Delete(b : Texture) =
              if active then
                  match b with
                      | :? RefCountedTexture as b -> b.Release()
                      | _ -> ctx.Delete b
              else
                  ctx.Delete b
  
  
  
  