Skip to content

refactor(simplex): share variable transformation helpers - #23

Merged
rasheedja merged 4 commits into
masterfrom
refactor/share-variable-transforms
Oct 4, 2026
Merged

rasheedja merged 4 commits into
masterfrom
refactor/share-variable-transforms

Conversation

@rasheedja

@rasheedja rasheedja commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Share shift and split coefficient-map substitution helpers between objectives and constraints, and place both helpers together after applySplitToConstraint.
  • Use record field accessors and the existing field lenses to avoid repeated constructor branches and ambiguous lhs/rhs record updates.
  • Preserve constraint relations, objective direction, shift offsets, and variable allocation.
  • Export the helpers alongside the existing internal testing functions and add 15 direct tests, including two generated properties for algebraic substitution. Cover absent variables, empty maps, signed/fractional/zero coefficients, exact offsets, and preservation of unrelated terms.
  • Update the changelog.

This cleanup targets master independently; it does not require the correctness fixes to merge first. The map-fold and printer cleanups are already included in #18 and #19.

Validation

  • Reproduced both original constraint-update warnings as build failures with -Werror=ambiguous-fields.
  • stack --no-system-ghc test --no-terminal --force-dirty --ghc-options='-fforce-recomp -Werror=ambiguous-fields': 286 examples, 0 failures using GHC 9.6.7. Each new property ran 100 cases.
  • cabal check, Fourmolu 0.15.0.0, and git diff --check passed.
  • stack --no-system-ghc haddock --no-haddock-deps --no-terminal --ghc-options=-Werror=ambiguous-fields passed.

@rasheedja
rasheedja merged commit 9daa7c2 into master Oct 4, 2026
23 checks passed
@rasheedja
rasheedja deleted the refactor/share-variable-transforms branch October 4, 2026 10:32
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