RustVX OpenVX 1.3 Conformance Fix Plan
Current Status : 27/27 Baseline Tests Pass (Context, Graph, Basic Nodes)
Target : Full OpenVX 1.3 Conformance (~300 API functions)
Gap : ~270 functions missing or stub-only
Phase 1: Reference Management (Week 1)
1.1 Core Reference Functions
These are required for proper memory management and debugging:
Function
Status
Action
vxRetainReference
❌ Missing
Add reference count increment
vxReleaseReference
⚠️ Partial
Fix unified registry cleanup
vxQueryReference
❌ Missing
Add reference attribute queries
vxSetReferenceName
❌ Missing
Add debug naming support
vxGetContext
❌ Missing
Add context retrieval from reference
vxGetStatus
❌ Missing
Add error status retrieval
Implementation : Extend openvx-core/src/unified_c_api.rs
Add REFERENCE_COUNTS registry integration
Ensure all reference types (Image, Scalar, Threshold, etc.) register properly
Add name storage in REFERENCE_NAMES HashMap
1.2 Reference Type Registration
Update all create/release functions to:
Register in REFERENCE_COUNTS on creation
Clean up REFERENCE_NAMES on release
Support vxQueryReference for type introspection
Phase 2: Image API (Week 1-2)
2.1 Image Creation Functions
Function
Priority
Notes
vxCreateImage
🔴 Critical
U8, RGB, RGBX formats
vxCreateVirtualImage
🔴 Critical
For graph intermediate results
vxCreateImageFromHandle
🔴 Critical
For external memory
vxCreateImageFromChannel
🟡 Medium
Channel extraction
vxCreateImageFromROI
🟡 Medium
Region of interest
2.2 Image Access Functions
Function
Priority
Notes
vxQueryImage
🔴 Critical
Width, height, format queries
vxMapImagePatch
🔴 Critical
CPU read/write access
vxUnmapImagePatch
🔴 Critical
Release mapped memory
vxSetImageAttribute
🟡 Medium
Valid rectangle, etc.
vxFormatImagePatchAddress2d
🔴 Critical
Patch addressing math
vxGetValidRegionImage
🟡 Medium
Get valid pixel region
vxSetImageValidRectangle
🟡 Medium
Set valid region
vxSwapImageHandle
🟢 Low
Handle swapping
Implementation : Extend openvx-image/src/c_api.rs
Use existing VxCImage struct from unified_c_api
Implement proper memory layout for planar formats
Support NV12, RGB, U8 formats at minimum
Phase 3: Vision Kernels (Week 2-3)
All currently stubs - need actual implementations:
Kernel
Algorithm
Test Status
vxGaussian3x3
3x3 Gaussian blur
❌ Fails
vxBox3x3
3x3 box filter
❌ Fails
vxMedian3x3
3x3 median filter
❌ Fails
vxErode3x3
Morphological erosion
❌ Fails
vxDilate3x3
Morphological dilation
❌ Fails
vxConvolve
Generic convolution
❌ Fails
vxGaussianPyramid
Multi-scale pyramid
❌ Fails
vxScaleImage
Resize (nearest/bilinear)
❌ Fails
Implementation : openvx-vision/src/filter_simd.rs or new file
Start with simple scalar implementations
Add SIMD optimizations (AVX2/NEON) as Phase 3b
Ensure boundary handling matches OpenVX spec
3.2 Edge Detection Kernels
Kernel
Algorithm
Priority
vxSobel3x3
Sobel edge detection
🔴 Critical
vxMagnitude
Gradient magnitude
🔴 Critical
vxPhase
Gradient phase
🟡 Medium
vxCannyEdgeDetector
Canny edges
🟡 Medium
vxHarrisCorners
Harris corner detection
🟡 Medium
vxFastCorners
FAST corners
🟢 Low
3.3 Arithmetic/Logic Kernels
Kernel
Operation
Priority
vxAdd
Element-wise add
🔴 Critical
vxSubtract
Element-wise subtract
🔴 Critical
vxMultiply
Element-wise multiply
🔴 Critical
vxAnd
Bitwise AND
🔴 Critical
vxOr
Bitwise OR
🔴 Critical
vxXor
Bitwise XOR
🟡 Medium
vxNot
Bitwise NOT
🟡 Medium
vxAbsDiff
Absolute difference
🟡 Medium
3.4 Color/Conversion Kernels
Kernel
Operation
Priority
vxColorConvert
Color space conversion
🔴 Critical
vxChannelExtract
Extract single channel
🟡 Medium
vxChannelCombine
Combine channels
🟡 Medium
vxConvertDepth
Bit depth conversion
🟡 Medium
vxThreshold
Binary thresholding
🔴 Critical
Phase 4: Data Objects (Week 3)
Function
Status
vxCreateScalar
❌ Missing
vxReleaseScalar
❌ Missing
vxQueryScalar
❌ Missing
vxCopyScalar
❌ Missing
vxCreateVirtualScalar
❌ Missing
Implementation : New file openvx-core/src/scalar.rs
Function
Status
vxCreateThreshold
❌ Missing
vxCreateThresholdForImage
❌ Missing
vxReleaseThreshold
❌ Missing
vxQueryThreshold
❌ Missing
vxSetThresholdAttribute
❌ Missing
vxCopyThresholdValue
❌ Missing
vxCopyThresholdRange
❌ Missing
vxCopyThresholdOutput
❌ Missing
Implementation : New file openvx-core/src/threshold.rs
Function
Status
vxCreateArray
❌ Missing
vxCreateVirtualArray
❌ Missing
vxReleaseArray
❌ Missing
vxQueryArray
❌ Missing
vxAddArrayItems
❌ Missing
vxTruncateArray
❌ Missing
vxCopyArrayRange
❌ Missing
vxMapArrayRange
❌ Missing
vxUnmapArrayRange
❌ Missing
Implementation : New file openvx-core/src/array.rs
Function
Status
vxCreateConvolution
❌ Missing
vxCreateVirtualConvolution
❌ Missing
vxReleaseConvolution
❌ Missing
vxQueryConvolution
❌ Missing
vxSetConvolutionAttribute
❌ Missing
vxCopyConvolutionCoefficients
❌ Missing
Implementation : New file openvx-core/src/convolution.rs
Function
Status
vxCreateMatrix
❌ Missing
vxCreateMatrixFromPattern
❌ Missing
vxCreateMatrixFromPatternAndOrigin
❌ Missing
vxCreateVirtualMatrix
❌ Missing
vxReleaseMatrix
❌ Missing
vxQueryMatrix
❌ Missing
vxCopyMatrix
❌ Missing
Implementation : New file openvx-core/src/matrix.rs
Function
Status
vxCreateLUT
❌ Missing
vxCreateVirtualLUT
❌ Missing
vxReleaseLUT
❌ Missing
vxQueryLUT
❌ Missing
vxCopyLUT
❌ Missing
vxMapLUT
❌ Missing
vxUnmapLUT
❌ Missing
Implementation : New file openvx-core/src/lut.rs
Function
Status
vxCreatePyramid
❌ Missing
vxCreateVirtualPyramid
❌ Missing
vxReleasePyramid
❌ Missing
vxQueryPyramid
❌ Missing
vxGetPyramidLevel
❌ Missing
Implementation : New file openvx-core/src/pyramid.rs
Function
Status
vxCreateDistribution
❌ Missing
vxCreateVirtualDistribution
❌ Missing
vxReleaseDistribution
❌ Missing
vxQueryDistribution
❌ Missing
vxCopyDistribution
❌ Missing
vxMapDistribution
❌ Missing
vxUnmapDistribution
❌ Missing
Implementation : New file openvx-core/src/distribution.rs
Function
Status
vxCreateRemap
❌ Missing
vxCreateVirtualRemap
❌ Missing
vxReleaseRemap
❌ Missing
vxQueryRemap
❌ Missing
vxCopyRemapPatch
❌ Missing
vxMapRemapPatch
❌ Missing
vxUnmapRemapPatch
❌ Missing
Implementation : New file openvx-core/src/remap.rs
Phase 5: Graph/Node Management (Week 4)
Function
Status
Notes
vxQueryNode
❌ Missing
Query node attributes
vxReleaseNode
❌ Missing
Proper cleanup
vxAssignNodeCallback
🟡 Medium
User callbacks
vxRetrieveNodeCallback
🟡 Medium
Get callback
vxSetNodeAttribute
⚠️ Partial
Complete implementation
vxReplicateNode
❌ Missing
Batch processing
vxSetNodeTarget
⚠️ Partial
Target selection
Function
Status
Notes
vxScheduleGraph
⚠️ Partial
Async execution
vxWaitGraph
⚠️ Partial
Wait for completion
vxIsGraphVerified
⚠️ Partial
Verification check
Phase 6: Kernel Management (Week 4)
Function
Status
vxLoadKernels
❌ Missing
vxUnloadKernels
❌ Missing
vxGetKernelByName
❌ Missing
vxGetKernelByEnum
❌ Missing
vxQueryKernel
❌ Missing
vxGetKernelParameterByIndex
❌ Missing
Function
Status
vxAddUserKernel
⚠️ Partial
vxFinalizeKernel
❌ Missing
vxRemoveKernel
❌ Missing
vxSetKernelAttribute
⚠️ Partial
vxAddParameterToKernel
❌ Missing
Phase 7: Testing & Validation (Week 5)
Run and fix failures in each group:
GraphBase - 14 tests (currently passing)
SmokeTestBase - 7 tests (currently passing)
TargetBase - 3 tests (currently passing)
Image - Image operations
Filter - Gaussian, Box, Median, Erode, Dilate
Edge - Sobel, Magnitude, Canny
Arithmetic - Add, Subtract, Multiply
Color - ColorConvert, ChannelExtract
Histogram - Histogram, EqualizeHist
Integral - IntegralImage
Warp - WarpAffine, WarpPerspective, Remap
OpticalFlow - OpticalFlowPyrLK
7.2 Performance Optimization
Add SIMD implementations (AVX2 for x86_64, NEON for ARM)
Optimize memory access patterns
Add multi-threading for large images
Critical (Must Have for Conformance)
Reference management (vxRetainReference, vxReleaseReference, etc.)
Image creation and access (vxCreateImage, vxMapImagePatch, etc.)
Vision kernels: Gaussian3x3, Sobel3x3, Add, Threshold
Data objects: Scalar, Threshold, Array
More vision kernels: ColorConvert, Box3x3, Median3x3
Data objects: Convolution, Matrix, LUT
Node management improvements
Advanced kernels: OpticalFlow, WarpPerspective
Pyramid, Remap, Distribution
User kernel support
openvx-ffi/src/lib.rs - Ensure all symbols exported
openvx-core/src/c_api.rs - Add missing functions
openvx-core/src/unified_c_api.rs - Fix reference management
openvx-image/src/c_api.rs - Complete image API
openvx-vision/src/filter_simd.rs - Add kernel implementations
openvx-core/src/scalar.rs
openvx-core/src/threshold.rs
openvx-core/src/array.rs
openvx-core/src/convolution.rs
openvx-core/src/matrix.rs
openvx-core/src/lut.rs
openvx-core/src/pyramid.rs
openvx-core/src/distribution.rs
openvx-core/src/remap.rs
All 25 baseline tests pass (✅ Already achieved)
All Image tests pass
All Filter tests pass
All Edge Detection tests pass
All Arithmetic tests pass
All Color tests pass
All Data Object tests pass
Linker errors resolved (all vx* symbols exported)
Start with Phase 1: Reference Management (core infrastructure)
Move to Phase 2: Image API (required for all vision tests)
Implement Phase 3: Vision Kernels (actual algorithms)
Add Phase 4: Data Objects (supporting types)
Fix Phase 5: Graph/Node management
Complete Phase 6: Kernel Management
Phase 7: Testing until all CTS tests pass
Estimated Timeline : 5 weeks
Risk : Vision kernel algorithms require careful implementation to match Khronos reference results