Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix cache corruption #100

Closed
Rayhawk11 opened this issue Oct 15, 2020 · 3 comments
Closed

Matrix cache corruption #100

Rayhawk11 opened this issue Oct 15, 2020 · 3 comments
Assignees
Labels

Comments

@Rayhawk11
Copy link

Rayhawk11 commented Oct 15, 2020

Link to file to reproduce the issue.

The fastSplitMatrix() method is supposed to split a Matrix and output a list of 4 new matrices, each representing a quadrant of the original Matrix. The first matrix in the list is the upper left quadrant, second is the upper right quadrant, third is the lower left quadrant, fourth is the lower right quadrant.

The provided file tries to split a matrix consisting of 1s in the top row, 2s in the second row, 3s in the third row, and 4s in the fourth row. It then prints out the upper-left quadrant (split[0]); this correctly yields the matrix [1, 1; 2, 2].

Examining the cache of split[0] at this point using the Dart debugger shows that rowsCache contains the rows [3, 3] and [4, 4]: these are wrong. The matrix split[0] also has attribute areAllRowsCached set to true, so my guess is the library thinks that the cache is valid.

This behavior manifests when trying to add split[0] to itself: you get a result of [6, 6; 8, 8], presumably from operating on the incorrect cached values.

EDIT: System Details
This is with ml_linalg version 12.17.3.

@Rayhawk11
Copy link
Author

Interestingly, this file does not exhibit the bug. The difference here is that the temporary variables t1 and t2 are not reused when creating the bottom matrices; instead, new variables, t3 and t4 are used.

@gyrdym
Copy link
Owner

gyrdym commented Oct 15, 2020

@Rayhawk11 Thank you for creating the issue. I will look at this and let you know if I can do something to solve your problem, just keep tracking the updates in this thread.

@gyrdym gyrdym self-assigned this Oct 15, 2020
@gyrdym gyrdym added the bug label Oct 15, 2020
@gyrdym
Copy link
Owner

gyrdym commented Oct 22, 2020

@Rayhawk11 please check out new version of the library - 12.17.4, the issue was fixed.

@gyrdym gyrdym closed this as completed Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants