Skip to content

Detect stale outputs in Laplacian pyramid/reconstruct tests (#37)#40

Open
kiritigowda wants to merge 2 commits into
openvx_1.3.2from
fix/laplacianpyramid-stale-output
Open

Detect stale outputs in Laplacian pyramid/reconstruct tests (#37)#40
kiritigowda wants to merge 2 commits into
openvx_1.3.2from
fix/laplacianpyramid-stale-output

Conversation

@kiritigowda

Copy link
Copy Markdown
Member

Summary

Fixes #37. The LaplacianPyramid.testGraphProcessing and LaplacianReconstruct.testGraphProcessing tests called vxProcessGraph only once. An implementation that returns stale outputs on a re-run with new input would pass these tests undetected.

Changes

In both graph-processing tests, after the initial run:

  • Allocate a modified copy of the input (bitwise-NOT of every pixel)
  • Convert it to a vx_image and rebuild the reference from the modified input (so the comparison stays fair for implementations that correctly recompute)
  • Re-run the OpenVX graph, then compare reference vs. test outputs

Notes specific to this CTS codebase:

  • The allocated CT_Image is registered for garbage collection at allocation, so it is freed at test teardown (this repo has no ct_free_image).
  • The derived vx_image is released explicitly with vxReleaseImage.

This ports the #37 fix from #36, applied in isolation and adapted to the current sources.

Test plan

  • Build the CTS against a 1.3.2 implementation
  • Run --filter=LaplacianPyramid.*:LaplacianReconstruct.* and confirm pass

Made with Cursor

The LaplacianPyramid and LaplacianReconstruct graph-processing tests
executed the graph only once, so an implementation that returned stale
outputs on a re-run with new input would still pass.

Modify the input (bitwise-NOT), rebuild the reference from the modified
input for a fair comparison, and re-run the OpenVX graph before comparing.
The allocated CT_Image is garbage-collected at test teardown; the derived
vx_image is released explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiritigowda kiritigowda self-assigned this Jul 13, 2026
@kiritigowda kiritigowda added enhancement New feature or request 1.3.2 labels Jul 13, 2026
@kiritigowda kiritigowda requested review from Copilot and jessegv July 13, 2026 19:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Updates Laplacian pyramid/reconstruct graph-processing tests to detect implementations that incorrectly return stale outputs when re-processing with changed input.

Changes:

  • Adds a second run of each test using a bitwise-NOT modified copy of the input image.
  • Rebuilds the reference results from the modified input before re-comparing outputs.
  • Releases the temporary vx_image created from the modified CT_Image.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test_conformance/test_laplacianpyramid.c
Comment thread test_conformance/test_laplacianpyramid.c
Comment thread test_conformance/test_laplacianpyramid.c
Comment thread test_conformance/test_laplacianpyramid.c
Comment thread test_conformance/test_laplacianpyramid.c Outdated
Copilot noted the first version rebuilt a fresh graph on the second run
(own_laplacian_*_openvx creates/processes/releases a graph per call), so it
did not actually exercise vxProcessGraph twice on one graph — the exact
stale-output scenario issue #37 targets. It also flagged the data.y access as
assuming single-plane U8.

- Add own_laplacian_pyramid_openvx_rerun and own_laplacian_reconstruct_openvx_rerun
  that keep a single graph, process it, update the input in place via
  ct_image_copyto_vx_image (same handle; reconstruct also refills the pyramid +
  lowest-res inputs from the modified source), then process the same graph again.
- Compute the reference from the modified input after the re-run so the
  comparison stays fair.
- Assert input->format == VX_DF_IMAGE_U8 before the data.y pixel modification
  (both Laplacian generators already produce U8).

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.3.2 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LaplacianPyramid/LaplacianReconstruct tests call vxProcessGraph only once, missing stale-output bugs across re-runs

2 participants