Link to spec: https://drafts.csswg.org/css-transforms-2/#decomposing-a-3d-matrix
First there is no mention in the pseudocode that the matrix is assumed to be expressed in column major order. This needs to be inferred from looking at the indexing of the translation and perspective elements. To add to the confusion, the variable row is initialized to be a copy of the matrix. Thus row[i] is actually the ith column of the matrix and not a row. This naming makes it more difficult to follow the algorithm to verify its correctness.