Skip to content

Fix GPU mean validation to honor mean_tol#35

Merged
alexlib merged 2 commits into
masterfrom
copilot/verify-proposed-solution-tests
May 20, 2026
Merged

Fix GPU mean validation to honor mean_tol#35
alexlib merged 2 commits into
masterfrom
copilot/verify-proposed-solution-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 20, 2026

GPU validation was not consistently applying the configured tolerance for mean-based outlier rejection. Validation._mean_validation() used the median threshold path, so changing mean_tol had no effect in the scalar mean-validation flow.

  • Problem

    • Mean-based GPU validation ignored mean_tol and instead reused median_tol.
    • This made parameterized validation behavior incorrect and hard to verify.
  • Code change

    • Updated openpiv/gpu/validation.py so _mean_validation() passes self.mean_tol into _neighbour_validation().
  • Regression coverage

    • Added a focused test in openpiv/test/test_gpu_validation_logic.py that loads the GPU validation module with lightweight stubs and asserts mean validation uses mean_tol, not median_tol.
    • The test is CUDA-independent and targets the tolerance wiring directly.
  • Behavior before / after

    # before
    _neighbour_validation(..., self.median_tol, ...)
    
    # after
    _neighbour_validation(..., self.mean_tol, ...)

Copilot AI linked an issue May 20, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Validate proposed solution and add tests Fix GPU mean validation to honor mean_tol May 20, 2026
Copilot AI requested a review from alexlib May 20, 2026 12:23
@alexlib alexlib marked this pull request as ready for review May 20, 2026 20:32
Copilot AI review requested due to automatic review settings May 20, 2026 20:32
@alexlib alexlib merged commit 6794780 into master May 20, 2026
0 of 3 checks passed
Copilot AI review requested due to automatic review settings May 20, 2026 20:54
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.

validation

2 participants