Repository navigation
Throwaway: reproduce cvxpy test_pcp_5 Windows failure across scs vers… #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Throwaway: does cvxpy's test_pcp_5 fail on Windows because of conda-forge scs 3.3.1? | |
| # Same env, only the scs version differs. Results are emitted as annotations. | |
| name: scs-win-repro | |
| on: | |
| push: | |
| branches: [ scs-win-repro ] | |
| jobs: | |
| pcp5: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ windows-2022 ] | |
| scs: [ "3.2.11", "3.3.1" ] | |
| include: | |
| # control: same scs 3.3.1 on Linux | |
| - os: ubuntu-22.04 | |
| scs: "3.3.1" | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| steps: | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| python-version: "3.12" | |
| channels: conda-forge | |
| conda-remove-defaults: true | |
| - name: Install conda-forge deps with pinned scs, then cvxpy 1.9.3 wheel | |
| run: | | |
| conda install -y "scs=${{ matrix.scs }}" numpy scipy osqp clarabel highspy pytest hypothesis | |
| pip install --no-deps cvxpy==1.9.3 | |
| conda list | grep -E "^(scs|numpy|scipy|libblas|liblapack|libopenblas|mkl) " | |
| echo "::notice title=env ${{ matrix.os }} scs=${{ matrix.scs }}::$(conda list | grep -E '^(scs|numpy|scipy|libblas|libopenblas|mkl) ' | tr -s ' ' | tr '\n' ';')" | |
| - name: Measure dual-domain violation | |
| run: | | |
| cat > pcp5.py <<'EOF' | |
| import platform, unittest | |
| import cvxpy as cp, scs | |
| from cvxpy.tests.test_KKT import TestKKT_PCPs | |
| viols = [] | |
| class T(unittest.TestCase): | |
| def runTest(self): pass | |
| def assertLessEqual(self, a, b, msg=None): | |
| viols.append(float(a)); super().assertLessEqual(a, b, msg) | |
| sth = TestKKT_PCPs.vec_pow_nd() | |
| sth.tester = T() | |
| sth.solve(solver='SCS', eps=1e-6) | |
| try: | |
| sth.check_dual_domains(3); res = 'PASS' | |
| except AssertionError: | |
| res = 'FAIL' | |
| print('::notice title=pcp5 %s scs=%s::%s cvxpy %s scs %s max dual-domain violation = %.3g' | |
| % (platform.system(), scs.__version__, res, cp.__version__, scs.__version__, max(viols))) | |
| EOF | |
| python pcp5.py | |
| - name: Run the real test | |
| run: | | |
| if python -m pytest --pyargs cvxpy.tests.test_KKT -k test_pcp_5 -q -p no:cacheprovider; then r=PASSED; else r=FAILED; fi | |
| echo "::notice title=pytest ${{ matrix.os }} scs=${{ matrix.scs }}::test_pcp_5 $r" |