17069, “e-kayrakli”, “DSI interface for checking whether two domains/arrays are aligned”, “2021-02-01T17:48:22Z”

We have equality checks for distributions that are implemented via `dsiEqualDMaps`

. This can be used to check whether two domains have the same distribution, but that doesn’t necessarily guarantee that domains are aligned.

It would be great to have some method on domains that checks given two domains, all the indices that are at the same offset from the beginning of the domain are mapped to the same distribution. Note that this shouldn’t limit the check to the overlapping indices, because I believe distribution equality check covers for such indices.

The practical purpose for this is to optimize some zippered foralls where we can check dynamically that the followers are aligned with the leader where we can do something like:

```
if A.isAlignedWith(B);
forall (a,b) in zip(A,B) {
assert(a.locale == b.locale);
}
```

Some cases that I am hoping this interface cover, where distribution equality doesn’t:

- Consider
`A`

and`B`

to be 4x1 domains (or rank-change domains from a 4x4 one), using a distribution with a 4x4 bounding box:

```
A> B
A> B
```