[Chapel Merge] Address issues with the widePtrArrayAssignment tes

Branch: refs/heads/master
Revision: f56d983
Author: e-kayrakli
Log Message:

Merge pull request #17659 from e-kayrakli/adjust-widePtrArrayAssignment

Address issues with the widePtrArrayAssignment test

This test was failing sporadically. It was due to my wrong assumptions while
writing this test. This PR adjusts that.

Resolves https://github.com/Cray/chapel-private/issues/1597

Assume you have an array of unmanaged classes. This array is basically an
array of pointers. When bulk-copied, to check for correctness of the copy, we
compare (wide) pointers in the source and destination arrays. In this test, we
do this by looking at the address and the locale of the wide pointers using
compiler primitives

Now, because owned and shared classes cannot be copied in bulk (at least not
easily), we don't do bulk transfer for those. I wanted this test to make sure we
don't bulk copy such arrays. And my mistake was there. I naively compared wide
pointers to owneds and shareds, thinking that they should differ between the
source and destination arrays because we don't bulk-copy them. My thinking there
was that bulk-copying them creates different instances, so those wide pointers
should point to strictly different addresses. This is not the right way to think
about this copy.

But more than that; owned and shared are actually record-wrapped classes.
And what this test was comparing was the location of those records on both
locales. Which doesn't really mean anything and can be the same based on the
memory allocator's decisions (which had been brought up by @ronawho before).
i.e. the DR array's data that contains the shared/owned records that wrap the
actual instances can be on the same address in different locales.

To address that this PR makes the test into a commcount test. It also comments
out the options that checks transfer of shared and owned arrays. Those cases
aren't optimized and show different behaviors. I think tracking their commcounts
does not bring too much value and can create test maintanance burden.

[New test approach OK'd by @ronawho]


  • [x] gasnet.asan with 1000 trials (which used to fail >10 times before)

    Modified Files:
    M test/optimizations/bulkcomm/ptrArray/widePtrArrayAssignment.chpl
    M test/optimizations/bulkcomm/ptrArray/widePtrArrayAssignment.compopts
    M test/optimizations/bulkcomm/ptrArray/widePtrArrayAssignment.good

    Compare: Comparing d70a5d19c726...f56d9832ce00 · chapel-lang/chapel · GitHub