This was really excellent - for many of us, code helps to make mechanisms concrete, and it forces every single thing to be pinned down, and not hand-waved away.
(Like another commenter, I was also hoping for a direct/standalone explanation for why the red matrix is transposed.)
(Like another commenter, I was also hoping for a direct/standalone explanation for why the red matrix is transposed.)