Skip to content

Add PeakError to result - #8

Merged
nowsprinting merged 5 commits into
mainfrom
feature/peak-error
Oct 15, 2026
Merged

nowsprinting merged 5 commits into
mainfrom
feature/peak-error

Conversation

@nowsprinting

Copy link
Copy Markdown
Contributor

Changes

  • Add FlipResult.PeakError (maximum per-pixel FLIP error)
    • FLIP's pointer API returns only the mean, and the magma-mapped error map cannot be scanned for the peak, so flip-native computes it from the grayscale map before colormapping
  • Update README.md, Docs/sample_ja.md and Docs/pinvoke_ja.md
    • Also fix drift in Docs/pinvoke_ja.md from the actual binding

Breaking changes

  • FlipResult constructor takes a new peakError parameter
  • flip_evaluate in flip-native takes a new peak_error parameter; the managed library and native libraries must be updated together

🤖 Generated with Claude Code

nowsprinting and others added 4 commits October 14, 2026 14:17
Mean error alone hides localized artifacts; specify peak error before
implementing it, including that magma-mapped output reports the same peak
as grayscale output since the colormapped map cannot be scanned for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mean error dilutes small but severe artifacts, so expose the maximum
per-pixel error as well. FLIP's pointer API reports only the mean, and
once the magma colormap is applied the error values cannot be recovered,
so the native wrapper computes the peak from the grayscale map itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep the usage samples and the P/Invoke signatures in sync with the added
peak error output so readers do not copy a stale flip_evaluate signature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The doc referenced a removed flip_parameters_init, platform-specific
library names and a manual Plugins layout that the NuGet-based
distribution never used, and full copies of the sources had already
diverged; link to the sources instead so the doc cannot drift again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nowsprinting nowsprinting added enhancement New feature or request breaking-change labels Oct 14, 2026
The wrapper mirrors FLIP's pointer-based evaluate(), which syncs device
data to the host before scanning and copying it; without the same guards
a CUDA build would read stale host memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nowsprinting
nowsprinting marked this pull request as draft October 14, 2026 06:07
@nowsprinting
nowsprinting marked this pull request as ready for review October 14, 2026 06:18
@nowsprinting
nowsprinting requested a balanced review from Copilot October 14, 2026 06:18

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.

🟢 Approval recommended

The managed and native API changes are consistent and adequately tested.

0 open findings

What changed in this PR

Adds maximum per-pixel FLIP error reporting across the native and managed APIs.

Changes:

  • Computes peak error before optional Magma mapping.
  • Exposes FlipResult.PeakError through P/Invoke.
  • Adds tests and updates usage documentation.
File Description
README.md Documents peak error usage.
FlipBinding.CSharp/​FlipResult.cs Adds PeakError.
FlipBinding.CSharp/​FlipNative.cs Updates native signature.
FlipBinding.CSharp/​Flip.cs Returns native peak error.
FlipBinding.CSharp.Tests/​FlipTest.cs Tests peak evaluation behavior.
FlipBinding.CSharp.Tests/​FlipResultTest.cs Updates constructor tests.
flip-native/​flip_capi.h Extends the C API.
flip-native/​flip_capi.cpp Computes peak from grayscale output.
Docs/​sample_ja.md Adds peak usage examples.
Docs/​pinvoke_ja.md Synchronizes P/Invoke documentation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nowsprinting
nowsprinting merged commit 3aa4ca6 into main Oct 15, 2026
8 checks passed
@nowsprinting
nowsprinting deleted the feature/peak-error branch October 15, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants