The way it's currently specified, the matrix that's supposed to be returned from XRRay.matrix is not unique - there are infinitely many ways of transforming one ray into another as the roll is not constrained in this problem. The specification should describe exactly how the XRRay.matrix should be calculated to prevent interoperability issues between different implementations.