Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 13, 2025

Upgrades the vendored Eigen library from 3.4.0 to 5.0.1, with compatibility patches applied during build to Ceres Solver 2.2.0.

Changes

  • Eigen submodule: Updated to tag 5.0.1 (commit bc3b398)
  • Ceres Solver 2.2.0 patches (backported from upstream commit f9b7b665):
    • Created ceres-solver-src/patches/0001-support-eigen-5.patch with compatibility changes
    • CMakeLists.txt: Support Eigen version range 3.3...5 with fallback
    • covariance_impl.cc and invert_psd_matrix.h: Handle Eigen 5.x SVD constructor API change
  • Build system: Updated ceres-solver-src/build.rs to apply patches automatically during build
  • Version metadata: Updated ceres-solver-src/Cargo.toml to reflect eigen5.0.1

Technical Details

Eigen 5.x changed the SVD constructor API from runtime to compile-time options:

// Eigen 3.x
Eigen::JacobiSVD<Matrix> svd(m, Eigen::ComputeThinU | Eigen::ComputeThinV);

// Eigen 5.x
Eigen::JacobiSVD<Matrix, Eigen::ComputeThinU | Eigen::ComputeThinV> svd(m);

Compatibility is maintained via EIGEN_VERSION_AT_LEAST(5, 0, 0) preprocessor guards.

Implementation Approach

The patches are applied during the build process rather than modifying the submodule directly. This ensures that:

  • All submodules point to valid upstream commits that CI can fetch
  • The ceres-solver submodule remains at the original 2.2.0 tag (commit 85331393)
  • Patches are automatically applied before building Ceres Solver
  • Both clean and incremental builds work correctly
Original prompt

Try to bump venored Eigen to verson 5.0.0


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update venored Eigen to version 5.0.0 Bump vendored Eigen to 5.0.1 Dec 13, 2025
Copilot AI requested a review from hombit December 13, 2025 18:10
Copy link
Member

@hombit hombit left a comment

Choose a reason for hiding this comment

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

@copilot all CI tasks failed

Copy link
Contributor Author

Copilot AI commented Dec 13, 2025

@copilot all CI tasks failed

Fixed in d0893ab. The issue was that I had modified the ceres-solver submodule directly with a local commit that didn't exist in the upstream repository. CI couldn't checkout this commit when initializing submodules.

The solution was to:

  1. Reset ceres-solver submodule back to the original 2.2.0 tag (85331393)
  2. Create a patch file (ceres-solver-src/patches/0001-support-eigen-5.patch) with the Eigen 5.x compatibility changes
  3. Update build.rs to apply the patch during the build process

Now the patches are applied automatically during build, and all submodules point to valid upstream commits that CI can fetch.

Copilot AI requested a review from hombit December 13, 2025 19:03
@hombit
Copy link
Member

hombit commented Dec 13, 2025

We are not patching vendored deps

@hombit hombit closed this Dec 13, 2025
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.

2 participants