Conversation
Co-authored-by: whitews <1298022+whitews@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement C extension for FlowIO preprocessing math
Add optional C preprocessing extension for deterministic FlowData transforms
Sep 19, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #41 +/- ##
===========================================
- Coverage 93.00% 89.79% -3.21%
===========================================
Files 7 8 +1
Lines 486 549 +63
===========================================
+ Hits 452 493 +41
- Misses 34 56 +22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Owner
|
@copilot resolve the merge conflicts in this pull request |
…c-extension-preprocessing # Conflicts: # src/flowio/flowdata.py Co-authored-by: whitews <1298022+whitews@users.noreply.github.com>
Author
whitews
requested changes
Sep 19, 2026
whitews
left a comment
Owner
There was a problem hiding this comment.
Let's separate out the preprocessing benchmark as an initial commit so we get a baseline of the current performance. Can you make a separate PR for the benchmark off of the current develop branch?
whitews
added this pull request to stack #43
September 19, 2026 14:10
Author
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.
FlowData preprocessing was still using NumPy channel-slice expressions for log/gain conversion, which made exact-array fixture tests sensitive to environment-dependent floating-point behavior. This change moves preprocessing behind a shared implementation with an optional C extension, while preserving the existing API and the Python/NumPy fallback path.
Design
flowio._preprocessing_ext, a C extension that processes a contiguousfloat642-D event array in a single row/column traversal using per-channeldecades,log0,range, andgainarrays.flowio._preprocessingas the shared wrapper:FlowData.as_array()now routes through_apply_preprocessing()so preprocessing logic is centralized and reusable.Behavior preserved
decades > 0:pow(10.0, decades[col] * value / range[col]) * log0[col]gain != 1.0andgain != 0.0decades == 0channels keep their value except for gain correctionfloat64.as_array()andwrite_fcs()continue to use the same preprocessing path.Packaging / install behavior
pyproject.tomlbuild backend.setup.pyfor extension configuration without requiring users to hand-write one.Reproducibility scope
-ffp-contract=off,-fno-fast-math, and-mno-fmaon x86/x86_64/fp:strictpow()results across every OS, libm, compiler, or architecture.Tests / utilities