Skip to content

Fix 4 bugs in MPFI/Arjun synthesis PR#89

Merged
msoos merged 4 commits intosynthfrom
copilot/sub-pr-85
Mar 11, 2026
Merged

Fix 4 bugs in MPFI/Arjun synthesis PR#89
msoos merged 4 commits intosynthfrom
copilot/sub-pr-85

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

Bugs found during review of the Ganak + synthesis Arjun + MPFI PR.

  • comp_cache.hpp: Debug log called num_direct_children(id) after set_first_descendant(0), always printing 0. Reordered to log before clearing.
  • main.cpp help text: Mode 8 missing (see --mpfrprec) that modes 6 and 7 have.
  • main.cpp mode 8 output: Missing null assertion after dynamic_cast<const FMpfi*>.
  • main.cpp compute_collision_prob: Called mpfr_init2(result, 256) on output param internally instead of caller — non-standard MPFR convention that risks double-init leaks. Moved init to caller, changed param from mpfr_t& to mpfr_t.
// Before: function both allocates and computes — caller can't safely pre-init
void compute_collision_prob(mpfr_t& result, ...) {
    mpfr_init2(result, 256);  // hidden allocation
    ...
}

// After: standard MPFR convention — caller owns lifecycle
void compute_collision_prob(mpfr_t result, ...) { ... }
// caller:
mpfr_t collision_prob;
mpfr_init2(collision_prob, 256);
compute_collision_prob(collision_prob, ...);
mpfr_clear(collision_prob);

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

Copilot AI and others added 3 commits March 11, 2026 21:42
Co-authored-by: msoos <1334841+msoos@users.noreply.github.com>
Co-authored-by: msoos <1334841+msoos@users.noreply.github.com>
Co-authored-by: msoos <1334841+msoos@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Ganak with synthesis Arjun and MPFI idea Fix 4 bugs in MPFI/Arjun synthesis PR Mar 11, 2026
@msoos
Copy link
Copy Markdown
Collaborator

msoos commented Mar 11, 2026

Checking of the dynamic_cast for nullptr is not needed. Remove that. The rest is OK.

@msoos msoos marked this pull request as ready for review March 11, 2026 22:29
@msoos msoos merged commit aa3de62 into synth Mar 11, 2026
@msoos msoos deleted the copilot/sub-pr-85 branch March 11, 2026 22:29
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