Skip to content

fix diff engine converter bugs: 1D matmul dims, reshape, transpose, q…#190

Merged
Transurgeon merged 5 commits intofeat/diffengine-dcp-backendfrom
fix/diffengine-converter-fixes
Apr 22, 2026
Merged

fix diff engine converter bugs: 1D matmul dims, reshape, transpose, q…#190
Transurgeon merged 5 commits intofeat/diffengine-dcp-backendfrom
fix/diffengine-converter-fixes

Conversation

@Transurgeon
Copy link
Copy Markdown
Member

…uad form

  • helpers.py: fix 1D dimension normalization in dense matmul helpers. Right-matmul treated 1D A as (1,n) instead of (n,1), causing segfaults.
  • converters.py: reshape 1D child to column vector in left-matmul for dot products; add constant-atom fallback for unfolded expressions; move QuadForm/SymbolicQuadForm dispatch out of ATOM_CONVERTERS (needs n_vars); tolerate 1D dimension mismatches via reshape instead of error.
  • registry.py: support C-order reshape via transpose decomposition; fix 1D transpose to be a no-op; improve scalar quad form P handling; raise NotImplementedError for vector SymbolicQuadForm (TODO: native block quadform in SparseDiffPy).
  • perspective_canon.py: handle DiffengineConeProgram which stores q, d, A, b as separate arrays (vs ParamConeProg sparse tensors).

Description

Please include a short summary of the change.
Issue link (if applicable):

Type of change

  • New feature (backwards compatible)
  • New feature (breaking API changes)
  • Bug fix
  • Other (Documentation, CI, ...)

Contribution checklist

  • Add our license to new files.
  • Check that your code adheres to our coding style.
  • Write unittests.
  • Run the unittests and check that they’re passing.
  • Run the benchmarks to make sure your change doesn’t introduce a regression.

Transurgeon and others added 2 commits April 15, 2026 14:51
…uad form

- helpers.py: fix 1D dimension normalization in dense matmul helpers.
  Right-matmul treated 1D A as (1,n) instead of (n,1), causing segfaults.
- converters.py: reshape 1D child to column vector in left-matmul for
  dot products; add constant-atom fallback for unfolded expressions;
  move QuadForm/SymbolicQuadForm dispatch out of ATOM_CONVERTERS (needs
  n_vars); tolerate 1D dimension mismatches via reshape instead of error.
- registry.py: support C-order reshape via transpose decomposition;
  fix 1D transpose to be a no-op; improve scalar quad form P handling;
  raise NotImplementedError for vector SymbolicQuadForm (TODO: native
  block quadform in SparseDiffPy).
- perspective_canon.py: handle DiffengineConeProgram which stores
  q, d, A, b as separate arrays (vs ParamConeProg sparse tensors).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Transurgeon Transurgeon marked this pull request as draft April 21, 2026 19:36
@Transurgeon Transurgeon marked this pull request as ready for review April 22, 2026 15:25
@Transurgeon Transurgeon merged commit b8d716a into feat/diffengine-dcp-backend Apr 22, 2026
0 of 20 checks passed
@Transurgeon Transurgeon deleted the fix/diffengine-converter-fixes branch April 22, 2026 15:25
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

Successfully merging this pull request may close these issues.

1 participant