Menu

#1903 Calculation Error in Difference Operator

Backlog
closed
None
3urgent
4 days ago
2026-01-25
Steve Keen
No

The difference operator returns crazy values in the latest version--perhaps due to dimensional leakage. The two PNG files show the same file loaded in the latest version and version 3.18.

3 Attachments

Discussion

  • High Performance Coder

    Going to have to do a git bisect to figure out where this regression came in. No work has taken place around the difference operator for more than a year, Also funny that the difference operator is a plain delta, rather than delta^- like it is in 3.18.

     
  • High Performance Coder

    • priority: 1fatal --> 3urgent
     
  • High Performance Coder

    Reducing priority to 3, as this is not fatal or critical.

     
  • High Performance Coder

    This issue turns out to be collateral damage from the fix for https://sourceforge.net/p/minsky/tickets/1886/, which also brought in unordered index elements (for performance reasons).

    It would have been present in 3.21 beta, but because of the deadlock issue with Ravels, you didn't get to see that issue before it got pushed to production releases.

    The workaround for now is to downgrade to the latest 3.20 version. Originally, I thought to reinstate the version of civita used in 3.20, but then that would revert the fix for #1886. So I'll need to fix the actual root of the problem, which is the assumption of sorted indices, both in the difference operator, and audit the codebase to see if any other operator is affected.

    Also need to see what unit tests can be added that would have picked up this problem before it got pushed to production.

     
  • High Performance Coder

    Took a bit to create a unit test that actually triggered this bug, so unit testing actually would have really caught this issue anyway. I did audit the codebase, and potentially flagged outerproduct, gather and index operators as affected by this "collateral damage" as well. I modified unit tests to try to trigger any bugs, so far they all passed, so as far as I know ATM, there are no issues with those operators. I also tried asking Github Copilot to audit the codebase as well, and it was completely clueless. It flagged a bunch of lines that were irrelevant, and didn't flag the lines I found.

    So ultimately, one line of code needed changing to use sorted indices in computing the difference.

     
  • High Performance Coder

    • status: open --> closed
    • assigned_to: High Performance Coder
     

Anonymous
Anonymous

Add attachments
Cancel