Skip to content

Align MPFR precision CLI naming and fix MPF complex ordering semantics#92

Merged
msoos merged 3 commits intosynthfrom
copilot/sub-pr-85
Mar 12, 2026
Merged

Align MPFR precision CLI naming and fix MPF complex ordering semantics#92
msoos merged 3 commits intosynthfrom
copilot/sub-pr-85

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

This PR addresses issues in the MPFR/MPFI integration path: the documented precision flag name did not match the implemented CLI surface, and MPFR-complex ordering used non-strict component-wise comparison, diverging from existing complex ordering semantics.

  • CLI surface consistency (--mpfrprecision)

    • Adds --mpfrprecision as the canonical option for MPFR/MPFI precision.
    • Keeps --mpfrprec as a compatibility alias.
    • Updates mode help text (--mode 6/7/8) to reference --mpfrprecision.
  • Complex ordering correctness (MPFR complex mode)

    • Updates FGenMPFComplex::larger_than() to strict lexicographic ordering:
      • compare real parts first
      • if equal, compare imaginary parts
    • Removes incorrect component-wise >= behavior that could misorder values.
bool larger_than(const CMSat::Field& a, const CMSat::Field& b) const final {
  const auto& ad = static_cast<const MPFComplex&>(a);
  const auto& bd = static_cast<const MPFComplex&>(b);
  const int real_cmp = mpfr_cmp(ad.real, bd.real);
  if (real_cmp != 0) return real_cmp > 0;
  return mpfr_cmp(ad.imag, bd.imag) > 0;
}

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: msoos <1334841+msoos@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Copilot AI changed the title [WIP] Add synthesis elements to Ganak with MPFI support Align MPFR precision CLI naming and fix MPF complex ordering semantics Mar 12, 2026
Copilot AI requested a review from msoos March 12, 2026 22:28
@msoos
Copy link
Copy Markdown
Collaborator

msoos commented Mar 12, 2026

@copilot Undo the change on src/main.cpp please.

Co-authored-by: msoos <1334841+msoos@users.noreply.github.com>
@msoos msoos marked this pull request as ready for review March 12, 2026 22:33
@msoos msoos merged commit 3ed5db6 into synth Mar 12, 2026
@msoos msoos deleted the copilot/sub-pr-85 branch March 12, 2026 22:33
Copilot stopped work on behalf of msoos due to an error March 12, 2026 22:33
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.

2 participants