NVIDIA / NVIDIA/cuopt

[BUG] CUOPT_MIP_PRESOLVE is declared in constants.h but is not a registered parameter

Open
#1,728 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

awaiting response
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.