I made ChatGPT write a circular buffer, examples, tests. It made it tricky so it can write data forward and in reverse and it can loop over. It avoids memory copy whenever possible. It took me three hours and it was miserable but the result is impressive.