Repository navigation
Fix incorrect mean FLIP error - #11
Merged
Merged
Conversation
Upstream FLIP (NVlabs/flip#45) found that accumulating the sum in float makes the reported mean drift from the actual mean of the error map. flip_capi.cpp has its own copy of that accumulation, so pin the expected behavior here and sync the expected means with upstream test.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Accumulating the per-pixel sum in float loses precision as the pixel count grows, so the reported mean did not match the actual mean of the error map. Same issue as fixed upstream in NVlabs/flip#45. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The focused precision correction has appropriate regression coverage and no identified blocking issues; tests were not run.
0 open findings
What changed in this PR
Corrects mean FLIP error calculation in the native wrapper used by the C# bindings.
Changes:
- Accumulates pixel errors in double precision.
- Adds regression coverage comparing
MeanErrorwith the error-map mean. - Updates expected LDR and HDR means to upstream values.
| File | Description |
|---|---|
| FlipBinding.CSharp.Tests/FlipTest.cs | Adds mean-consistency coverage and updates expected values. |
| flip-native/flip_capi.cpp | Uses double precision when calculating mean error. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
doubleinflip-native/flip_capi.cppso thatMeanErrormatches the actual mean of the error mapflip-nativecomputes the mean itself (to also take the peak before colormapping), so updating the submodule alone does not fix itMeanErrorequals the double-precision mean ofErrorMaptest.py(LDR0.159693, HDR0.283547)Notes
MeanErrorvalues change slightly (e.g. LDR test images:0.159691→0.159693)🤖 Generated with Claude Code