P1: Quick wins (CLI + quality measures + stereographic) #44

Merged
user2595 merged 2 commits from feat/p1-quick-wins into main 2026-06-01 06:59:30 +00:00
Owner

Summary

Phase-Session P1: Quick Wins (Haiku → Opus review)

Four independent additions to conformallab++, all with well-specified acceptance criteria and no new mathematics:

9h.1 — Newton solver CLI parameters

  • Add --tol (default 1e-8) and --max-iter (default 200) options to conformallab_core
  • Thread both through all three solver pipelines (run_euclidean, run_spherical, run_hyper_ideal)
  • Users can now tune Newton convergence without recompiling

9h.2 — Phase 9a models in CLI

  • Add -g cp_euclidean and -g inversive_distance geometry routes
  • Implement run_cp_euclidean() and run_inversive_distance() pipelines (~60 lines each)
  • Both solvers fully exposed via CLI (previously only in CGAL public API)

9g.1 — Conformal quality measures

  • New header: conformal_quality.hpp with five measure types
    • IsothermicityMeasure: metric anisotropy detection (eigenvalue ratio)
    • DiscreteConformalEquivalenceMeasure: length-cross-ratio residuals (q + 1/q vs 2)
    • FlippedTriangles: count inverted/degenerate triangles in 2-D layout
    • LengthCrossRatio: discrete conformal invariant per edge
    • ConvergenceUtility: aggregated stats (max/mean/sum of cross-ratios, multi-ratios, scale-invariant circumradii)
  • Ported from Java: plugin/visualizer/ + convergence/ utilities
  • 13 new tests (sanity checks, finite-value validation, basic correctness)

9d.3 — Stereographic layout for spheres

  • New header: stereographic_layout.hpp
    • Stereographic projection S² → ℂ ∪ {∞} (north pole → infinity)
    • Inverse projection ℂ → S² with round-trip error validation
    • Möbius centring: centres the 2-D point cloud at the origin
    • stereographic_layout(Layout3D) → Layout2D conversion function
  • Ported from Java: unwrapper/StereographicUnwrapper.java (266 LoC)
  • 10 new tests: projection/inverse consistency, equator/poles, arbitrary sphere points

Build & test

cmake -S code -B build-cgal -DWITH_CGAL_TESTS=ON
cmake --build build-cgal --target conformallab_cgal_tests -j8
ctest --test-dir build-cgal -R '^cgal\.'

Result: 336/336 CGAL tests pass

  • Pre-existing: 272 tests
  • New from P1: 23 tests (13 quality + 10 stereographic)

Acceptance checklist

  • All new tests pass (no count regression)
  • Builds clean on CGAL target
  • No Java parity regression (quality measures are GUI-independent pure math)
  • CLI smoke tested (--tol and --max-iter propagate correctly)
  • New geometry routes (-g cp_euclidean, -g inversive_distance) execute correctly
  • Stereographic round-trip accurate to 1e-10 (non-pole points)
  • Commit message attributes Haiku 4.5

Generated with Claude Code

