Skip to content

feat(analysis): add validated Gwyddion parity capabilities - #78

Merged
kegouro merged 83 commits into
mainfrom
feat/gwyddion-leveling-parity
Aug 3, 2026
Merged

feat(analysis): add validated Gwyddion parity capabilities#78
kegouro merged 83 commits into
mainfrom
feat/gwyddion-leveling-parity

Conversation

@kegouro

@kegouro kegouro commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

This pull request adds a validated Gwyddion-parity foundation for SPMKit,
covering leveling, background-estimation, morphology, compatibility auditing,
and frozen scientific evidence.

Implemented capabilities

  • Arc Revolution Background
  • Sphere Revolution Background
  • Flatten Base
  • Median Background
  • Flat-disc Opening and Closing
  • Path Level
  • Align Rows statistics:
    • Median
    • Median of differences
    • Trimmed mean
    • Trimmed mean of differences
  • GwyCompat source-audit foundation

Scientific methodology

Each completed parity capability follows a bounded evidence workflow:

  1. literature and mathematical reconstruction;
  2. inspection of the relevant Gwyddion 2.71 source;
  3. external execution against installed Gwyddion;
  4. independent oracle construction;
  5. frozen fixtures and provenance;
  6. private numerical implementation;
  7. public context-preserving API;
  8. focused and project-wide regression verification.

Evidence and production changes are preserved as separate atomic commits.

Align Rows numerical profiles

The production contract follows portable source semantics.

  • Portable profile:

    • 64/64 corrected arrays bitwise exact
    • 3888/3888 elements bitwise exact
    • requested backgrounds 8/8 arrays and 504/504 elements bitwise exact
  • Installed Gwyddion 2.71 fast-math profile:

    • 61/64 arrays bitwise exact
    • 3757/3888 elements bitwise exact
    • remaining differences are restricted to the frozen signed-zero cases and
      two independently explained GCC fast-math reassociation cases

SPMKit deliberately does not emulate compiler-specific fast-math behavior.

Verification

Final repository closure:

  • 1305 tests passed
  • 31 tests skipped
  • Ruff passed
  • Black passed
  • Mypy passed
  • wheel build passed
  • sdist build passed
  • isolated wheel installation/import passed
  • public import smoke passed
  • relative documentation links passed
  • frozen NPZ payload hashes unchanged
  • no unauthorized local paths or cache artifacts remain
  • no runtime dependency on Gwyddion, SciPy, frozen fixtures, subprocess probes,
    network access, or compiler-profile emulation was introduced

Compatibility

The historical generic align_rows(channel, method="median") contract remains
backward compatible for median and mean calls.

The four explicit gwyddion_align_rows_* functions are the bounded
cross-validated Gwyddion surfaces. The generic dispatcher is not claimed to be
universally Gwyddion-compatible.

Evidence scope and non-claims

Claims are limited to their documented finite frozen campaigns.

This pull request does not claim:

  • universal numerical equivalence;
  • non-finite input parity unless explicitly documented;
  • parity with every Gwyddion build or future version;
  • GUI or publication-workflow parity;
  • performance equivalence;
  • binary compatibility;
  • automatic translation of arbitrary Gwyddion modules.

Review guidance

The commit history should be reviewed by capability family:

  1. reconnaissance and frozen evidence;
  2. private numerical kernel;
  3. public API;
  4. documentation and scientific status;
  5. integration and hygiene closure.

Please preserve the atomic commit history. A merge commit is preferred over
squashing because the evidence-to-implementation chronology is part of the
scientific traceability.

kegouro added 30 commits July 31, 2026 01:03
kegouro added 25 commits August 1, 2026 22:07
@kegouro
kegouro marked this pull request as ready for review August 3, 2026 08:37
@kegouro
kegouro merged commit 03782cd into main Aug 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant