anchor.diff:                  let size = cnt.[ci]
   
                   let mutable i = 0
  -                while i <= size - 32 do
  -                    bs.WriteUInt32 arr.[offset + i / 32]
  -                    i <- i + 32
  -
  -                if size > i then
  -                    let mutable rem = size - i
  -                    if rem > 16 then
  -                        let w = Codeword.create (rem - 16) (uint32 (arr.[offset + i/32] >>> 16))
  -                        bs.Write(w)
  -                        rem <- 16
  -
  -                    let w = Codeword.create rem (uint32 (arr.[offset + i/32]))
  -                    bs.Write(w)
  +                let mutable remaining = size
  +                while remaining > 0 do
  +                    bs.Write(arr.[offset + i], 0, min 32 remaining)
  +                    i <- i + 1
  +                    remaining <- remaining - 32
   
                   let eob = 
                       if ci = 0 then Kernels.encoder.acLuminance.table.[0]
  
positive.code:         zigZagOrder |> Array.map (fun i -> 
              block.[i]
          )
  
      let transform(data : Image) (alignedSize : V2i) (quality : Quantization) (dctBuffer : Buffer<V4f>) =
          use dctInput = pool |> ComputeShader.newInputBinding dct
  
negative.code:         let device = app.Device
          
          let comp = Compressor(app.Runtime)
          let ref = ReferenceCompressor()
  
          let rand = RandomSystem()
  
          let pi = 
              let pi = PixImage<byte>(Col.Format.RGBA, V2i(8,8))
              pi.GetMatrix<C4b>().SetByCoord(fun (c : V2l) ->
                  if c.X >= 4L then C4b.Red
                  else C4b.Green
                  //rand.UniformC3f().ToC4b()
              ) |> ignore
              pi
  
          
          Log.startTimed "CPU"
          let cpu = ref.Transform(pi, Quantization.photoshop80) 
          Log.stop()
  
          let cpu = cpu |> Array.chunkBySize 64
  
          Log.startTimed "GPU"
          let gpuData = comp.Transform(pi, Quantization.photoshop80) 
          let gpu = gpuData |> Array.chunkBySize 64
          for i in 0 .. gpu.Length - 1 do
              let cpu = cpu.[i]
              let gpu = gpu.[i]
  