Finally fixed the mystery edge noise and the mystery segfaults. It was an off-by-one error in output rotation that caused it to read outside the original array boundaries.