Skip to content

OpenVX 1.3.1 Conformance Phase 2#5

Merged
simonCatBot merged 38 commits intomasterfrom
fix/openvx-1.3.1-conformance-phase2
Apr 20, 2026
Merged

OpenVX 1.3.1 Conformance Phase 2#5
simonCatBot merged 38 commits intomasterfrom
fix/openvx-1.3.1-conformance-phase2

Conversation

@simonCatBot
Copy link
Copy Markdown
Owner

Work in progress for OpenVX 1.3.1 conformance.

Status:

  • Baseline: 24/24 passing ✅
  • ColorConvert: 14/56 passing (needs work)
  • Filters: All passing ✅

Changes:

  • Fixed vxMapArrayRange memory bug
  • Agent fixes for color conversions
  • VXU arithmetic improvements

Kiriti added 30 commits April 12, 2026 15:33
- Was passing null as kernel, causing Graph.VirtualArray test to fail
- Now looks up kernel by name and properly sets parameters
- vxFastCornersNode: Was passing null kernel, now looks up kernel by name
- vxOpticalFlowPyrLKNode: Fixed parameter count to match kernel registration

Graph.VirtualArray still failing on user kernel lookup (vxAddUserKernel)
- vxFastCornersNode: Now uses proper kernel lookup
- vxOpticalFlowPyrLKNode: Fixed parameter count to 7 params
- vxAddUserKernel: Now registers kernel in REFERENCE_TYPES as VX_TYPE_KERNEL
- Removed debug eprintln! statements from execute_node
The mapped data pointer was being returned from a local Vec that gets
dropped at the end of the function. Fixed by getting the pointer
BEFORE moving the Vec into the HashMap.

Also cleaned up vxUnmapArrayRange to avoid unsafe memory reconstruction.
- vxFastCornersNode: Now looks up kernel by name
- vxOpticalFlowPyrLKNode: Fixed parameter count to 7
- vxAddUserKernel: Now registers with VX_TYPE_KERNEL type
- vxGetParameterByIndex: Now syncs with node's parameters
- dispatch_kernel_with_border: Added stub for user kernels
- Removed debug eprintln! statements

Remaining: User kernel execution needs kernel callback field in VxCUserKernel
- VXU arithmetic operations fixes
- Image operation improvements
- Color conversion enhancements (NV21, packed YUV support)

Work in progress from multi-agent conformance effort.
- Added kernel function field to VxCUserKernel struct
- Fixed vxAddUserKernel to accept kernel execution function
- Made USER_KERNELS and VxCUserKernel fields public for access from c_api
- vxCreateGenericNode now checks USER_KERNELS for num_params

Graph.VirtualArray still failing - parameter 2 not being set correctly
…_CONTEXT_IMMEDIATE_BORDER, vxQueryPyramid constants
…ng, fix signatures

- HarrisCorners: num_params 7→8, use fixed-index params instead of conditional push
- FastCorners: fix both vxFASTCornersNode and vxFastCornersNode with correct param indices
- NonLinearFilter: fix signature from mask_size:vx_size to mask:vx_matrix
- HalfScaleGaussian: replace NULL kernel stub with proper create_node_with_params
- Not/ConvertDepth/EqualizeHist: replace NULL kernel stubs with proper create_node_with_params
- LaplacianPyramid: implement node creation (was returning NULL)
- LaplacianReconstruct: implement node creation (was returning NULL)
- create_node_with_params: skip NULL params (optional outputs)
- vxSetParameterByIndex: remove incorrect NULL rejection for param 0
- Fix vxGetKernelByEnum fallback num_params match table
The pattern matrix is required by NonLinearFilterNode and other kernels.
Uses VX_TYPE_UINT8 with 0/255 values per the OpenVX spec.
…ncation

- vxCopyScalar now delegates to c_api_data::vxCopyScalarData (works with actual VxCScalarData layout)
- Added vxCopyScalarData to c_api_data.rs
- Fixed vxQueryScalar missing #[no_mangle]
- Weighted average now reads alpha from scalar instead of hardcoding 128
- Uses float arithmetic: output = alpha*img1 + (1-alpha)*img2 with C-style truncation
- 102/102 WeightedAverage tests now pass
…parameter

The OpenVX spec defines vxuMultiply with vx_float32 scale (plain float),
not vx_scalar. The previous implementation incorrectly treated the float
value as a pointer, causing a segfault. Added vxu_multiply_impl_direct_scale
for the VXU path, keeping vxu_multiply_impl (scalar-based) for graph path.

Result: vxuMultiply 0/170 -> 170/170 passing
…, proper border handling, correct CTS-matching formulas
…r planar formats

Major fixes:
1. vxSwapImageHandle: Handle NULL new_ptrs (reclaim pointers), return
   VX_ERROR_INVALID_REFERENCE for ROI/channel sub-images (not from handle)
2. Fix vx_imagepatch_addressing_t struct layout: step_y was u32 should
   be u16, stride_x_bits was i32 should be u16. This caused wrong stride
   values for multi-plane formats (NV12, NV21, IYUV, YUV4) when reading
   from addrs[] array in vxCreateImageFromHandle.
3. vxCreateImageFromROI: Share parent data instead of copying. Support
   external memory ROIs that follow parent handle swaps. Track ROI
   offsets per plane for correct addressing.
4. vxMapImagePatch: For ROI sub-images, look up root parent's current
   external pointers (handles may have been swapped). Return
   VX_ERROR_NO_MEMORY when external pointers are NULL (reclaimed).
5. Fix VxCImage::plane_dimensions for NV12/NV21 plane 1: dim_x should
   be width/2 (chroma subsampling), not width.
6. Add is_from_handle flag to VxCImage to distinguish images created
   directly from vxCreateImageFromHandle vs sub-images.
7. Add roi_offsets field to VxCImage for per-plane ROI offset tracking.
- Fixed CTS column-major matrix layout: m[0]*x + m[2]*y + m[4] for src_x
- Added border mode support (VX_BORDER_CONSTANT with any value, UNDEFINED, REPLICATE)
- Added nearest neighbor interpolation support for warp
- Fixed border_from_vx to use correct OpenVX enum values (0xC000, 0xC001, 0xC002)
- Read interpolation type from scalar parameter in graph dispatch
- Pass node border mode through to warp functions

WarpAffine: 71/305 -> 292/305 pass
- Apply same border mode fixes to warp_perspective (now 360/361)
- Implement vxCopyRemapPatch to actually store remap table data
- Implement vxu_remap_impl with bilinear and NN interpolation
- Fix border constant value propagation for all warp/remap ops
- Remap: 52/380 -> 361/380
@simonCatBot simonCatBot merged commit 80ac59a into master Apr 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant