Optix 7.1/7.2 optixAccelCompact() produces bad BVHs with curves?

I’m building an accel containing nothing but curves, and it renders fine. However, if I create a compacted accel from that working accel and attempt to use that, Optix is very unhappy, reporting OPTIX_EXCEPTION_CODE_BUILTIN_IS_MISMATCH in validation mode and rendering black squares where the curves should be. If I turn on exceptions, I see the error “error: mismatch between builtin IS shader and build input”.

I’m using the same compaction code for other BVHs not containing curves and they work properly.

I noticed that the SDK optixCurves example does not compact its BVH, suggesting this is a known issue or limitation.

This same error happens with 7.1 and 7.2.

I can’t decide whether this is a bug in Optix or I have an obscure problem in my own code.

There is an actual bug that I found that’s probably unrelated. In the optix_7_types.h header file, struct OptixInputBuildCurveArray has the following:

/// Stride between vertices. If set to zero, vertices are assumed to be tightly
/// packed and stride is sizeof( float3 ).
unsigned int vertexStrideInBytes;

If I set this to zero, my curves don’t appear. If I explicitly set it to sizeof(float3), which is supposed to be the value assumed when zero is specified, my curves render properly.