Repository navigation
docs: fix diffcp solver selection and default JAX batching examples - #254
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
SteveDiamond
approved these changes
Oct 24, 2026
SteveDiamond
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the documentation and docstring changes against the current interfaces. The backend/solve_method distinction and batching guidance look reasonable.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Correct executable documentation examples without changing solver behavior:
solver, and SCS/Clarabel within diffcp withsolver_args["solve_method"](including the case-sensitive"Clarabel"). Fix the solver guide, basic-usage guidance and constructor docstrings.eps/max_itersto SCS and list Clarabel's actual tolerance/iteration settings.jax.vmapexample and explain that built-in batching works with diffcp, while traced transformations require Moreau.Evidence
On current master, a small DPP least-squares layer following the solver guide raises
TypeError: ... unexpected keyword argument 'solver'. Passingsolver=cp.CLARABELas suggested elsewhere raisesRuntimeError: Unknown solver. Executing the corrected construction, per-call override and Clarabel fallback snippets produces the expected solution and gradients. The default-backend vmap example raisesTracerArrayConversionError; direct batching works.Validation
Local Windows / Python 3.13, CVXPY 1.9.3, diffcp 1.1.9, SCS 3.3.1, Clarabel 0.11.1, Torch 2.14.1+cpu, JAX 0.11.2:
pytest tests/test_jax.py tests/test_dual_variables_jax.py tests/test_torch.py tests/test_dual_variables.py tests/test_parse_args.py tests/test_readme_examples.py: 102 passed, 30 skipped, 3 failed. The failures are the existing three SCS gradchecks described in gradcheck tests fail with scs >= 3.3.0 (pass on 3.2.11) #244, also reproduced before edits; not changed here.git diff --checkpass. ASTs excluding docstrings are identical to master.MLX, Moreau, MPAX, CUDA/Julia and the documentation build were not run. No runtime implementation changes.