jit.matrix reset to defaults on name change?
I found a problem that has me puzzled.
I use the message ‘name X’ (in my case, X = "fftdata512", "fftdata1024", etc.) to rename a jit.matrix which I already initialized as 2-plane float32 through typed-in arguments. The matrix was not named yet.
After the renaming, the matrix is 4-plane char (indeed, the defaults for jit.matrix).
This happens inside a spectral subpatch (I’m using multiple copies, that’s why I want to name the matrix dynamically). I’m using max 4.6.3 on OSX.
Any idea under what circumstances this would happen? Of course I can make it work by explicitly setting all the attributes back after renaming, but I’m just wondering why this happens?
i just tried this and could not reproduce.
please provide and example patch and all the relevant computer specs
Thanks for your reaction.
I took the concerned objects out of their context (big program with lots of components and subpatches) into an example patch, stripping away all parts that should not interfere with this. However, in the resulting patch I cannot reproduce the problem.
Going back to the original patch, the problem is still there sometimes (it doesn’t happen always and not in the same manner).
So it must be some issue in the bigger patch. I will not send you this because finding the cause of the problem in there might take very long. Maybe I will take a look at it again, if so I will post here.
I got the feeling it has to do with the memory for matrices that is somehow not flushed completely when closing patches. I think this because sometimes when I reopen the patch, the matrix contains the same values as before closing the patch (I’m not saving anything). These strange things seem to co-occur. On the other hand, closing and restarting Max doesn’t always remove the problem either. I’m in Mac OS 10.4.11, 2 GHz Intel Core 2 Duo, 1 GB RAM, using Max 4.6.3, jitter 1.6.3, keyserver version.
I have the same problem. I use my patch as an abstraction, and the Jitter matrices are named using an argument on load.
However, they start as 2 plane float32 data, and end up as 4 plane char data which doesn’t work properly.
For now, I’ve just added a workaround but it is pretty annoying.
Bizarrely, as maarten_wez says, it only happens occasionally. Also, it only seems to happen with certain names. In my patch, I wanted to dynamically give the matrices argument_Mix (depending on the argument).
When it was named ‘FFTone_Mix’ it resulted in the matrix reverting back to 4-plane, char data.
Here is an example, it starts off as float32 and if you change the name to ‘FFTone_Mix’ it ends up as 4-plane, char.
----------begin_max5_patcher---------- 620.3oc0VFzaaBCEG+L4SwSbNCgefgvtsK8VOscappxAbRbEXGANZYqpe2G1 .sj1PBLkFkEI.wCad+8u7382OOywcoZOuxE9J7Svw44YNN1Pl.Ns263Vv1ml yprCyUx+kZ4StyadjluWaCqgkPUWT4tBgLmqsyfzFbKSmtQHW+XIOU2jQJ0y eNPHwlKAAlynumO7P6TDY12cc99Bg18xWojZIqfaez2JEr7doUsS2kWrMZSH 8u2xaRp6Rlbs6bv0807XdkUh+XG.A87MQeY1Lyo4iDKE7pJ1Z9G3hQovc28C kj+38h8GkP3vDJbgAJQjFN4aurX.BgSkPjgHzEkLophBtT+AxbOSWJ1CeWyJ 0UfZ0JfUA31bljCqxULMDfPFSy5lYtPxSU6j59LarkZXXCCiZJ4ng1Rtviix noRR+O+BoEQDf3igSsBhjXqZvCpjFnDBIe1kPDOZBkrH9BBlzMrxICEjzGJm 76JD+ODJStLILoOPnmDHA2v.Y.6ox5TyAayEaKDvHBHSTLUKqVN0XYgX7o7r vI2GIbPPMu2w0BZOIzdE1tzB4J0+FoHI1uzhomDT2lNWmEKf0cGarqpcqRBh GtG84QUTPOhM3FgtX6Cpdc7Xy5Xz6FxNFqQ761yncQYheHNqT6JS6xW213f2 VWY7JsPxzBkr+fNXLaDYYbYeW1BQ1VkPpa0.7vQ+ucRRhbaIIbLThdc0zHjD dUUzXfjoE70TRQiQSAGTvcVMQW3QMVyns6fe3q2cID64J7M69YJhkTaItHn9 WzaRNlbQkLdNISlnjSh8HQQQwnQjMFUgsRl9NIWeyKy9KnSZ98J -----------end_max5_patcher-----------
Apologies for the triple post….
I restarted my computer and no longer got the bug…. Which seems pretty weird, however, it seems more worrying since it’s obviously not a problem with using particular names, but something else.
Sounds like it may be an order of operations scenario. With your simple patch, I can’t reproduce. However, please see the following patch which demonstrates that if you tell an empty jit.matrix to be the name in question before setting one which has arguments, the one with arguments becomes a reference to the default 4 char 1 1 matrix rather than the other way around.
Kind of confusing, but this is how named buffer~s and colls work too. You need to be sensitive to that if you are using multiple references.
Please let us know if your problem seems to be related to something other than this hypothetical explanation.
----------begin_max5_patcher---------- 814.3ocyXFzaaBCEG+bxmhmxkcIKhmACjcaWp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5_patcher-----------
Yer I completely appreciate that the order of events is crucial. However, in my original patch, there appeared to be no other matrix that the name was referring to. When I uploaded that patch, there were no other Max windows open and I was getting the problem, it seemed that ‘FFTone_Mix’ had been assigned to [4 char] type even though the matrix no longer existed.
I can’t replicate this every time, but sometimes Max ‘remembers’ that one name was once assigned to a particular matrix type. Like I say, this doesn’t seem to happen every time but I have definitely had it occur a few times.
I have tested and re-tested this problem that I’ve been having. As maarten_wez says, it has something to do with the name being stored even after the patch is closed. The only way I’ve been able to simulate this is by doing a fairly long-winded process. This process involves deleting the matrix with a certain name and having it’s datatype remain associated with it.
Below is an example patch with (hopefully) demonstrates this.
----------begin_max5_patcher---------- 1142.3ocyX00ahiCE8Y3WwU7B6JQQwNIDXdqRSmoiT29PmtOrZZ0HCwTb2DG TrQkNil+6601IEnkTHcCL8A.EamiO2y8Ka9Y6VcFmsjq5.e.9Fzp0Oa2pkcH y.sJdtUmT1xIILkcYcljklxk5N8byo4K01w+3Ye5z+9hqKGeZlTKYob6beVj j.ekIUkyJhsimM99SHdkCJWjJjIbsceHqgiR7CKNDZeuhgmyzSlIj288b9Ds i9g9ivoApmYU.Izy8TeO31UaP1Bc4N3YF7Wsaa9p2dZ7obkhcG+EFuwRAUVJ WaH0YIJds0gfsJCz5KCgN6228imUTHCqTFJEZ2P5Gmyc3zoCb6ASgps5LroT G+PidLhX+163pMR9Cns7Bo4dgteJSmKVVaYwuwxcBrRQjUcBC1QpCsJcAMku WZJuUUppBLmpTh6jfdFGt5Ke97qgyO8xOBqDO6L1vrtOEm0+F4Iq8XWXLGgm q.lELdLnyfIyX4P.P.xMxajWZPv.0Em8oh8n.+0vAg85YBErZmkOAcEvsFme AdlBFFLe1HaksLDa6VfaPARl84JthKigusYd1sl23hy2XcBoPyRDpsakHKth eBp+7b67wLMy.RJ6eKdgRznvzjLlF7ovH+HrRCMvrAeYJ7X1BPl8fyYrw6rg uPngGLw1r4y4n8vP6D1twcIBlAms.RbFWI6pA9RgR2CFuPuJNPoMvmymxyUu pzgqFACXxGW4QQuqkcSXKPoB4JBfyerFJ13q+AM2ILIvRTXvTRFt73rGjNLr Ia77dHMNIaNFlfH8GHCy4cQvcLbLx2rxcdBKIA8zqYi+o4k2gVxPeuP20B1y 3XYhThPhSsPZylnAaqTyo4BVx15QSZn5LQ91RtCFZ91OHx9i+vFsGMFBnyja wJF8pFwVXKIx0CcHord3qVUrxtEiYXGuFsVXQR18KTZXgMSFC0ThXdOSTfBl h95N0wCG0PNXBw5SihbBG8.bFrJ5hpgwfpV1LIrwL5PW2yh342Z2SabRueCm 7pREh1PG6h3Yy3IT24tNxmIsprn+xUG8qZVtVAYSmZ5AQmmvj7U81LM.2dIz 5njCZnPMeOWsHpKhycRMyg2NBWxorKesBgnj8ODhzObTHYXT0lO0cqNeW3z. x6i61XiU7o0SWnMotTzhpTW7denK0TQ7aTEwcw2REI7cwM8xQ34fs.isLBX1 HHVjVOgpFES1agh5ZdQoQ6n6UPkJUu09bXterPNMqdRUS0guPjBsoYtaI+VN I3ARWbW2o3BYqcer50rug0Jp8bPjQjCwelfEKa+3m8mWZIjY7M0SU1h7Ik.W 7GJAqXTLGuIljoE3EGVsF+MVyLQbL2NcowmJhmmIj5BJTguceYTv6NFYN92N oj4TzGQNsOTxTf7XRoA6CmLtNx9yIB1rJzz+xcEzAAO8TSvVxtXKslrcXT+g 999zgOQYpOoQoLcWTlTOJSCi5SFLXP3.CICcGVnfxg+uo7yxJpH043lMGtGN 9iLk1mDmiJiFcfca3C+p8+ozjxtC -----------end_max5_patcher-----------
Thanks. I’m able to reproduce and am investigating. It actually seems like it might be related to jit.matrixinfo, route, or the setting of the message boxes, as the following patch doesn’t have the same issues, and I’ve never encountered this problem before in other patches.
Seems like a very subtle memory corruption bug, or some problems in jit.matrixinfo. Will try to fix for the next release.
Thanks for spotting this,
----------begin_max5_patcher---------- 1098.3ocyX08aZqCE+Y3uhi3E1jfp33vW2GtRUZcqSpqOz06CWsNMYHlh6Rr QwFA8Ns+2uGamTB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8dibvDp6vICB8sOC2INYMcQMvPnxS3t+N1hKfXe12j P8CT3IFJ8UX3zpXns9bLG94tHgNxfP8ycsaCkttrnu3qi9UCKynA03w1dPgS SXR9xda1FfUWB8oLY22n7KJwWrIxGN4G.iFcnFS02cMu+eo1+UEas2R9NPit RB8SqR66yDIUlC5jly8+nujmCQ65qxmZ0rrQEZdNO.K+bWwbrwuz8MxJuG5J aZhHNlKKGkjJhmpDRStNrFm69Tk5bzoQgutZTmMwu85qRjiJUZvQGI0eCznW 2rsniNMhDtItscoB.dyuq++vxqxBb -----------end_max5_patcher-----------
Errr. Scratch that. It seems like it’s still reproducible by repeating the steps a few times even without the jit.matrixinfo object in the patch. Tricky problem to track down.
Yer that’s one of the problems I had yesterday. The problem seemed to disappear all of a sudden. I wouldn’t have noticed it, if my patch didn’t start behaving weirdly.
I think one of the main issues is that the name remains allocated to the matrix type even after the patch is closed. So you could start a new patch, and you wouldn’t be able to dynamically rename your matrices with that name.
Finally solved this one for the next release. Thanks for finding it and providing clear steps to reproduce.
Forums > Jitter