symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.44k stars 147 forks source link

Fix sorted optimized keys in residual cache #375

Closed aaron-skydio closed 11 months ago

aaron-skydio commented 1 year ago

Fixes #300

The not sorting alone fixes the issue, but also always ordering by self.keys mimics the original intent here of hitting the residual cache regardless of the actual lexicographic ordering of keys. Added a test that goes fail->pass.