@@ -757,7 +757,7 @@ bool PDLPSolver::runConvergenceCheckAndRestart(size_t iter,
757757
758758 if (params_.use_halpern_restart ) {
759759 if (params_.step_size_strategy == StepSizeStrategy::PID) {
760- updatePrimalWeightAtRestart (current_results);
760+ updatePrimalWeightAtRestart (current_results);
761761 }
762762#ifdef CUPDLP_GPU
763763 if (d_pdhg_primal_ != nullptr ) {
@@ -1700,6 +1700,9 @@ void PrimalDualParams::initialise() {
17001700 this ->ruiz_iterations = 10 ;
17011701 this ->ruiz_norm = INFINITY;
17021702 this ->pc_alpha = 1.0 ;
1703+ this ->k_p = 0.99 ;
1704+ this ->k_i = 0.01 ;
1705+ this ->k_d = 0.0 ;
17031706 this ->step_size_strategy = StepSizeStrategy::FIXED;
17041707 this ->malitsky_pock_params .initialise ();
17051708 this ->adaptive_linesearch_params .initialise ();
@@ -1795,14 +1798,15 @@ void PDLPSolver::updatePrimalWeightAtRestart(const SolverResults& results) {
17951798 dual_dist = std::sqrt (dual_dist);
17961799#endif
17971800
1798- // Compute residual ratio
1799- double ratio = results.dual_feasibility / (results.primal_feasibility + 1e-30 );
1801+ double rel_primal = results.primal_feasibility / (1.0 + unscaled_rhs_norm_);
1802+ double rel_dual = results.dual_feasibility / (1.0 + unscaled_c_norm_);
1803+ double ratio_infeas = (rel_primal > 0.0 ) ? (rel_dual / rel_primal) : 1e300 ;
18001804
1801- const bool silent = true ;
1805+ const bool silent = false ;
18021806 // cuPDLPx-style weight update (PID control)
18031807 if (primal_dist > 1e-16 && dual_dist > 1e-16 &&
18041808 primal_dist < 1e12 && dual_dist < 1e12 &&
1805- ratio > 1e-8 && ratio < 1e8 ) {
1809+ ratio_infeas > 1e-8 && ratio_infeas < 1e8 ) {
18061810
18071811 double error = std::log (dual_dist) - std::log (primal_dist) - std::log (primal_weight_);
18081812
@@ -1829,7 +1833,7 @@ void PDLPSolver::updatePrimalWeightAtRestart(const SolverResults& results) {
18291833 }
18301834
18311835 // Track best weight
1832- double gap = std::abs (std::log10 (results. dual_feasibility / (results. primal_feasibility + 1e-30 ))) ;
1836+ double gap = (rel_primal > 0.0 && rel_dual > 0.0 ) ? std::abs (std::log10 (rel_dual / rel_primal)) : best_primal_dual_residual_gap_ ;
18331837 if (gap < best_primal_dual_residual_gap_) {
18341838 best_primal_dual_residual_gap_ = gap;
18351839 best_primal_weight_ = primal_weight_;
0 commit comments