A three-dimensional graphics rendering system using ray tracing, comprising: a plurality of test cells , each test cell capable of being configured to execute a traversal operation for traversing a ray in a hierarchical geometry acceleration structure and a primitive test operation between a ray and a geometric primitive defining a surface of an object in a three-dimensional scene, wherein the hierarchical geometry acceleration structure comprises elements bounding subsets of the geometric primitives, wherein the primitive test operation tests intersection between a ray and a geometric primitive, and wherein the traversal operation tests intersection between a ray and an element of the hierarchical geometry acceleration structure; a temporary ray memory coupled to the plurality of test cells, the temporary ray memory operable to store ray data and indicating subsequent processing to be performed with each ray, the temporary ray memory capable of maintaining data for more rays than can be concurrently tested in the set of test cells; a collection management logic for the plurality of test cells, operable to reconfigure test cells from the plurality of test cells to perform either the traversal operation or the primitive test operation, the collection management logic being further operable to select rays from the temporary ray memory according to the respective next processing step to be performed for selected rays and to allocate the selected rays to respective cells from the plurality of test cells, wherein data for the allocated rays is retrieved from the temporary ray memory and provided to the respective test cells to which the rays were allocated; and one or more processors, coupled to the plurality of test cells, capable of executing respective portions of shader code using inputs received from the plurality of test cells. a plurality of test cells , each test cell capable of being configured to execute a traversal operation for traversing a ray in a hierarchical geometry acceleration structure and a primitive test operation between a ray and a geometric primitive defining a surface of an object in a three-dimensional scene, wherein the hierarchical geometry acceleration structure comprises elements bounding subsets of the geometric primitives, wherein the primitive test operation tests intersection between a ray and a geometric primitive, and wherein the traversal operation tests intersection between a ray and an element of the hierarchical geometry acceleration structure; a temporary ray memory coupled to the plurality of test cells, the temporary ray memory operable to store ray data and indicating subsequent processing to be performed with each ray, the temporary ray memory capable of maintaining data for more rays than can be concurrently tested in the set of test cells; a collection management logic for the plurality of test cells, operable to reconfigure test cells from the plurality of test cells to perform either the traversal operation or the primitive test operation, the collection management logic being further operable to select rays from the temporary ray memory according to the respective next processing step to be performed for selected rays and to allocate the selected rays to respective cells from the plurality of test cells, wherein data for the allocated rays is retrieved from the temporary ray memory and provided to the respective test cells to which the rays were allocated; and one or more processors, coupled to the plurality of test cells, capable of executing respective portions of shader code using inputs received from the plurality of test cells. <EOS>