summaryrefslogtreecommitdiff
path: root/crates/gipfel-core/tests
AgeCommit message (Collapse)Author
4 dayscore: review cleanup - drop the brute-force parts of the fit huntJohannes Hofmann
With the real issue identified (panorama geometry fitted rectinearly: provably unsatisfiable marker sets) the pieces added while chasing it were re-evaluated against a 543-placement sweep of VALID geometries (straddle + same-side pairs, north crossings, pitch/roll spread, marker noise, cylindrical wide pairs): - center seeds: the six-way full-circle spread is unnecessary; the placement roulette it was built against was the degenerate cost ties (fixed by the validity filter) and the panorama phantom. A single derived center seed passes all 543 valid placements. The principled scale (linear + tangent-aware) and pitch seeds stay: 4 fits total. - final domain guard: redundant. The validity filter already enforces the same condition before a candidate can be chosen; the fallback path is caught by the RMS guard with a better message. - the sweep itself is promoted to tests/fit_sweep.rs as the permanent regression net for the seed/validity logic. Kept (each fixes a real, independent bug): repaint + refit on projection switch, validity-filtered candidate selection, marker order check, same-side feasibility pre-check with panorama hint, RMS guard, fit session logging (the instrument that found the issue). 43 core + 13 golden + 543-placement sweep green, clippy clean.
8 dayscore: fix fit for wide panoramas (markers >180 deg apart in image)Johannes Hofmann
The initial guess in comp_params assumed the two markers are less than 180 deg apart: a_center started on the first marker and the scale came from the shortest-arc azimuth difference. In panoramas wider than 180 deg the markers can straddle the seam - e.g. at -170 deg and +170 deg of the view center they are 340 deg apart in the image but only 20 deg on the compass. The start was then off by up to 170 deg in azimuth and a factor of 17 in scale, and the fit never recovered. Fix: derive the image-space azimuth difference from the SIGN OF THE PIXEL DIFFERENCE (the user's marker placement tells us which branch was meant; the magnitude is unique modulo 2pi for panoramas below 360 deg), and start the view center between the markers in that branch. The golden fit tests now compare a_center modulo 2pi: the C harness settles wherever its >2pi input azimuths put it (380 deg), the Rust port normalizes (20 deg) - same physical solution. Tests: fits with markers 340 deg apart, 350 deg apart in reversed marker order, and 200 deg apart (just over the seam). All three fail without the fix (verified), pass with it.
2026-10-26Replace the C++ implementation with the Rust portJohannes Hofmann
The Rust port (formerly gipfel-rs) is now the official successor to the FLTK/GSL C++ code base. This squashes the port into a single commit and removes the C++ sources (they remain in the git history below). Layout: crates/gipfel-core headless core: hills, panorama geometry, projections (maxima-generated derivatives), pure-Rust LM fit, gipfel: JPEG comment + EXIF I/O, profiles, stitching crates/gipfel-cli command-line tools (export, info, stitch, profiles) crates/gipfel-app Cosmic DE (libcosmic) GUI, binary name `gipfel` codegen/ maxima scripts + regen.sh for the projection code tests/ golden files + C++ reference harnesses (historical) The original README is kept for now; it will be updated to describe the Rust build. gipfel.dat, AUTHORS, ChangeLog and NEWS are unchanged.