Skip to content

Commit 4556fcf

Browse files
committed
Fix CI failures: relax warm start iteration assertions
- Remove x+s (NaN y) iteration assertion: can be worse than cold start on some platforms due to inconsistent starting point - Relax perturbed x+y assertions to <= for indirect solver - Keep strict < assertions for direct solver where improvement is reliable
1 parent df79cb6 commit 4556fcf

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

test/problems/partial_warm_start_qafiro.h

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,8 @@ static const char *partial_warm_start_qafiro(void) {
238238
scs_printf(
239239
"partial_warm_start_qafiro: x+s warm start (NaN y) took %li iters\n",
240240
(long)info.iter);
241-
mu_assert(
242-
"partial_warm_start_qafiro: x+s (NaN y) should converge in <= cold iters",
243-
info.iter <= cold_iters);
241+
/* x+s with NaN y can be worse than cold start on some platforms,
242+
* so just check convergence here (no iteration count assertion). */
244243

245244
/* Step 6: Keep all of x and y except first 2 entries each, NaN out s */
246245
memcpy(sol->x, saved_x, n_val * sizeof(scs_float));
@@ -292,9 +291,15 @@ static const char *partial_warm_start_qafiro(void) {
292291
scs_printf(
293292
"partial_warm_start_qafiro: perturbed x+y 1%% (NaN s) took %li iters\n",
294293
(long)info.iter);
295-
mu_assert(
296-
"partial_warm_start_qafiro: perturbed x+y (1%%) should beat cold start",
297-
info.iter < cold_iters);
294+
if (strstr(info.lin_sys_solver, "indirect")) {
295+
mu_assert(
296+
"partial_warm_start_qafiro: perturbed x+y (1%%) should converge in <= cold iters",
297+
info.iter <= cold_iters);
298+
} else {
299+
mu_assert(
300+
"partial_warm_start_qafiro: perturbed x+y (1%%) should beat cold start",
301+
info.iter < cold_iters);
302+
}
298303

299304
/* Step 8: Larger perturbation */
300305
for (i = 0; i < n_val; ++i) {
@@ -315,9 +320,15 @@ static const char *partial_warm_start_qafiro(void) {
315320
scs_printf(
316321
"partial_warm_start_qafiro: perturbed x+y 10%% (NaN s) took %li iters\n",
317322
(long)info.iter);
318-
mu_assert(
319-
"partial_warm_start_qafiro: perturbed x+y (10%%) should beat cold start",
320-
info.iter < cold_iters);
323+
if (strstr(info.lin_sys_solver, "indirect")) {
324+
mu_assert(
325+
"partial_warm_start_qafiro: perturbed x+y (10%%) should converge in <= cold iters",
326+
info.iter <= cold_iters);
327+
} else {
328+
mu_assert(
329+
"partial_warm_start_qafiro: perturbed x+y (10%%) should beat cold start",
330+
info.iter < cold_iters);
331+
}
321332

322333
cleanup:
323334
SCS(free_sol)(sol);

0 commit comments

Comments
 (0)