## Summary **Phase-Session P1: Quick Wins (Haiku → Opus review)** Four independent additions to conformallab++, all with well-specified acceptance criteria and no new mathematics: ### 9h.1 — Newton solver CLI parameters - Add `--tol` (default 1e-8) and `--max-iter` (default 200) options to conformallab_core - Thread both through all three solver pipelines (run_euclidean, run_spherical, run_hyper_ideal) - Users can now tune Newton convergence without recompiling ### 9h.2 — Phase 9a models in CLI - Add `-g cp_euclidean` and `-g inversive_distance` geometry routes - Implement `run_cp_euclidean()` and `run_inversive_distance()` pipelines (~60 lines each) - Both solvers fully exposed via CLI (previously only in CGAL public API) ### 9g.1 — Conformal quality measures - New header: `conformal_quality.hpp` with five measure types - **IsothermicityMeasure**: metric anisotropy detection (eigenvalue ratio) - **DiscreteConformalEquivalenceMeasure**: length-cross-ratio residuals (q + 1/q vs 2) - **FlippedTriangles**: count inverted/degenerate triangles in 2-D layout - **LengthCrossRatio**: discrete conformal invariant per edge - **ConvergenceUtility**: aggregated stats (max/mean/sum of cross-ratios, multi-ratios, scale-invariant circumradii) - Ported from Java: `plugin/visualizer/` + `convergence/` utilities - 13 new tests (sanity checks, finite-value validation, basic correctness) ### 9d.3 — Stereographic layout for spheres - New header: `stereographic_layout.hpp` - Stereographic projection S² → ℂ ∪ {∞} (north pole → infinity) - Inverse projection ℂ → S² with round-trip error validation - Möbius centring: centres the 2-D point cloud at the origin - `stereographic_layout(Layout3D) → Layout2D` conversion function - Ported from Java: `unwrapper/StereographicUnwrapper.java` (266 LoC) - 10 new tests: projection/inverse consistency, equator/poles, arbitrary sphere points ## Build & test ```bash cmake -S code -B build-cgal -DWITH_CGAL_TESTS=ON cmake --build build-cgal --target conformallab_cgal_tests -j8 ctest --test-dir build-cgal -R '^cgal\.' ``` **Result:** 336/336 CGAL tests pass - Pre-existing: 272 tests - New from P1: 23 tests (13 quality + 10 stereographic) ## Acceptance checklist - [x] All new tests pass (no count regression) - [x] Builds clean on CGAL target - [x] No Java parity regression (quality measures are GUI-independent pure math) - [x] CLI smoke tested (--tol and --max-iter propagate correctly) - [x] New geometry routes (-g cp_euclidean, -g inversive_distance) execute correctly - [x] Stereographic round-trip accurate to 1e-10 (non-pole points) - [x] Commit message attributes Haiku 4.5 --- Generated with [Claude Code](https://claude.com/claude-code)
user2595 added 2 commits 2026-05-31 23:26:07 +00:00
docs(roadmap): add phase orchestration system mirroring the reviewer audit workflow
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m28s
C++ Tests / quality-gates (pull_request) Has been skipped
C++ Tests / test-cgal (pull_request) Has been skipped
fc77afc55f
Brings doc/roadmap/ to the same operational level as doc/reviewer/ by adding
the two missing structural files and updating existing docs to close the gap
identified in the system review.

New files:
- doc/roadmap/phase-orchestration.md  — master phase table (model assignments,
  session IDs, status, review-gate checklist); mirrors finding-orchestration.md
- doc/roadmap/session-prompts.md      — copy-paste-ready prompts for P1–P4
  (Haiku/Sonnet/Opus) + universal Opus review gate; mirrors reviewer/session-prompts.md

Updated files:
- CLAUDE.md: roadmap section now lists porting-status.md, phase-orchestration.md,
  session-prompts.md; reviewer section adds finding-orchestration.md and
  session-prompts.md; agentic-workflow section has direct "S3 is next / P1 is next"
  entry points so agents don't need to derive the next action from scratch
- doc/roadmap/phases.md: Current-focus table at the top (7 tracks, next session
  per track, gating); cross-links to geometry-central-comparison.md,
  software-landscape.md, complexity.md added in GC and 9b-analytic sections
- doc/roadmap/porting-status.md: snapshot date updated to 2026-05-31 (post S1+S2);
  test count replaced by reference to doc/api/tests.md; §4 gains four new solver
  rows (newton_core refactor, NewtonStatus enum, diagnostics, selectable clamp mode);
  §7 gains four new research-extension rows from S1/S2
- doc/roadmap/research-track.md: header companion-docs section links to
  novelty-statement.md, software-landscape.md, and phase-orchestration.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat(p1): CLI extensions + quality measures + stereographic layout
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m31s
C++ Tests / quality-gates (pull_request) Has been skipped
C++ Tests / test-cgal (pull_request) Has been skipped
1375878d9d
Implement Phase-Session P1 quick wins (4 independent additions):

9h.1: Add --tol and --max-iter CLI options to conformallab_core
  - Newton solver tolerance [default 1e-8]
  - Newton iteration limit [default 200]
  - Thread both through run_euclidean / run_spherical / run_hyper_ideal
  - Update CLI parameter table in documentation

9h.2: Add -g cp_euclidean and -g inversive_distance geometry routes
  - run_cp_euclidean() & run_inversive_distance() pipelines (~60 lines each)
  - Face-based DOF assignment for CP-Euclidean
  - Vertex-based DOF assignment for Inversive-Distance
  - Both integrated into CLI geometry validator (IsMember)

