I think the following pseudocode from the book contains a bug:
function position(ray, t)
return ray.origin + ray.direction * t
end function
Isn’t it neccessary to normalize the direction vector first, before scaling it? The associated test case works only, because the given direction vector has already length = 1.