[BUG] CUOPT_MIP_PRESOLVE is declared in constants.h but is not a registered parameter
Nobody has claimed this yet.
- Dominant language
- Cuda
- Stars
- 1k
- Forks
- 233
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 95
Description
Describe the bug
CUOPT_MIP_PRESOLVE is declared in the public constants header but is not a real parameter:
cpp/include/cuopt/mathematical_optimization/constants.h:66:#define CUOPT_MIP_PRESOLVE "mip_presolve"
It is registered nowhere in cpp/src/math_optimization/solver_settings.cu and referenced nowhere else in the tree, so cuOptSetParameter(settings, CUOPT_MIP_PRESOLVE, ...) is rejected as an unknown parameter.
Comparing the two directions: all 109 distinct parameter names registered in solver_settings.cu are declared in constants.h, and CUOPT_MIP_PRESOLVE is the single declared name with no registration.
Steps/Code to reproduce bug
cuOptSolverSettings settings = NULL;
cuOptCreateSolverSettings(&settings);
cuOptSetParameter(settings, CUOPT_MIP_PRESOLVE, "1"); /* CUOPT_INVALID_ARGUMENT */
Expected behavior
Either register the parameter, or remove the constant. A public header should not advertise a parameter the solver rejects.
Additional context
This matters more than a stray macro because bindings are generated from this header rather than from a runtime list — the approach @mlubin confirmed in #1705. The Java bindings generate CuOptConstants.java from constants.h at build time, so CuOptConstants.CUOPT_MIP_PRESOLVE exists today and any caller using it gets a runtime error. The same would apply to any future Go, Rust, or C# binding generated the same way.
Note there is a separate, real mip_presolve-adjacent parameter set (CUOPT_MIP_PROBING, the CUOPT_MIP_HYPER_HEURISTIC_PRESOLVE_MAX_ROUNDS family), so the fix is not simply renaming — it needs someone who knows whether a mip_presolve toggle was intended.
Found while verifying #1705.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with cpp/include/cuopt/mathematical_optimization/constants.h and cpp/src/math_optimization/solver_settings.cu, then inspect the nearby mip-related parameters and reproduce the rejected cuOptSetParameter call. Determine whether CUOPT_MIP_PRESOLVE was intended to be registered or removed. Done means the public constants and registered parameters agree, and generated bindings no longer expose a rejected parameter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100