Skip to content

Conversation

@Iroy30
Copy link
Member

@Iroy30 Iroy30 commented Jan 13, 2026

Description

Issue

Checklist

  • I am familiar with the Contributing Guidelines.
  • Testing
    • New or existing tests cover these changes
    • Added tests
    • Created an issue to follow-up
    • NA
  • Documentation
    • The documentation is up to date with these changes
    • Added new documentation
    • NA

Summary by CodeRabbit

  • Breaking Changes

    • Removed deprecated client parameter request_excess_timeout; client timeout now uses polling_timeout.
    • Deprecated tolerance parameters removed; several tolerance keys now appear at top-level instead of under a tolerances bucket.
    • Removed deprecated solver options solver_mode and heuristics_only; use pdlp_solver_mode and mip_heuristics_only.
  • Tests

    • Updated MILP test to use mip_heuristics_only.

✏️ Tip: You can customize this high-level summary in your review settings.

@Iroy30 Iroy30 requested a review from a team as a code owner January 13, 2026 21:14
@Iroy30 Iroy30 requested a review from tmckayus January 13, 2026 21:14
@copy-pr-bot
Copy link

copy-pr-bot bot commented Jan 13, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Iroy30 Iroy30 added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Jan 13, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

Removes deprecated parameters and fields: drops request_excess_timeout from the self-hosted client constructor, removes deprecated tolerance names from client/server handling, deletes deprecated fields from server data classes, and simplifies solver logic to use only current field names. (48 words)

Changes

Cohort / File(s) Summary
Self-Hosted Client Deprecation Removal
python/cuopt_self_hosted/cuopt_sh_client/cuopt_self_host_client.py
Removed deprecated request_excess_timeout constructor parameter and simplified timeout assignment to use polling_timeout directly.
Thin Client Solver Settings
python/cuopt_self_hosted/cuopt_sh_client/thin_client_solver_settings.py
Removed several deprecated tolerance keys from the tolerance-facing list so those keys (if present) are emitted at the top level instead of under "tolerances".
Server Data Definition Deprecation Cleanup
python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py
Deleted deprecated tolerance fields from Tolerances (absolute_primal, absolute_dual, absolute_gap, relative_primal, relative_dual, relative_gap, primal_infeasible, dual_infeasible, integrality_tolerance, absolute_mip_gap, relative_mip_gap) and removed solver_mode and heuristics_only from SolverConfig.
Solver Logic Simplification
python/cuopt_server/cuopt_server/utils/linear_programming/solver.py
Removed handling and deprecation warnings for legacy solver/tolerance fields; now reads pdlp_solver_mode, *_tolerance fields, and mip_heuristics_only exclusively.
Tests
python/cuopt_server/cuopt_server/tests/test_lp.py
Updated MILP test to set heuristics via mip_heuristics_only instead of heuristics_only.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'remove deprecated params' is vague and generic, using non-descriptive terms that lack specificity about which deprecated parameters or which components are affected. Consider a more specific title like 'Remove deprecated tolerance and solver config parameters' or 'Clean up deprecated parameters from CuOptServiceSelfHostClient and data definitions'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5a2c6e and 1c8d6fa.

📒 Files selected for processing (1)
  • python/cuopt_server/cuopt_server/tests/test_lp.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • python/cuopt_server/cuopt_server/tests/test_lp.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
python/cuopt_self_hosted/cuopt_sh_client/cuopt_self_host_client.py (1)

297-311: Breaking API change: request_excess_timeout parameter removed from constructor.

Existing code that instantiates CuOptServiceSelfHostClient with request_excess_timeout=... will now raise a TypeError. Per coding guidelines, Python APIs should maintain backward compatibility with deprecation warnings before removal.

Consider accepting request_excess_timeout as a **kwargs parameter and emitting a DeprecationWarning if provided, or document this breaking change in release notes.

Suggested approach for backward compatibility
     def __init__(
         self,
         ip: str = "0.0.0.0",
         port: str = "5000",
         use_https: bool = False,
         self_signed_cert="",
         polling_interval=1,
         only_validate=False,
         polling_timeout=600,
         timeout_exception=True,
         result_type=mime_type.MSGPACK,
         http_general_timeout=30,
         data_send_timeout=-1,
         result_receive_timeout=-1,
+        **kwargs,
     ):
+        if "request_excess_timeout" in kwargs:
+            import warnings
+            warnings.warn(
+                "request_excess_timeout is deprecated and ignored. "
+                "Use polling_timeout instead.",
+                DeprecationWarning,
+                stacklevel=2
+            )
         self.timeout_exception = timeout_exception
python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py (1)

18-20: Extra.forbid configuration causes hard failures for deprecated fields.

With extra = Extra.forbid, any request containing the removed field names (e.g., solver_mode, heuristics_only, absolute_primal, etc.) will receive a 422 Unprocessable Entity error. This is a breaking change for clients still using deprecated field names.

