In this article
A callback reports traversal candidates under an API contract; it is not automatically a deduplicated list of physical surface crossings.
Separate filtering from event collection
A ray-intersection filter can implement a cutout or reject a candidate according to application logic. It can also tempt a renderer to count callback invocations as physical surface events. Those are different uses. Before collecting training labels, path statistics or layered geometry, define what an accepted event means and whether the traversal callback provides that guarantee. A callback that looks correct for a single triangle can violate the intended interpretation in a more complex acceleration build.
Expect documented repeated candidates
The intersection-filter reference documents possible repeated primitive-hit callbacks under high build quality and at shared edges. An invocation counter can therefore overcount a surface. If the application needs uniqueness, define a deduplication key scoped to the ray and intended instance context. Do not maintain one global primitive-seen set across unrelated rays, because legitimate observations of the same geometry must remain separate.
Respect the lane-validity contract
The filter reference describes active masks, packet-oriented input and permitted changes when accepting or rejecting a hit. Work only on valid lanes and preserve inactive components. Access ray and hit data through helpers appropriate to the provided layout, rather than assuming a scalar struct behind every callback. Keeping the callback’s transformation within the documented permissions is essential when a renderer changes query width or moves from a scalar diagnostic scene to vectorized execution.
Preserve the query and backend semantics
The closest-hit documentation defines the enclosing query’s result and instance information. Filtering candidates does not by itself turn it into an ordered traversal stream. The SYCL API guide adds device-execution requirements for GPU integrations. Check callback accessibility and supported operations on the selected backend instead of assuming a host function pointer and mutable host state are valid inside device traversal.
Test edges and repeated instances
Compare ordinary surfaces, a shared edge, a cutout and repeated instances of the same asset under different build settings. Inspect accepted query results separately from callback counts. The guides to GPU BVH traversal and dataset annotation identity give related context. A reliable filter preserves query semantics while its diagnostic event collector explicitly handles duplicates, ray identity and instance scope; it does not derive physical counts from incidental callback behavior.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.