Skip to content

[Review only] Align datasets to a common origin - #362

Draft
tjlane wants to merge 7 commits into
rs-station:codex/phase-alignment-04-reindex-hardeningfrom
tjlane:codex/phase-alignment
Draft

[Review only] Align datasets to a common origin#362
tjlane wants to merge 7 commits into
rs-station:codex/phase-alignment-04-reindex-hardeningfrom
tjlane:codex/phase-alignment

Conversation

@tjlane

@tjlane tjlane commented Aug 24, 2026

Copy link
Copy Markdown
Member

! This PR was vibe-coded.

Important

This is a review-only aggregate view of the existing stacked PRs. It adds no new commits and should not be merged directly. The smaller PRs remain the merge path.

Stack context

This draft collects the common-origin layers of #31 in one diff:

It is based on the completed reindexing branch (#351#354), because align_phases() must attempt correlation-based reindexing before origin alignment whenever the dataset permits it. The origin-ambiguity predicate itself is introduced in the shared foundation PR #351.

What this implements

  • determines and searches only symmetry-allowed origin translations
  • represents continuous polar freedom with an exact integer basis and quotients trivial centering translations
  • evaluates each discrete origin coset with an intrinsic-dimensional FFT
  • switches to a bounded-memory slab search for large grids and refines the strongest sampled maxima
  • matches phases by HKL, supports amplitude/FOM or uniform weighting, and transforms phase and complex columns on a copied DataSet
  • automatically reindexes before origin alignment when permitted; hand inversion remains opt-in
  • reports Phenix-sign origin shifts, candidate correlations, runner-up scores, and correlation gaps
  • warns for weak correlations and rejects low or non-unique solutions

Reviewer focus

  • derivation of the symmetry-allowed cosets and centering equivalence
  • Fourier sign, integer polar basis, periodic maxima, and the bounded-memory top-K policy
  • Phenix sign convention and preservation of row order/MTZ dtypes
  • default amplitude-product weighting, FOM validation, and opt-in hand inversion
  • interaction between automatic reindexing and origin alignment
  • empirical warning/error thresholds and the no-clear-solution gates

Please leave line-level review on the constituent PR where possible; this draft is intended to make the complete common-origin story easy to inspect in one place.

Related: #31, #174

@tjlane tjlane changed the title [Review view] Symmetry-aware common-origin alignment [Review only] Align datasets to a common origin Aug 24, 2026
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