Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected 'Infeasible' Results with SCS 3.2.4 on QP Problems for MPC #275

Closed
kkzhang3 opened this issue Jun 25, 2024 · 21 comments
Closed

Comments

@kkzhang3
Copy link

kkzhang3 commented Jun 25, 2024

Hi,
I am using SCS 3.2.4 with Python 3.12 on a Windows 11 machine to solve Quadratic Programming (QP) problems for Model Predictive Control (MPC). Most of the optimization results are correct, and the speed is very impressive. However, I encountered three instances where the solver returned 'infeasible' results unexpectedly.

Details:
SCS Version: 3.2.4
Python Version: 3.12
Operating System: Windows 11

To verify the results, I also solved the same problems using CLARABEL and CVXOPT, both of which returned 'optimal' results. I have attached the three problems that resulted in 'infeasible' status with SCS for your reference.

QPerr.zip

I turned on the export file options and get the files:
data_and_logs.zip

Thanks
Regards,
KK Zhang

@bodono
Copy link
Member

bodono commented Jun 25, 2024

Thanks for posting this. For some reason when I run your python code I actually get 'solved' correctly form SCS (I tuned on verbose outputs from SCS to see what was happening):

=============SCS_DynamicLayer_20240625_124826_169446.pickle=============
------------------------------------------------------------------
	       SCS v3.2.4 - Splitting Conic Solver
	(c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 45, constraints m: 120
cones: 	  l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07
	  alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
	  max_iters: 100000, normalize: 1, rho_x: 1.00e-06
	  acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
	  nnz(A): 770, nnz(P): 571
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.27e+02  9.56e+04  2.61e+06 -1.92e+04  1.00e-01  5.62e-04
   125| 8.56e-07  7.87e-07  6.64e-10 -4.74e-01  2.60e-06  1.12e-03
------------------------------------------------------------------
status:  solved
timings: total: 1.36e-03s = setup: 4.88e-04s + solve: 8.76e-04s
	 lin-sys: 3.98e-04s, cones: 1.98e-05s, accel: 9.42e-06s
------------------------------------------------------------------
objective = -0.473958
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = -0.4739577941554467, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([2.79051355e-03, 2.51015653e-03, 2.28324465e-03, 2.06283283e-03,
       1.86450968e-03, 1.68458892e-03, 1.51852915e-03, 1.39307046e-03,
       1.25959954e-03, 6.36925603e-04, 2.20305700e-03, 2.55722225e-03,
       2.01489587e-03, 1.11603498e-03, 8.82347315e-13, 2.44155017e-13,
       2.44155052e-13, 2.44154819e-13, 2.44154573e-13, 2.44154880e-13,
       2.44154818e-13, 2.44154854e-13, 2.44154832e-13, 2.44154613e-13,
       2.43690456e-13, 2.42395011e-13, 2.39947370e-13, 2.32628320e-13,
       2.28770011e-13, 2.25283848e-13, 2.19736734e-13, 2.17522596e-13,
       2.15555946e-13, 2.13101029e-13, 2.12847980e-13, 2.12966041e-13,
       2.13656973e-13, 2.13847931e-13, 2.13606401e-13, 2.12391170e-13,
       2.11936694e-13, 2.11449525e-13, 2.09675861e-13, 2.08817582e-13,
       2.08428513e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.47395779415549794, clarabel_solution.status = Solved, clarabel_solution.x = [0.0027904978965449666, 0.002510198944930076, 0.0022831938027705117, 0.0020628662164093115, 0.0018645011729976001, 0.0016845818065795019, 0.001518539175488385, 0.0013930633137464905, 0.0012596049961827414, 0.0006369214890962764, 0.0022030588661007553, 0.0025572221591200366, 0.0020148959955852168, 0.0011160350187950417, 7.508467158983145e-12, 5.098200436696795e-11, 5.0919837101523314e-11, 5.086396393312051e-11, 5.076849130648014e-11, 5.0727771773585275e-11, 5.0691087613373826e-11, 5.06282096624894e-11, 5.060131621510247e-11, 5.057704866048211e-11, 5.069986578401336e-11, 5.116678636363365e-11, 5.302258154382985e-11, 5.873031052501555e-11, 6.015784957736915e-11, 6.028859646361538e-11, 5.858461187983256e-11, 5.749518217098852e-11, 5.6554606511962526e-11, 5.5554309438862856e-11, 5.550824040336608e-11, 5.5663838781453607e-11, 5.622236098014281e-11, 5.650877287399536e-11, 5.67251738200511e-11, 5.689231675566984e-11, 5.6871853878784136e-11, 5.681457007507406e-11, 5.6676452814081476e-11, 5.6626453715519324e-11, 5.659015006674711e-11]
=============SCS_DynamicLayer_20240625_124826_273466.pickle=============
------------------------------------------------------------------
	       SCS v3.2.4 - Splitting Conic Solver
	(c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 45, constraints m: 120
cones: 	  l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07
	  alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
	  max_iters: 100000, normalize: 1, rho_x: 1.00e-06
	  acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
	  nnz(A): 770, nnz(P): 571
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.27e+02  9.55e+04  2.61e+06 -1.87e+04  1.00e-01  4.21e-04
   125| 1.13e-06  5.85e-07  1.65e-10 -2.93e-02  1.67e-06  9.57e-04
------------------------------------------------------------------
status:  solved
timings: total: 9.61e-04s = setup: 3.57e-04s + solve: 6.05e-04s
	 lin-sys: 3.97e-04s, cones: 2.77e-05s, accel: 9.54e-06s
------------------------------------------------------------------
objective = -0.029337
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = -0.02933683070721473, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([6.94261027e-04, 6.24498710e-04, 5.68067204e-04, 5.13205792e-04,
       4.63877735e-04, 4.19117973e-04, 3.77790668e-04, 3.46590440e-04,
       3.13374278e-04, 1.58465232e-04, 5.48101854e-04, 6.36216877e-04,
       5.01290169e-04, 2.77660710e-04, 8.97944892e-13, 2.44076024e-13,
       2.44076057e-13, 2.44075891e-13, 2.44076235e-13, 2.44076090e-13,
       2.44076115e-13, 2.44076194e-13, 2.44076076e-13, 2.44076086e-13,
       2.43611958e-13, 2.42316618e-13, 2.39869035e-13, 2.32552681e-13,
       2.28695071e-13, 2.25209971e-13, 2.19664083e-13, 2.17450745e-13,
       2.15484662e-13, 2.13030405e-13, 2.12777627e-13, 2.12895381e-13,
       2.13586682e-13, 2.13777081e-13, 2.13535797e-13, 2.12320797e-13,
       2.11866598e-13, 2.11379410e-13, 2.09606049e-13, 2.08748222e-13,
       2.08359357e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.029336830707231296, clarabel_solution.status = Solved, clarabel_solution.x = [0.0006942523340928437, 0.0006245211531611647, 0.0005680402154852255, 0.0005132247970703782, 0.0004638732525990768, 0.00041911069714191607, 0.0003778005965243507, 0.0003465831910797031, 0.00031337981165299804, 0.00015846105492833785, 0.0005481037104770503, 0.0006362167512226497, 0.0005012902690682797, 0.00027766073090962665, 7.422584398118871e-12, 4.9908818125428526e-11, 4.989439411164203e-11, 4.988135885249981e-11, 4.985892511625296e-11, 4.9849294577522e-11, 4.9840585958786774e-11, 4.982558652410234e-11, 4.9819142820566604e-11, 4.981331356680122e-11, 4.996139585601154e-11, 5.043061010730071e-11, 5.2267431264695483e-11, 5.791302606624232e-11, 5.933302998604015e-11, 5.947440433414254e-11, 5.7813882893553324e-11, 5.674740148239301e-11, 5.582688709371417e-11, 5.485106791023405e-11, 5.481192913018784e-11, 5.497105449305245e-11, 5.55308513300546e-11, 5.5818938404726124e-11, 5.603741130163767e-11, 5.620771956517265e-11, 5.618918130039591e-11, 5.61345389366892e-11, 5.6001086068957654e-11, 5.595235055766623e-11, 5.5916314191366856e-11]
=============SCS_DynamicLayer_20240625_124826_366924.pickle=============
------------------------------------------------------------------
	       SCS v3.2.4 - Splitting Conic Solver
	(c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 45, constraints m: 120
cones: 	  l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07
	  alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
	  max_iters: 100000, normalize: 1, rho_x: 1.00e-06
	  acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
	  nnz(A): 770, nnz(P): 571
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.26e+02  9.55e+04  2.61e+06 -1.86e+04  1.00e-01  4.15e-04
   125| 1.18e-06  4.87e-07  1.03e-10 -2.22e-03  1.08e-06  9.46e-04
------------------------------------------------------------------
status:  solved
timings: total: 9.54e-04s = setup: 3.51e-04s + solve: 6.03e-04s
	 lin-sys: 4.00e-04s, cones: 1.99e-05s, accel: 9.37e-06s
------------------------------------------------------------------
objective = -0.002215
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = -0.002215217426750132, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([1.90769690e-04, 1.71594496e-04, 1.56110165e-04, 1.41011648e-04,
       1.27465265e-04, 1.15173374e-04, 1.03803298e-04, 9.52430020e-05,
       8.61068673e-05, 4.35357962e-05, 1.50626706e-04, 1.74800288e-04,
       1.37827614e-04, 7.63372245e-05, 9.03386108e-13, 2.44050817e-13,
       2.44050751e-13, 2.44050780e-13, 2.44050750e-13, 2.44050759e-13,
       2.44050816e-13, 2.44050761e-13, 2.44050817e-13, 2.44050791e-13,
       2.43586577e-13, 2.42291618e-13, 2.39844182e-13, 2.32528051e-13,
       2.28670874e-13, 2.25186067e-13, 2.19640423e-13, 2.17427416e-13,
       2.15461294e-13, 2.13007261e-13, 2.12754315e-13, 2.12872044e-13,
       2.13563177e-13, 2.13753984e-13, 2.13512252e-13, 2.12297703e-13,
       2.11843459e-13, 2.11356310e-13, 2.09583286e-13, 2.08725420e-13,
       2.08336267e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.0022152174267624503, clarabel_solution.status = Solved, clarabel_solution.x = [0.00019076221443803517, 0.00017161401041454087, 0.00015608744276640255, 0.00014102549607533437, 0.00012746475443084693, 0.00011516469875157536, 0.00010381329027656681, 9.523573477537405e-05, 8.611244900019338e-05, 4.353157804871756e-05, 0.0001506285695843726, 0.00017480015346372276, 0.0001378277079923815, 7.633724223309769e-05, 7.402155371667622e-12, 4.965827303819483e-11, 4.965437612207606e-11, 4.9650849634359917e-11, 4.9644769875527325e-11, 4.9642155753222594e-11, 4.963978972099507e-11, 4.963570972671434e-11, 4.9633955095898954e-11, 4.963236680374209e-11, 4.9786226003858936e-11, 5.025590754635561e-11, 5.2088158356424624e-11, 5.771888610298373e-11, 5.913705369744592e-11, 5.928091578082756e-11, 5.763067279392684e-11, 5.6569626886655146e-11, 5.565386489883837e-11, 5.4683841907138966e-11, 5.464633867216354e-11, 5.48062925637533e-11, 5.5366378165935806e-11, 5.5654855288171645e-11, 5.587381381126671e-11, 5.6044868611528313e-11, 5.602678592850865e-11, 5.5972769367126994e-11, 5.584042230149203e-11, 5.5791986607535523e-11, 5.575601417531867e-11]

@bodono
Copy link
Member

bodono commented Jun 25, 2024

Can you post the output of what you get when you run with verbose=True? It might be that something is compiled wrongly in your setup somehow.

@kkzhang3
Copy link
Author

Sure. These are the results.

scs.__version__ = '3.2.4'
clarabel.__version__ = '0.7.1'
=============SCS_DynamicLayer_20240625_124826_169446.pickle=============
------------------------------------------------------------------      
               SCS v3.2.4 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------      
problem:  variables n: 45, constraints m: 120
cones:    l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07       
          alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
          max_iters: 100000, normalize: 1, rho_x: 1.00e-06
          acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
          nnz(A): 770, nnz(P): 571
------------------------------------------------------------------      
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.27e+02  9.56e+04  2.61e+06 -1.92e+04  1.00e-01  1.50e-03
    25| 1.07e-05  1.73e+01  1.92e+01 -4.92e-01  1.00e-01  1.78e-03
------------------------------------------------------------------
status:  infeasible
timings: total: 1.90e-03s = setup: 9.41e-04s + solve: 9.60e-04s
         lin-sys: 1.26e-04s, cones: 9.50e-06s, accel: 1.40e-06s
------------------------------------------------------------------
objective = inf
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = inf, SCSsol['info']['status'] = 'infeasible', SCSsol['x'] = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.47395779415549794, clarabel_solution.status = Solved, clarabel_solution.x = [0.0027904978965449666, 0.002510198944930076, 0.0022831938027705117, 0.0020628662164093115, 0.0018645011729976001, 0.0016845818065795019, 0.001518539175488385, 0.0013930633137464905, 0.0012596049961827414, 0.0006369214890962764, 0.0022030588661007553, 0.0025572221591200366, 0.0020148959955852168, 0.0011160350187950417, 7.508467158983145e-12, 5.098200436696795e-11, 5.0919837101523314e-11, 5.086396393312051e-11, 5.076849130648014e-11, 
5.0727771773585275e-11, 5.0691087613373826e-11, 5.06282096624894e-11, 5.060131621510247e-11, 5.057704866048211e-11, 5.069986578401336e-11, 5.116678636363365e-11, 5.302258154382985e-11, 5.873031052501555e-11, 6.015784957736915e-11, 6.028859646361538e-11, 5.858461187983256e-11, 5.749518217098852e-11, 5.6554606511962526e-11, 5.5554309438862856e-11, 5.550824040336608e-11, 5.5663838781453607e-11, 5.622236098014281e-11, 5.650877287399536e-11, 5.67251738200511e-11, 5.689231675566984e-11, 5.6871853878784136e-11, 5.681457007507406e-11, 5.6676452814081476e-11, 5.6626453715519324e-11, 5.659015006674711e-11]
=============SCS_DynamicLayer_20240625_124826_273466.pickle=============
------------------------------------------------------------------
               SCS v3.2.4 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 45, constraints m: 120
cones:    l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07
          alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
          max_iters: 100000, normalize: 1, rho_x: 1.00e-06
          acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
          nnz(A): 770, nnz(P): 571
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.27e+02  9.55e+04  2.61e+06 -1.87e+04  1.00e-01  2.44e-03
    75| 1.59e-13  1.45e+00  2.50e-01 -2.95e-02  1.00e-01  2.98e-03
------------------------------------------------------------------
status:  infeasible
timings: total: 3.11e-03s = setup: 2.00e-03s + solve: 1.11e-03s
         lin-sys: 3.29e-04s, cones: 2.03e-05s, accel: 5.90e-06s
------------------------------------------------------------------
objective = inf
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = inf, SCSsol['info']['status'] = 'infeasible', SCSsol['x'] = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.029336830707231296, clarabel_solution.status = Solved, clarabel_solution.x = [0.0006942523340928437, 0.0006245211531611647, 0.0005680402154852255, 0.0005132247970703782, 0.0004638732525990768, 0.00041911069714191607, 0.0003778005965243507, 0.0003465831910797031, 0.00031337981165299804, 0.00015846105492833785, 0.0005481037104770503, 0.0006362167512226497, 0.0005012902690682797, 0.00027766073090962665, 7.422584398118871e-12, 4.9908818125428526e-11, 4.989439411164203e-11, 4.988135885249981e-11, 4.985892511625296e-11, 4.9849294577522e-11, 4.9840585958786774e-11, 4.982558652410234e-11, 4.9819142820566604e-11, 4.981331356680122e-11, 4.996139585601154e-11, 5.043061010730071e-11, 5.2267431264695483e-11, 5.791302606624232e-11, 5.933302998604015e-11, 5.947440433414254e-11, 5.7813882893553324e-11, 5.674740148239301e-11, 5.582688709371417e-11, 5.485106791023405e-11, 5.481192913018784e-11, 5.497105449305245e-11, 5.55308513300546e-11, 5.5818938404726124e-11, 5.603741130163767e-11, 5.620771956517265e-11, 5.618918130039591e-11, 5.61345389366892e-11, 5.6001086068957654e-11, 5.595235055766623e-11, 5.5916314191366856e-11]
=============SCS_DynamicLayer_20240625_124826_366924.pickle=============
------------------------------------------------------------------
               SCS v3.2.4 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 45, constraints m: 120
cones:    l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07
          alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
          max_iters: 100000, normalize: 1, rho_x: 1.00e-06
          acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
          nnz(A): 770, nnz(P): 571
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.26e+02  9.55e+04  2.61e+06 -1.86e+04  1.00e-01  2.09e-03
    50| 3.46e-13  4.37e+00  1.68e+00 -2.37e-03  1.00e-01  2.46e-03
------------------------------------------------------------------
status:  infeasible
timings: total: 2.57e-03s = setup: 1.69e-03s + solve: 8.78e-04s
         lin-sys: 2.05e-04s, cones: 1.33e-05s, accel: 3.60e-06s
------------------------------------------------------------------
objective = inf
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = inf, SCSsol['info']['status'] = 'infeasible', SCSsol['x'] = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.0022152174267624503, clarabel_solution.status = Solved, clarabel_solution.x = [0.00019076221443803517, 0.00017161401041454087, 0.00015608744276640255, 0.00014102549607533437, 0.00012746475443084693, 0.00011516469875157536, 0.00010381329027656681, 9.523573477537405e-05, 8.611244900019338e-05, 4.353157804871756e-05, 0.0001506285695843726, 0.00017480015346372276, 0.0001378277079923815, 7.633724223309769e-05, 7.402155371667622e-12, 4.965827303819483e-11, 4.965437612207606e-11, 4.9650849634359917e-11, 4.9644769875527325e-11, 4.9642155753222594e-11, 4.963978972099507e-11, 4.963570972671434e-11, 4.9633955095898954e-11, 4.963236680374209e-11, 4.9786226003858936e-11, 5.025590754635561e-11, 5.2088158356424624e-11, 5.771888610298373e-11, 5.913705369744592e-11, 5.928091578082756e-11, 5.763067279392684e-11, 5.6569626886655146e-11, 5.565386489883837e-11, 5.4683841907138966e-11, 5.464633867216354e-11, 5.48062925637533e-11, 5.5366378165935806e-11, 5.5654855288171645e-11, 5.587381381126671e-11, 5.6044868611528313e-11, 5.602678592850865e-11, 5.5972769367126994e-11, 5.584042230149203e-11, 5.5791986607535523e-11, 5.575601417531867e-11]

@bodono
Copy link
Member

bodono commented Jun 26, 2024

Thanks for posting this! I still have not been able to reproduce this but I think I have identified the problem, a very nasty bug in how I'm calling the Blas dlange method, for calculating the infinity norm. I'm amazed this didn't trigger a bug before!

If you are able to test please can you patch in this change: 8891c9c

And then retry? I can talk you through how to do this if you're having trouble.

@ymwang78
Copy link

build source from main branch (the change is not applied), seems no problem:

scs.version = '3.2.4'
clarabel.version = '0.9.0'
=============SCS_DynamicLayer_20240625_124826_169446.pickle=============
-----------SCS-----------
SCSsol['info']['pobj'] = -0.47395779415545064, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([2.79051286e-03, 2.51015842e-03, 2.28324254e-03, 2.06283394e-03,
1.86450946e-03, 1.68458889e-03, 1.51852915e-03, 1.39307048e-03,
1.25959953e-03, 6.36925612e-04, 2.20305700e-03, 2.55722225e-03,
2.01489587e-03, 1.11603498e-03, 8.84477770e-13, 2.44157244e-13,
2.44157344e-13, 2.44157046e-13, 2.44157365e-13, 2.44157298e-13,
2.44156987e-13, 2.44157257e-13, 2.44157240e-13, 2.44157125e-13,
2.43693110e-13, 2.42397618e-13, 2.39949448e-13, 2.32630732e-13,
2.28772681e-13, 2.25286026e-13, 2.19738649e-13, 2.17524842e-13,
2.15558016e-13, 2.13102962e-13, 2.12850018e-13, 2.12967835e-13,
2.13659155e-13, 2.13849878e-13, 2.13608392e-13, 2.12393270e-13,
2.11938506e-13, 2.11451457e-13, 2.09677605e-13, 2.08819459e-13,
2.08430287e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.47395779415549794, clarabel_solution.status = Solved, clarabel_solution.x = [0.0027904978965449666, 0.002510198944930076, 0.0022831938027705117, 0.0020628662164093115, 0.0018645011729976001, 0.0016845818065795019, 0.001518539175488385, 0.0013930633137464905, 0.0012596049961827414, 0.0006369214890962764, 0.0022030588661007553, 0.0025572221591200366, 0.0020148959955852168, 0.0011160350187950417, 7.508467158983145e-12, 5.098200436696795e-11, 5.0919837101523314e-11, 5.086396393312051e-11, 5.076849130648014e-11, 5.0727771773585275e-11, 5.0691087613373826e-11, 5.06282096624894e-11, 5.060131621510247e-11, 5.057704866048211e-11, 5.069986578401336e-11, 5.116678636363365e-11, 5.302258154382985e-11, 5.873031052501555e-11, 6.015784957736915e-11, 6.028859646361538e-11, 5.858461187983256e-11, 5.749518217098852e-11, 5.6554606511962526e-11, 5.5554309438862856e-11, 5.550824040336608e-11, 5.5663838781453607e-11, 5.622236098014281e-11, 5.650877287399536e-11, 5.67251738200511e-11, 5.689231675566984e-11, 5.6871853878784136e-11, 5.681457007507406e-11, 5.6676452814081476e-11, 5.6626453715519324e-11, 5.659015006674711e-11]
=============SCS_DynamicLayer_20240625_124826_273466.pickle=============
-----------SCS-----------
SCSsol['info']['pobj'] = -0.029336830707218327, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([6.94259936e-04, 6.24501827e-04, 5.68063419e-04, 5.13208238e-04,
4.63876894e-04, 4.19118079e-04, 3.77790690e-04, 3.46590442e-04,
3.13374274e-04, 1.58465238e-04, 5.48101857e-04, 6.36216882e-04,
5.01290173e-04, 2.77660712e-04, 8.99178393e-13, 2.44076312e-13,
2.44076201e-13, 2.44076130e-13, 2.44076233e-13, 2.44076309e-13,
2.44076333e-13, 2.44076175e-13, 2.44076303e-13, 2.44076117e-13,
2.43612146e-13, 2.42317150e-13, 2.39869209e-13, 2.32552922e-13,
2.28695235e-13, 2.25210428e-13, 2.19664045e-13, 2.17451237e-13,
2.15484886e-13, 2.13030754e-13, 2.12777663e-13, 2.12895197e-13,
2.13586552e-13, 2.13777236e-13, 2.13535904e-13, 2.12321086e-13,
2.11866553e-13, 2.11379857e-13, 2.09606355e-13, 2.08748669e-13,
2.08359173e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.029336830707231296, clarabel_solution.status = Solved, clarabel_solution.x = [0.0006942523340928437, 0.0006245211531611647, 0.0005680402154852255, 0.0005132247970703782, 0.0004638732525990768, 0.00041911069714191607, 0.0003778005965243507, 0.0003465831910797031, 0.00031337981165299804, 0.00015846105492833785, 0.0005481037104770503, 0.0006362167512226497, 0.0005012902690682797, 0.00027766073090962665, 7.422584398118871e-12, 4.9908818125428526e-11, 4.989439411164203e-11, 4.988135885249981e-11, 4.985892511625296e-11, 4.9849294577522e-11, 4.9840585958786774e-11, 4.982558652410234e-11, 4.9819142820566604e-11, 4.981331356680122e-11, 4.996139585601154e-11, 5.043061010730071e-11, 5.2267431264695483e-11, 5.791302606624232e-11, 5.933302998604015e-11, 5.947440433414254e-11, 5.7813882893553324e-11, 5.674740148239301e-11, 5.582688709371417e-11, 5.485106791023405e-11, 5.481192913018784e-11, 5.497105449305245e-11, 5.55308513300546e-11, 5.5818938404726124e-11, 5.603741130163767e-11, 5.620771956517265e-11, 5.618918130039591e-11, 5.61345389366892e-11, 5.6001086068957654e-11, 5.595235055766623e-11, 5.5916314191366856e-11]
=============SCS_DynamicLayer_20240625_124826_366924.pickle=============
-----------SCS-----------
SCSsol['info']['pobj'] = -0.002215217426752619, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([1.90768627e-04, 1.71597468e-04, 1.56107152e-04, 1.41012605e-04,
1.27465658e-04, 1.15173066e-04, 1.03803338e-04, 9.52429990e-05,
8.61068786e-05, 4.35357896e-05, 1.50626712e-04, 1.74800292e-04,
1.37827617e-04, 7.63372261e-05, 9.02991412e-13, 2.44051336e-13,
2.44051360e-13, 2.44051268e-13, 2.44051210e-13, 2.44051394e-13,
2.44051256e-13, 2.44051419e-13, 2.44051233e-13, 2.44051275e-13,
2.43587140e-13, 2.42292083e-13, 2.39844607e-13, 2.32528533e-13,
2.28671382e-13, 2.25186628e-13, 2.19641011e-13, 2.17428008e-13,
2.15461903e-13, 2.13008008e-13, 2.12755080e-13, 2.12872718e-13,
2.13563827e-13, 2.13754464e-13, 2.13512943e-13, 2.12298399e-13,
2.11844188e-13, 2.11356916e-13, 2.09583937e-13, 2.08726103e-13,
2.08336882e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.0022152174267624503, clarabel_solution.status = Solved, clarabel_solution.x = [0.00019076221443803517, 0.00017161401041454087, 0.00015608744276640255, 0.00014102549607533437, 0.00012746475443084693, 0.00011516469875157536, 0.00010381329027656681, 9.523573477537405e-05, 8.611244900019338e-05, 4.353157804871756e-05, 0.0001506285695843726, 0.00017480015346372276, 0.0001378277079923815, 7.633724223309769e-05, 7.402155371667622e-12, 4.965827303819483e-11, 4.965437612207606e-11, 4.9650849634359917e-11, 4.9644769875527325e-11, 4.9642155753222594e-11, 4.963978972099507e-11, 4.963570972671434e-11, 4.9633955095898954e-11, 4.963236680374209e-11, 4.9786226003858936e-11, 5.025590754635561e-11, 5.2088158356424624e-11, 5.771888610298373e-11, 5.913705369744592e-11, 5.928091578082756e-11, 5.763067279392684e-11, 5.6569626886655146e-11, 5.565386489883837e-11, 5.4683841907138966e-11, 5.464633867216354e-11, 5.48062925637533e-11, 5.5366378165935806e-11, 5.5654855288171645e-11, 5.587381381126671e-11, 5.6044868611528313e-11, 5.602678592850865e-11, 5.5972769367126994e-11, 5.584042230149203e-11, 5.5791986607535523e-11, 5.575601417531867e-11]

@ymwang78
Copy link

After applied the patch, got the same result:

scs.version = '3.2.4'
clarabel.version = '0.9.0'
=============SCS_DynamicLayer_20240625_124826_169446.pickle=============
-----------SCS-----------
SCSsol['info']['pobj'] = -0.47395779415545064, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([2.79051286e-03, 2.51015842e-03, 2.28324254e-03, 2.06283394e-03,
1.86450946e-03, 1.68458889e-03, 1.51852915e-03, 1.39307048e-03,
1.25959953e-03, 6.36925612e-04, 2.20305700e-03, 2.55722225e-03,
2.01489587e-03, 1.11603498e-03, 8.84477770e-13, 2.44157244e-13,
2.44157344e-13, 2.44157046e-13, 2.44157365e-13, 2.44157298e-13,
2.44156987e-13, 2.44157257e-13, 2.44157240e-13, 2.44157125e-13,
2.43693110e-13, 2.42397618e-13, 2.39949448e-13, 2.32630732e-13,
2.28772681e-13, 2.25286026e-13, 2.19738649e-13, 2.17524842e-13,
2.15558016e-13, 2.13102962e-13, 2.12850018e-13, 2.12967835e-13,
2.13659155e-13, 2.13849878e-13, 2.13608392e-13, 2.12393270e-13,
2.11938506e-13, 2.11451457e-13, 2.09677605e-13, 2.08819459e-13,
2.08430287e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.47395779415549794, clarabel_solution.status = Solved, clarabel_solution.x = [0.0027904978965449666, 0.002510198944930076, 0.0022831938027705117, 0.0020628662164093115, 0.0018645011729976001, 0.0016845818065795019, 0.001518539175488385, 0.0013930633137464905, 0.0012596049961827414, 0.0006369214890962764, 0.0022030588661007553, 0.0025572221591200366, 0.0020148959955852168, 0.0011160350187950417, 7.508467158983145e-12, 5.098200436696795e-11, 5.0919837101523314e-11, 5.086396393312051e-11, 5.076849130648014e-11, 5.0727771773585275e-11, 5.0691087613373826e-11, 5.06282096624894e-11, 5.060131621510247e-11, 5.057704866048211e-11, 5.069986578401336e-11, 5.116678636363365e-11, 5.302258154382985e-11, 5.873031052501555e-11, 6.015784957736915e-11, 6.028859646361538e-11, 5.858461187983256e-11, 5.749518217098852e-11, 5.6554606511962526e-11, 5.5554309438862856e-11, 5.550824040336608e-11, 5.5663838781453607e-11, 5.622236098014281e-11, 5.650877287399536e-11, 5.67251738200511e-11, 5.689231675566984e-11, 5.6871853878784136e-11, 5.681457007507406e-11, 5.6676452814081476e-11, 5.6626453715519324e-11, 5.659015006674711e-11]
=============SCS_DynamicLayer_20240625_124826_273466.pickle=============
-----------SCS-----------
SCSsol['info']['pobj'] = -0.029336830707218327, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([6.94259936e-04, 6.24501827e-04, 5.68063419e-04, 5.13208238e-04,
4.63876894e-04, 4.19118079e-04, 3.77790690e-04, 3.46590442e-04,
3.13374274e-04, 1.58465238e-04, 5.48101857e-04, 6.36216882e-04,
5.01290173e-04, 2.77660712e-04, 8.99178393e-13, 2.44076312e-13,
2.44076201e-13, 2.44076130e-13, 2.44076233e-13, 2.44076309e-13,
2.44076333e-13, 2.44076175e-13, 2.44076303e-13, 2.44076117e-13,
2.43612146e-13, 2.42317150e-13, 2.39869209e-13, 2.32552922e-13,
2.28695235e-13, 2.25210428e-13, 2.19664045e-13, 2.17451237e-13,
2.15484886e-13, 2.13030754e-13, 2.12777663e-13, 2.12895197e-13,
2.13586552e-13, 2.13777236e-13, 2.13535904e-13, 2.12321086e-13,
2.11866553e-13, 2.11379857e-13, 2.09606355e-13, 2.08748669e-13,
2.08359173e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.029336830707231296, clarabel_solution.status = Solved, clarabel_solution.x = [0.0006942523340928437, 0.0006245211531611647, 0.0005680402154852255, 0.0005132247970703782, 0.0004638732525990768, 0.00041911069714191607, 0.0003778005965243507, 0.0003465831910797031, 0.00031337981165299804, 0.00015846105492833785, 0.0005481037104770503, 0.0006362167512226497, 0.0005012902690682797, 0.00027766073090962665, 7.422584398118871e-12, 4.9908818125428526e-11, 4.989439411164203e-11, 4.988135885249981e-11, 4.985892511625296e-11, 4.9849294577522e-11, 4.9840585958786774e-11, 4.982558652410234e-11, 4.9819142820566604e-11, 4.981331356680122e-11, 4.996139585601154e-11, 5.043061010730071e-11, 5.2267431264695483e-11, 5.791302606624232e-11, 5.933302998604015e-11, 5.947440433414254e-11, 5.7813882893553324e-11, 5.674740148239301e-11, 5.582688709371417e-11, 5.485106791023405e-11, 5.481192913018784e-11, 5.497105449305245e-11, 5.55308513300546e-11, 5.5818938404726124e-11, 5.603741130163767e-11, 5.620771956517265e-11, 5.618918130039591e-11, 5.61345389366892e-11, 5.6001086068957654e-11, 5.595235055766623e-11, 5.5916314191366856e-11]
=============SCS_DynamicLayer_20240625_124826_366924.pickle=============
-----------SCS-----------
SCSsol['info']['pobj'] = -0.002215217426752619, SCSsol['info']['status'] = 'solved', SCSsol['x'] = array([1.90768627e-04, 1.71597468e-04, 1.56107152e-04, 1.41012605e-04,
1.27465658e-04, 1.15173066e-04, 1.03803338e-04, 9.52429990e-05,
8.61068786e-05, 4.35357896e-05, 1.50626712e-04, 1.74800292e-04,
1.37827617e-04, 7.63372261e-05, 9.02991412e-13, 2.44051336e-13,
2.44051360e-13, 2.44051268e-13, 2.44051210e-13, 2.44051394e-13,
2.44051256e-13, 2.44051419e-13, 2.44051233e-13, 2.44051275e-13,
2.43587140e-13, 2.42292083e-13, 2.39844607e-13, 2.32528533e-13,
2.28671382e-13, 2.25186628e-13, 2.19641011e-13, 2.17428008e-13,
2.15461903e-13, 2.13008008e-13, 2.12755080e-13, 2.12872718e-13,
2.13563827e-13, 2.13754464e-13, 2.13512943e-13, 2.12298399e-13,
2.11844188e-13, 2.11356916e-13, 2.09583937e-13, 2.08726103e-13,
2.08336882e-13])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.0022152174267624503, clarabel_solution.status = Solved, clarabel_solution.x = [0.00019076221443803517, 0.00017161401041454087, 0.00015608744276640255, 0.00014102549607533437, 0.00012746475443084693, 0.00011516469875157536, 0.00010381329027656681, 9.523573477537405e-05, 8.611244900019338e-05, 4.353157804871756e-05, 0.0001506285695843726, 0.00017480015346372276, 0.0001378277079923815, 7.633724223309769e-05, 7.402155371667622e-12, 4.965827303819483e-11, 4.965437612207606e-11, 4.9650849634359917e-11, 4.9644769875527325e-11, 4.9642155753222594e-11, 4.963978972099507e-11, 4.963570972671434e-11, 4.9633955095898954e-11, 4.963236680374209e-11, 4.9786226003858936e-11, 5.025590754635561e-11, 5.2088158356424624e-11, 5.771888610298373e-11, 5.913705369744592e-11, 5.928091578082756e-11, 5.763067279392684e-11, 5.6569626886655146e-11, 5.565386489883837e-11, 5.4683841907138966e-11, 5.464633867216354e-11, 5.48062925637533e-11, 5.5366378165935806e-11, 5.5654855288171645e-11, 5.587381381126671e-11, 5.6044868611528313e-11, 5.602678592850865e-11, 5.5972769367126994e-11, 5.584042230149203e-11, 5.5791986607535523e-11, 5.575601417531867e-11]

@kkzhang3
Copy link
Author

I asked my colleague @ymwang78, who is much more knowledgeable in C and C++ than I am, to help me with this issue. We discovered that if we install SCS through pip, we both encounter the same infeasibility error. However, when we build SCS from the original source code, we get the correct results. This observation holds true for both the main branch and the new modified branch 8891c9c.

We use python 3.12 on windows 11 system.

@bodono
Copy link
Member

bodono commented Jun 27, 2024

Thanks for all the information. I can only think of the difference when installing via pip is from linking against a different blas library, but I'm surprised that the change didn't fix it. I am planning to merge that fix and cut a new pip release with it, so it should be easy to just use pip install again to pick up the new version and we can test again then. This is very mysterious!

@bodono
Copy link
Member

bodono commented Jun 27, 2024

Ok i just cut a new pip release, can you pip install or pip upgrade and retry? Make sure it's version 3.2.5. Fingers crossed this fixes it.

@kkzhang3
Copy link
Author

I tried version 3.2.5 by installing it via pip. To my surprise, the infeasibility issue still persists.

scs.__version__ = '3.2.5'
clarabel.__version__ = '0.7.1'
=============SCS_DynamicLayer_20240625_124826_169446.pickle=============
------------------------------------------------------------------      
               SCS v3.2.5 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------      
problem:  variables n: 45, constraints m: 120
cones:    l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07       
          alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
          max_iters: 100000, normalize: 1, rho_x: 1.00e-06
          acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
          nnz(A): 770, nnz(P): 571
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.27e+02  9.56e+04  2.61e+06 -1.92e+04  1.00e-01  2.36e-03
    25| 1.07e-05  1.73e+01  1.92e+01 -4.92e-01  1.00e-01  2.63e-03
------------------------------------------------------------------
status:  infeasible
timings: total: 2.76e-03s = setup: 1.17e-03s + solve: 1.59e-03s
         lin-sys: 1.04e-04s, cones: 1.09e-05s, accel: 1.60e-06s
------------------------------------------------------------------
objective = inf
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = inf, SCSsol['info']['status'] = 'infeasible', SCSsol['x'] = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.47395779415549794, clarabel_solution.status = Solved, clarabel_solution.x = [0.0027904978965449666, 0.002510198944930076, 0.0022831938027705117, 0.0020628662164093115, 0.0018645011729976001, 0.0016845818065795019, 0.001518539175488385, 0.0013930633137464905, 0.0012596049961827414, 0.0006369214890962764, 0.0022030588661007553, 0.0025572221591200366, 0.0020148959955852168, 0.0011160350187950417, 7.508467158983145e-12, 5.098200436696795e-11, 5.0919837101523314e-11, 5.086396393312051e-11, 5.076849130648014e-11, 5.0727771773585275e-11, 5.0691087613373826e-11, 5.06282096624894e-11, 5.060131621510247e-11, 5.057704866048211e-11, 
5.069986578401336e-11, 5.116678636363365e-11, 5.302258154382985e-11, 5.873031052501555e-11, 6.015784957736915e-11, 6.028859646361538e-11, 5.858461187983256e-11, 5.749518217098852e-11, 5.6554606511962526e-11, 5.5554309438862856e-11, 5.550824040336608e-11, 5.5663838781453607e-11, 5.622236098014281e-11, 5.650877287399536e-11, 5.67251738200511e-11, 5.689231675566984e-11, 5.6871853878784136e-11, 5.681457007507406e-11, 5.6676452814081476e-11, 5.6626453715519324e-11, 5.659015006674711e-11]
=============SCS_DynamicLayer_20240625_124826_273466.pickle=============
------------------------------------------------------------------
               SCS v3.2.5 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 45, constraints m: 120
cones:    l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07
          alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
          max_iters: 100000, normalize: 1, rho_x: 1.00e-06
          acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
          nnz(A): 770, nnz(P): 571
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.27e+02  9.55e+04  2.61e+06 -1.87e+04  1.00e-01  3.44e-03
    75| 1.59e-13  1.45e+00  2.50e-01 -2.95e-02  1.00e-01  4.17e-03
------------------------------------------------------------------
status:  infeasible
timings: total: 4.30e-03s = setup: 2.76e-03s + solve: 1.54e-03s
         lin-sys: 4.51e-04s, cones: 3.50e-05s, accel: 1.15e-05s
------------------------------------------------------------------
objective = inf
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = inf, SCSsol['info']['status'] = 'infeasible', SCSsol['x'] = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.029336830707231296, clarabel_solution.status = Solved, clarabel_solution.x = [0.0006942523340928437, 0.0006245211531611647, 0.0005680402154852255, 0.0005132247970703782, 0.0004638732525990768, 0.00041911069714191607, 0.0003778005965243507, 0.0003465831910797031, 0.00031337981165299804, 0.00015846105492833785, 0.0005481037104770503, 0.0006362167512226497, 0.0005012902690682797, 0.00027766073090962665, 7.422584398118871e-12, 4.9908818125428526e-11, 4.989439411164203e-11, 4.988135885249981e-11, 4.985892511625296e-11, 4.9849294577522e-11, 4.9840585958786774e-11, 4.982558652410234e-11, 4.9819142820566604e-11, 4.981331356680122e-11, 4.996139585601154e-11, 5.043061010730071e-11, 5.2267431264695483e-11, 5.791302606624232e-11, 5.933302998604015e-11, 5.947440433414254e-11, 5.7813882893553324e-11, 5.674740148239301e-11, 5.582688709371417e-11, 5.485106791023405e-11, 5.481192913018784e-11, 5.497105449305245e-11, 5.55308513300546e-11, 5.5818938404726124e-11, 5.603741130163767e-11, 5.620771956517265e-11, 5.618918130039591e-11, 5.61345389366892e-11, 5.6001086068957654e-11, 5.595235055766623e-11, 5.5916314191366856e-11]
=============SCS_DynamicLayer_20240625_124826_366924.pickle=============
------------------------------------------------------------------
               SCS v3.2.5 - Splitting Conic Solver
        (c) Brendan O'Donoghue, Stanford University, 2012
------------------------------------------------------------------
problem:  variables n: 45, constraints m: 120
cones:    l: linear vars: 120
settings: eps_abs: 1.0e-07, eps_rel: 1.0e-06, eps_infeas: 1.0e-07
          alpha: 1.50, scale: 1.00e-01, adaptive_scale: 1
          max_iters: 100000, normalize: 1, rho_x: 1.00e-06
          acceleration_lookback: 10, acceleration_interval: 10
lin-sys:  sparse-direct-amd-qdldl
          nnz(A): 770, nnz(P): 571
------------------------------------------------------------------
 iter | pri res | dua res |   gap   |   obj   |  scale  | time (s)
------------------------------------------------------------------
     0| 2.26e+02  9.55e+04  2.61e+06 -1.86e+04  1.00e-01  3.43e-03
    50| 3.46e-13  4.37e+00  1.68e+00 -2.37e-03  1.00e-01  3.83e-03
------------------------------------------------------------------
status:  infeasible
timings: total: 3.94e-03s = setup: 2.63e-03s + solve: 1.32e-03s
         lin-sys: 2.17e-04s, cones: 1.64e-05s, accel: 5.50e-06s
------------------------------------------------------------------
objective = inf
------------------------------------------------------------------
-----------SCS-----------
SCSsol['info']['pobj'] = inf, SCSsol['info']['status'] = 'infeasible', SCSsol['x'] = array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan])
-----------CLARABEL-----------
clarabel_solution.obj_val = -0.0022152174267624503, clarabel_solution.status = Solved, clarabel_solution.x = [0.00019076221443803517, 0.00017161401041454087, 0.00015608744276640255, 0.00014102549607533437, 0.00012746475443084693, 0.00011516469875157536, 0.00010381329027656681, 9.523573477537405e-05, 8.611244900019338e-05, 4.353157804871756e-05, 0.0001506285695843726, 0.00017480015346372276, 0.0001378277079923815, 7.633724223309769e-05, 
7.402155371667622e-12, 4.965827303819483e-11, 4.965437612207606e-11, 4.9650849634359917e-11, 4.9644769875527325e-11, 4.9642155753222594e-11, 4.963978972099507e-11, 4.963570972671434e-11, 4.9633955095898954e-11, 4.963236680374209e-11, 4.9786226003858936e-11, 5.025590754635561e-11, 5.2088158356424624e-11, 5.771888610298373e-11, 5.913705369744592e-11, 5.928091578082756e-11, 5.763067279392684e-11, 5.6569626886655146e-11, 5.565386489883837e-11, 5.4683841907138966e-11, 5.464633867216354e-11, 5.48062925637533e-11, 5.5366378165935806e-11, 5.5654855288171645e-11, 5.587381381126671e-11, 5.6044868611528313e-11, 5.602678592850865e-11, 5.5972769367126994e-11, 5.584042230149203e-11, 5.5791986607535523e-11, 5.575601417531867e-11]

@bodono
Copy link
Member

bodono commented Jun 28, 2024

Oh no! Can you dump the data down to csv again for one of them?

@kkzhang3
Copy link
Author

scs_err_csv.zip

@bodono
Copy link
Member

bodono commented Jun 28, 2024

Ok I have been able to reproduce this, as far as I can tell it is just numerical problems when the values are very small producing inconsistent results between different hardware. I will try and improve the robustness of the infeasibility checks by ensuring the things being compared are at some minimum value.

@kkzhang3
Copy link
Author

kkzhang3 commented Jun 29, 2024

Oh, Thanks! Looking forward to the new version! I can provide more unexcepct infeasible examples. Let me know if it is necessary.

@bodono
Copy link
Member

bodono commented Jul 2, 2024

I believe I have fixed the issue in this PR: #280

I added the data files you included as tests, is this ok? If not I can remove them.

@kkzhang3
Copy link
Author

kkzhang3 commented Jul 2, 2024

It's OK. I'll try the new version later.

@kkzhang3
Copy link
Author

kkzhang3 commented Jul 3, 2024

Could you update a pip release?

@bodono
Copy link
Member

bodono commented Jul 5, 2024

Yes, will do as soon as I can figure out what's wrong with bodono/scs-python#103

@bodono
Copy link
Member

bodono commented Jul 7, 2024

Ok, it's on pip now.

@kkzhang3
Copy link
Author

kkzhang3 commented Jul 9, 2024

Thanks. I tried. It works great.

@bodono
Copy link
Member

bodono commented Jul 9, 2024

Glad to hear it!

@bodono bodono closed this as completed Jul 9, 2024
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

No branches or pull requests

3 participants