single-buffer codegen