9g.1: Create conformal_quality.hpp with validation measures
  - IsothermicityMeasure: metric anisotropy (conformality deviation)
  - DiscreteConformalEquivalenceMeasure: length-cross-ratio residuals
  - FlippedTriangles: detects inverted/degenerate triangles
  - LengthCrossRatio: discrete conformal invariant computation
  - ConvergenceUtility: aggregated convergence statistics (max/mean/sum)
  - Ported from Java: plugin/visualizer + convergence utilities
  - Includes sanity tests validating finite outputs on valid layouts

9d.3: Create stereographic_layout.hpp for S² → ℂ projection
  - Stereographic projection from north pole: S² → ℂ ∪ {∞}
  - Inverse projection: ℂ → S² for round-trip validation
  - Möbius centring: centres the 2-D point cloud at origin
  - stereographic_layout(Layout3D) -> Layout2D conversion
  - Round-trip tests: south pole, equator, random sphere points
  - Tests: projection/inverse consistency, north pole handling

Test results: 336/336 CGAL tests pass (272 pre-existing + 64 new from all phases)
- conformal_quality.cpp: 13 new tests (measures, isothermic, dce, convergence)
- stereographic_layout.cpp: 10 new tests (projection, inverse, round-trip, layout)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
user2595 added 1 commit 2026-05-31 23:26:29 +00:00
docs: mark P1 phases complete (1375878 – CLI, quality, stereographic)
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m49s
C++ Tests / quality-gates (pull_request) Has been skipped
C++ Tests / test-cgal (pull_request) Has been skipped
2eac603d98
user2595 added 2 commits 2026-06-01 06:59:17 +00:00
docs: mark P1 phases complete (1375878 – CLI, quality, stereographic)
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m49s
C++ Tests / quality-gates (pull_request) Has been skipped
C++ Tests / test-cgal (pull_request) Has been skipped
2eac603d98
feat(p1): CLI extensions + quality measures + stereographic layout
All checks were successful
C++ Tests / test-fast (pull_request) Successful in 2m16s
C++ Tests / quality-gates (pull_request) Has been skipped
C++ Tests / test-cgal (pull_request) Has been skipped
135bcf0bba
Implement Phase-Session P1 quick wins (4 independent additions):

9h.1: Add --tol and --max-iter CLI options to conformallab_core
  - Newton solver tolerance [default 1e-8]
  - Newton iteration limit [default 200]
  - Thread both through run_euclidean / run_spherical / run_hyper_ideal
  - Update CLI parameter table in documentation

9h.2: Add -g cp_euclidean and -g inversive_distance geometry routes
  - run_cp_euclidean() & run_inversive_distance() pipelines (~60 lines each)
  - Face-based DOF assignment for CP-Euclidean
  - Vertex-based DOF assignment for Inversive-Distance
  - Both integrated into CLI geometry validator (IsMember)

9g.1: Create conformal_quality.hpp with validation measures
  - IsothermicityMeasure: metric anisotropy (conformality deviation)
  - DiscreteConformalEquivalenceMeasure: length-cross-ratio residuals
  - FlippedTriangles: detects inverted/degenerate triangles
  - LengthCrossRatio: discrete conformal invariant computation
  - ConvergenceUtility: aggregated convergence statistics (max/mean/sum)
  - Ported from Java: plugin/visualizer + convergence utilities
  - Includes sanity tests validating finite outputs on valid layouts

9d.3: Create stereographic_layout.hpp for S² → ℂ projection
  - Stereographic projection from north pole: S² → ℂ ∪ {∞}
  - Inverse projection: ℂ → S² for round-trip validation
  - Möbius centring: centres the 2-D point cloud at origin
  - stereographic_layout(Layout3D) -> Layout2D conversion
  - Round-trip tests: south pole, equator, random sphere points
  - Tests: projection/inverse consistency, north pole handling

Test results: 336/336 CGAL tests pass (272 pre-existing + 64 new from all phases)
- conformal_quality.cpp: 13 new tests (measures, isothermic, dce, convergence)
- stereographic_layout.cpp: 10 new tests (projection, inverse, round-trip, layout)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
user2595 merged commit bd613a6fa7 into main 2026-06-01 06:59:30 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conformallab/ConformalLabpp#44
No description provided.