Skip to content

refactor: split LpBounding into shaving and primal-heuristics files#953

Merged
rasros merged 1 commit into
mainfrom
refactor/lp-bounding-split
Jul 3, 2026
Merged

refactor: split LpBounding into shaving and primal-heuristics files#953
rasros merged 1 commit into
mainfrom
refactor/lp-bounding-split

Conversation

@rasros

@rasros rasros commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What changed

Carve two cohesive clusters out of LpBounding.kt (the largest file in the codebase at ~1.2K lines) into their own files in the same package:

  • LpShaving.kt — root LP shaving and structural deductions: shaveObjectiveLb, shaveVariableBounds, redundantConstraints, impliedEqualities, rootInfeasible, rootRelaxationSize, and their private helpers/constants.
  • LpPrimalHeuristics.kt — the LP primal heuristics: lpRoundingProbe, lpFeasibilityPump, and their rounding/pump/perturbation helpers and constants.
  • LpBounding.kt keeps the per-node pruning, reduced-cost fixing, Farkas nogoods, and root-cut harvesting (its core), dropping from ~1229 to ~760 lines.

Two helpers used across the clusters (dualSimplex, pinToward) are widened from file-private to internal.

Why

LpBounding.kt had grown into a grab-bag of ~40 LpEngine extension functions spanning several distinct concerns. Grouping them by concern makes each navigable and gives shaving and the primal heuristics a clear home.

Testing

Pure relocation of top-level extension functions within the same package — no logic or signature changes beyond the two internal widenings, so callers are untouched and behavior is identical. Full check lintDocs green across JVM + native + wasm; no benchmark needed (identical code paths).

@rasros rasros merged commit 32a3b6b into main Jul 3, 2026
2 checks passed
@rasros rasros deleted the refactor/lp-bounding-split branch July 3, 2026 19:20
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.

1 participant