Skip to content

Refactor tensor derivatives and solver infrastructure; update python/pyzag bindings, tests, and docs#316

Merged
hugary1995 merged 36 commits intomainfrom
dep_intmd_dim
Feb 5, 2026
Merged

Refactor tensor derivatives and solver infrastructure; update python/pyzag bindings, tests, and docs#316
hugary1995 merged 36 commits intomainfrom
dep_intmd_dim

Conversation

@hugary1995
Copy link
Collaborator

@hugary1995 hugary1995 commented Jan 15, 2026

Summary: Major refactor of tensor derivative handling and equation‑system infrastructure, with solver/linear‑solver cleanups and broad updates across models, Python bindings, docs, and tests.

Changes:

  • Replace model‑level assembler/derivative plumbing with new tensor derivative and equation‑system types
  • Introduce linear solver abstraction and DenseLU implementation; remove trust‑region subproblem/assembler artifacts and related tests.

close #116 #117

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request performs a major refactor of tensor derivative handling and equation-system infrastructure, introducing new abstractions for linear solvers and updating the solver framework. The refactor replaces model-level assembler/derivative plumbing with new tensor derivative and equation-system types (ESData/Matrix/Vector), and introduces a linear solver abstraction with a DenseLU implementation.

Changes:

  • Replaced assembly-based derivative handling with new tensor derivative infrastructure using intrinsic intermediate dimensions
  • Introduced es::Vector and es::Matrix classes for equation system data structures
  • Added LinearSolver base class and DenseLU implementation for solving linear systems
  • Updated all test configuration files to specify the new linear_solver parameter
  • Removed trust-region solver and related infrastructure

Reviewed changes

Copilot reviewed 211 out of 212 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Multiple .i test files Added linear_solver = 'lu' configuration and DenseLU solver blocks
tests/unit/solvers/test_NonlinearSolvers.cxx Refactored to use new es::Vector API and factory-based solver loading
tests/src/SampleNonlinearSystems.cxx Updated to use es::Vector and es::Matrix instead of flat tensors
tests/src/ModelUnitTest.cxx Updated derivative collection to use new assembly format
src/neml2/tensors/Derivative.cxx New derivative class with intrinsic intermediate dimension support
src/neml2/tensors/equation_system/*.cxx New equation system data structures (ESData, Vector, Matrix)
src/neml2/solvers/*.cxx Updated solvers to use new linear solver abstraction and es::Vector
src/neml2/models/*.cxx Updated models to use new derivative and assembly infrastructure
Comments suppressed due to low confidence (3)

tests/regression/solid_mechanics/crystal_plasticity/taylor/model.i:1

  • The entire taylor/model.i file has been deleted (194 lines removed) along with its gold reference file. This appears to be an unintentional deletion of a regression test. Either the file should be restored or there should be documentation explaining why this test is no longer needed.
    tests/unit/models/test_Assembler.cxx:1
  • The entire test_Assembler.cxx file (191 lines) has been deleted. Since the Assembler infrastructure is being replaced, these tests should be replaced with equivalent tests for the new es::Vector and es::Matrix classes rather than completely removed.
    src/neml2/solvers/TrustRegionSubProblem.cxx:1
  • The TrustRegionSubProblem class (82 lines) has been completely removed. If this solver capability is no longer supported, there should be migration documentation or the functionality should be preserved in the new infrastructure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 16, 2026

Documentation preview removed.
To view the documentation, please visit the main documentation page.

- update pyzag bindings, tests, and docs
- keep information on intrinsic intermediate dimension within derivative
- remove from_assembly, to_assembly
- factor out nonlinear system
Copy link
Collaborator

@reverendbedford reverendbedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main complaint:

The linear system stuff is a confusing. More docs will help somewhat (need to mention the names g = "givens", b = "RHS", "u" = unknowns. I guess the last one is obvious.

Now that I read the source files I get what's happening, but isn't including givens in the linear system a bit of a mixed metaphor? I guess we can discuss tomorrow because right now I can't think of a better way to structure things.

Random other questions:

  1. Why did the trust region solver have to go? We don't need it, just curious.
  2. Why are reductions on intermediate dimension now always -1?

@hugary1995 hugary1995 linked an issue Feb 4, 2026 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 298 out of 303 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hugary1995 hugary1995 merged commit f4f7f62 into main Feb 5, 2026
27 checks passed
@hugary1995 hugary1995 deleted the dep_intmd_dim branch February 5, 2026 04:06
github-actions bot added a commit that referenced this pull request Feb 5, 2026
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.

Improve Taylor models and similar structures Better way to deal with "lists" of tensors

2 participants