Skip to content

Remove unused -F, -O, -I and -R options - #375

Open
wegank wants to merge 1 commit into
algebraic-solving:masterfrom
wegank:remove-unused-options
Open

wegank wants to merge 1 commit into
algebraic-solving:masterfrom
wegank:remove-unused-options

Conversation

@wegank

@wegank wegank commented Oct 1, 2026

Copy link
Copy Markdown
Member

Fixes #301.

Summary

The -F, -O, -I/--isolate and -R options were added in early 2023 (adc7198, 5c1b905, 456ccf2) for an experimental mode that isolated real roots from precomputed parametrizations, read from binary (-F) or text files. That code path was removed from main() in 50b812e ("several bug fixes (seg faults) + code cleaning"), but the options stayed:

  • -F FILE only set files->bin_file, which nothing reads. It also left files->in_file as NULL, so get_data_from_file(NULL, ...) crashed. For example, msolve -F input_files/bug-68.ms exits with SIGSEGV.
  • -O, -I and -R were parsed into variables or fields that nothing used. -I was still listed in the help text.
  • Nothing ever wrote the binary parametrization format, so there was no way to produce a valid -F input.

This PR removes:

  • the four options: help text, the short and long option tables, and their getoptions handling, along with the unused refine and isolate variables;
  • the bin_file and bin_out_file fields of files_gb;
  • the parametrization readers in iofiles.c that had no callers (get_params_from_file_bin, get_params_from_file and their helpers).

Since -f is now the only way to give an input file, the input-file check in main() just opens files->in_file.

msolve -F ... now prints invalid option -- F and the usage text instead of crashing.

isolate_real_roots_lparam and display_arrays_of_real_roots in msolve.c are also unused now, but they have external linkage, so I left them for a separate decision.

Testing

  • make check: all 68 tests pass (macOS, LLVM clang).

AI disclosure

I investigated this issue and wrote the changes with the help of Claude Code (generative AI). I reviewed and tested them.

Co-authored-by: Claude Opus 5.5 noreply@anthropic.com

🤖 Generated with Claude Code

These options were introduced in early 2023 for an experimental mode
that isolated real roots from precomputed (binary) parametrizations.
That mode was removed from main() in 50b812e, but the options were kept.
As a result, -F only set files->bin_file, which is never read, and left
files->in_file NULL, so msolve segfaulted when reading the input file.
-O, -I and -R were parsed but likewise had no effect.

Drop these options, the bin_file and bin_out_file fields of files_gb,
and the parametrization readers in iofiles.c that no longer have any
callers.

Fixes algebraic-solving#301.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Miscellaneous usage of the -F option

1 participant