record playback with context counting + tests