Read the image and transport first, then the spatial kernels, ISP, fixed-point paths and independent oracle. Finish with streaming and the experiment scripts. Run CTest while tracing the examples in the numerical verification report.
| Module | Responsibility and contract | Implementation and tests | Limits |
|---|---|---|---|
| Image and transport | Image owns row-major interleaved Float64 with one or three channels. Index(y,x,c) is (y × width + x) × channels + c. Python sends little-endian samples and the runner dispatches on operation. |
Image, Kernel.run, Run, integration and invalid input cases in verify.py | Little-endian host, caller-owned geometry and distinct output storage in native filter APIs. |
| Correlation and border extension | Correlate computes the row-major tap sum against centered kernel offsets. The tap orientation is unchanged. BorderIndex returns −1 for zero extension, clamps for replicate, and folds a period of twice the length for endpoint-repeating reflect. |
Filters, analytic and OpenCV cases in verify.py | Odd bounded kernel support. Native buffer access assumes valid indices and dimensions. |
| Gaussian, median and detail | Gaussian normalizes a 1D discrete Gaussian. The direct path takes its outer product. The separable path filters horizontal then vertical with a full-frame temporary. Median selects the middle neighbor. Sobel and Laplacian use signed taps and unsharp adds a scaled high-pass residual. |
Gaussian, Outer and Median, operation dispatch, OpenCV comparisons | Direct and separable floating sums can differ by rounding. Detail enhancement can amplify noise and clip. |
| Bayer and color stages | BayerChannel maps coordinate parity in a validated pattern. Demosaic preserves the sampled channel and either picks the first nearest valid sample or averages equidistant neighbors. WhiteBalance uses per-channel means or maxima and clamps gained samples. ColorMatrix applies a linear three-channel transform. |
ISP kernels, sensor and pipeline, Bayer, AWB and matrix cases in verify.py and phase2_verify.py | Requires enough Bayer samples in both dimensions. Gray World assumes a neutral mean and can overcorrect color-dominant inputs. |
| Gamma and transfer | The C++ direct path computes x^g on clamped input. The LUT chooses the nearest tabulated code. Python linearize and srgb use the piecewise inverse and forward transfers. Domain conversions for measurements are explicit. |
Gamma dispatch, transfer functions, matched-domain audit, transfer tests | Generic power and sRGB differ, especially near black. Codec output is quantized separately. |
| Baseline fixed arithmetic | PrepareFixed quantizes unsigned samples and signed coefficients. FixedCorrelate multiplies exactly in int64, clamps after each add, rescales via RoundScale, then clamps the unsigned output. Diagnostics distinguish accumulator and output clips. |
Fixed primitives, baseline Python oracle, scalar tests, integer regression | Low-level API expects validated and prepared arrays. Configuration has no independent product clip. |
| Fixed study golden model | FixedStudy binds input geometry. StudyFormat sets code widths, fractional precision and clamp/rescale policies. The golden mapped path multiplies, clamps the product, adds and clamps the accumulator as selected, rescales and clips the output. |
Formats and stats, Process and Run, width, rounding and ordering tests, equal-count geometry regression | Unsigned image inputs and outputs. Signed intermediates and coefficients are represented in int64. |
| Optimized fixed paths | Interior dispatch omits border mapping where all taps are valid. Proof dispatch removes clamp operations only if signed product and prefix ranges fit. Silent keeps the same arithmetic with diagnostic recording disabled. | FixedStudy::Process and Run, all variants and borders, timed regression | Silent zero-valued diagnostic fields are placeholders. When a range proof fails, the saturation path still runs. |
| Independent integer check | Python oracle rebuilds codes, border mappings, product saturation and accumulation using unbounded integers and independent magnitude-based rescaling. It compares outputs and counters over randomized and adversarial fixtures. |
the numerical study oracle, benchmark and precision harness, regression | Agreements are scoped to tested configurations and the software contract. |
| Streaming | StreamCorrelate pulls scalar grayscale samples in row-major order into a circular line buffer. A rotating column window preserves multiply/add order, mapped edges and output order. |
Streaming source, small geometries and three borders, full-scale agreement | Float64 grayscale. The runner buffers complete frames. No integer streaming or hardware timing model. |
To reproduce an end-to-end case, follow Kernel.run into Run, identify its numeric domain at every call, then read the corresponding independent expectation in the test before inspecting the result file.