Per coding guidelines, consider temporarily changing to Extra.ignore with logged warnings for unknown fields, or use Pydantic validators to accept and warn on deprecated field names before full removal.

python/cuopt_self_hosted/cuopt_sh_client/thin_client_solver_settings.py (1)

156-170: Old tolerance parameter names silently break clients without deprecation warning.

Users passing old names (e.g., absolute_primal, relative_gap, integrality_tolerance) to set_parameter() will have these values placed at the top level of the solver config instead of inside the "tolerances" sub-dictionary. The server rejects these misplaced parameters due to strict validation (Extra.forbid), causing requests to fail. No deprecation warning is emitted by the thin client to alert users of this breaking change.

Per coding guidelines, implement deprecation warnings when old parameter names are detected, or provide transparent mapping to new names before full removal. The dep_warning() mechanism exists in the server codebase and should be replicated in the thin client.

🧹 Nitpick comments (1)
python/cuopt_server/cuopt_server/utils/linear_programming/solver.py (1)

64-68: Remove the unused dep_warning function.

The function defined at lines 64-68 is never called anywhere in the codebase and can be safely removed to reduce code clutter.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d1e7703 and cb1c639.

📒 Files selected for processing (4)
  • python/cuopt_self_hosted/cuopt_sh_client/cuopt_self_host_client.py
  • python/cuopt_self_hosted/cuopt_sh_client/thin_client_solver_settings.py
  • python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py
  • python/cuopt_server/cuopt_server/utils/linear_programming/solver.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{h,hpp,py}

📄 CodeRabbit inference engine (.github/.coderabbit_review_guide.md)

Verify C API does not break ABI stability (no struct layout changes, field reordering); maintain backward compatibility in Python and server APIs with deprecation warnings

Files:

  • python/cuopt_self_hosted/cuopt_sh_client/cuopt_self_host_client.py
  • python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py
  • python/cuopt_server/cuopt_server/utils/linear_programming/solver.py
  • python/cuopt_self_hosted/cuopt_sh_client/thin_client_solver_settings.py
🧠 Learnings (2)
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Applies to docs/**/*.{rst,md} : Document numerical tolerances, parameter ranges, and algorithm phase descriptions in API documentation when solver behavior or tolerances change

Applied to files:

  • python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py
  • python/cuopt_server/cuopt_server/utils/linear_programming/solver.py
  • python/cuopt_self_hosted/cuopt_sh_client/thin_client_solver_settings.py
📚 Learning: 2025-11-25T10:20:49.822Z
Learnt from: CR
Repo: NVIDIA/cuopt PR: 0
File: .github/.coderabbit_review_guide.md:0-0
Timestamp: 2025-11-25T10:20:49.822Z
Learning: Reduce tight coupling between solver components (presolve, simplex, basis, barrier); increase modularity and reusability of optimization algorithms

Applied to files:

  • python/cuopt_server/cuopt_server/utils/linear_programming/solver.py
🔇 Additional comments (7)
python/cuopt_self_hosted/cuopt_sh_client/thin_client_solver_settings.py (1)

151-182: LGTM on the toDict() method structure.

The logic for separating tolerance keys from non-tolerance keys and placing them in the appropriate locations is clear and correct.

python/cuopt_self_hosted/cuopt_sh_client/cuopt_self_host_client.py (1)

361-361: Simplified timeout assignment is correct.

The direct assignment self.timeout = polling_timeout is cleaner than the previous combined logic.

python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py (2)

322-374: Tolerances model now uses consistent *_tolerance naming.

The field naming is now consistent (e.g., absolute_primal_tolerance instead of absolute_primal). The model structure is clean and well-documented.


377-569: SolverConfig model is well-structured after deprecated field removal.

The remaining configuration options are properly typed and documented. The removal of solver_mode in favor of pdlp_solver_mode and heuristics_only in favor of mip_heuristics_only makes the naming more explicit.

python/cuopt_server/cuopt_server/utils/linear_programming/solver.py (3)

170-176: LGTM on pdlp_solver_mode handling.

The solver mode is now set directly from solver_config.pdlp_solver_mode without the deprecated solver_mode fallback logic.


222-288: LGTM on tolerance parameter handling.

The tolerance configuration now uses a single, consistent code path for each tolerance type with the *_tolerance naming convention.


295-298: LGTM on mip_heuristics_only handling.

The heuristics configuration now uses only the explicit mip_heuristics_only field.

@Iroy30
Copy link
Member Author

Iroy30 commented Jan 13, 2026

/ok to test cb1c639

@Iroy30
Copy link
Member Author

Iroy30 commented Jan 14, 2026

/ok to test c5a2c6e

@Iroy30
Copy link
Member Author

Iroy30 commented Jan 14, 2026

/ok to test 1c8d6fa

Copy link
Contributor

@tmckayus tmckayus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm as long as we have double-checked that it has been deprecated for 2 releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants