Summary
test_conformance/test_laplacianpyramid.c calls vxProcessGraph() exactly once per test for both LaplacianPyramid and LaplacianReconstruct. Because of this, the suite cannot detect implementations that compute the result once (e.g. at vxVerifyGraph() time) and then return a stale, cached output on subsequent vxProcessGraph() calls.
This is not a hypothetical gap — it currently hides a real spec violation in the OpenVX sample implementation, tracked at KhronosGroup/OpenVX-sample-impl#59, where vxLaplacianPyramidKernel / vxLaplacianReconstructKernel are no-op stubs and the actual pyramid computation is hoisted into the *Initializer callback (which runs once during verify). The CTS passes regardless, because it never re-processes the graph after mutating the input.
Why the current tests miss it
In both LaplacianPyramid.testGraphProcessing and LaplacianReconstruct.testGraphProcessing the shape is:
ASSERT_VX_OBJECT(node = vxLaplacianPyramidNode(graph, input, laplacian, output), VX_TYPE_NODE);
VX_CALL(vxSetNodeAttribute(node, VX_NODE_BORDER, &border, sizeof(border)));
VX_CALL(vxVerifyGraph(graph));
VX_CALL(vxProcessGraph(graph)); // <-- only one call, then output is compared
The spec (vxProcessGraph, REQ-0606/REQ-0607) requires the graph to be processed against the current input on every call; there is no allowance for skipping execution when an implementation assumes the input is unchanged (callers may mutate input pixels via vxMapImagePatch / vxCopyImagePatch between runs without notifying anything).
Proposed fix
Add a regression test to both LaplacianPyramid and LaplacianReconstruct that:
- Verifies the graph once.
- Fills the input with value A,
vxProcessGraph(), snapshot the output.
- Mutates the input to value B (without re-verifying).
vxProcessGraph() again, snapshot the output.
- Asserts the two outputs differ.
A spec-compliant implementation recomputes and the outputs differ; a verify-time-caching implementation returns identical bytes and the test fails. For LaplacianPyramid, comparing the residual (lowest-resolution) output image works well, since a constant input maps to a constant residual that tracks the input value. For LaplacianReconstruct, mutating the lowest-resolution input image and comparing the reconstructed output works the same way.
Sketch:
TEST(LaplacianPyramid, testReprocessReflectsInputChange)
{
/* build graph + node, set border, vxVerifyGraph once */
fill_input(input, 50); vxProcessGraph(graph); c1 = checksum(output);
fill_input(input, 200); vxProcessGraph(graph); c2 = checksum(output); /* no re-verify */
ASSERT(c1 != c2);
}
I've prototyped exactly this against the sample implementation: the fixed kernels pass it, and the current (unfixed) sample fails it — so it correctly gates the bug in KhronosGroup/OpenVX-sample-impl#59.
I'm happy to open a PR with the two tests if that's welcome.
References
Summary
test_conformance/test_laplacianpyramid.ccallsvxProcessGraph()exactly once per test for bothLaplacianPyramidandLaplacianReconstruct. Because of this, the suite cannot detect implementations that compute the result once (e.g. atvxVerifyGraph()time) and then return a stale, cached output on subsequentvxProcessGraph()calls.This is not a hypothetical gap — it currently hides a real spec violation in the OpenVX sample implementation, tracked at KhronosGroup/OpenVX-sample-impl#59, where
vxLaplacianPyramidKernel/vxLaplacianReconstructKernelare no-op stubs and the actual pyramid computation is hoisted into the*Initializercallback (which runs once during verify). The CTS passes regardless, because it never re-processes the graph after mutating the input.Why the current tests miss it
In both
LaplacianPyramid.testGraphProcessingandLaplacianReconstruct.testGraphProcessingthe shape is:The spec (
vxProcessGraph, REQ-0606/REQ-0607) requires the graph to be processed against the current input on every call; there is no allowance for skipping execution when an implementation assumes the input is unchanged (callers may mutate input pixels viavxMapImagePatch/vxCopyImagePatchbetween runs without notifying anything).Proposed fix
Add a regression test to both
LaplacianPyramidandLaplacianReconstructthat:vxProcessGraph(), snapshot the output.vxProcessGraph()again, snapshot the output.A spec-compliant implementation recomputes and the outputs differ; a verify-time-caching implementation returns identical bytes and the test fails. For
LaplacianPyramid, comparing the residual (lowest-resolution) output image works well, since a constant input maps to a constant residual that tracks the input value. ForLaplacianReconstruct, mutating the lowest-resolution input image and comparing the reconstructed output works the same way.Sketch:
I've prototyped exactly this against the sample implementation: the fixed kernels pass it, and the current (unfixed) sample fails it — so it correctly gates the bug in KhronosGroup/OpenVX-sample-impl#59.
I'm happy to open a PR with the two tests if that's welcome.
References