awkward icon indicating copy to clipboard operation
awkward copied to clipboard

`NumpyArray.deep_copy` produces different array (v1)

Open agoose77 opened this issue 3 years ago • 2 comments

Version of Awkward Array

1.8.0

Description and code to reproduce

Currently, I can't find a reproducer besides the runtime state of my open interpreter.

NumpyArray.deep_copy is not correctly copying a particular array that I have. The array that is being copied is:

  • contiguous (x.contiguous().ptr == x.ptr)
  • bool with 327 entries

The resulting copy has periodic contents, though the pattern itself seems random.

I'm filing this issue to keep tabs on this, in case anyone else runs into it.

agoose77 avatar Jun 05 '22 14:06 agoose77

I'm marking any issue you, @ianna, or @ioanaif find as being verified bugs.

The reason I have the "bug (unverified)" label is to know when I/we have done triage or not. (I suppose a separate "triage" label could have worked, too.) Some purported bugs are not bugs but usage questions, and the bug report defaulting to "unverified" is a reminder that the issue might be solved by an explanation, rather than a code change. All of you can promote "bug (unverified)" to "bug", too. Just letting you know!

jpivarski avatar Jun 14 '22 21:06 jpivarski

Thanks Jim. I've been working on "only me reporting" as "unverified", unless it's a very clear instance of a bug. I'm happy to take the promotion!

agoose77 avatar Jun 14 '22 21:06 agoose77

Hmmm. I can't reproduce it:

>>> import awkward as ak
>>> array = ak.layout.NumpyArray(np.random.randint(0, 2, 327, dtype=np.bool_))
>>> array2 = array.deep_copy()
>>> ak.to_list(array) == ak.to_list(array2)
True

I can see the value in "Have you seen me?" posters for possible bugs, so that if somebody runs into it again, information about it can be pooled and more quickly lead to a solution. However, I'm using the mainline issues tab as a to-do list of work to resolve, and so if something isn't reproducible, it is getting in the way. (I don't want to leave it there potentially forever, mentally reminding myself that it's not work to-do.)

Also, deep_copy is a C++ function in v1, this sounds like a memory corruption issue, which is much less likely in v2.

So I'm closing this issue.

(We might want to develop some sort of "Have you seen me?" place for possible bugs... maybe an issue label that we can filter out. I can see now why you picked "bug (unverified)", but that label is for requesting triage, like the test I just did above.)

jpivarski avatar Aug 15 '22 20:08 jpivarski