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

Adds an array reference type #1440

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open

Commits on Oct 14, 2024

  1. Adds an array reference type.

    The reference type, `RefBase<A, D, R>`, is parameterized by its element
    type, a dimensionality type, and its "referent" type. This last type
    is only a `PhantomData` marker, and acts to differentiate references
    that are "safe" from those that are "raw", i.e., references that come
    from an array whose storage is `Data` vs an array whose stoarge is
    `RawData`. The `DerefMut` implementation contains a check of uniqueness,
    guaranteeing that an `&mut RefBase` is safe to mutate.
    
    This comes with one breaking change and one important internal library
    note. The breaking change is that `ArrayBase` no longer implements `Copy`
    for views. This is because a `RefBase` does not know where it is pointing,
    and therefore cannot implement `Copy`; this, in turn, prohibits
    `ArrayBase` from implementing `Copy`. Users will now have to explicitly
    invoke `Clone` in the same way that they do for non-view arrays.
    
    The important library note has to do with the `.try_ensure_unique` check
    that occurs in the `DerefMut` implementation. The library's methods are
    allowed to *temporarily* break the invariant that an array's `ptr`
    is contained within `data`. The issue comes when trying to then alter
    `ptr`, `shape`, or `dim` while that invariant is broken. Code was
    using `self.ptr = ...` (where `self` is `ArrayBase`), which triggers
    `DerefMut`, which calls `try_ensure_unique`, which panics on the
    pointer inbounds check. As a result, code that is altering `RefBase`
    fields while the array's invariants are broken must be sure to write
    `self.aref.ptr = ...` instead.
    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    99722fa View commit details
    Browse the repository at this point in the history
  2. Adds some documentation

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    44079cc View commit details
    Browse the repository at this point in the history
  3. Fixes some CI/CD issues

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    3d32c08 View commit details
    Browse the repository at this point in the history
  4. More CI/CD fixes

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    8bf86df View commit details
    Browse the repository at this point in the history
  5. Last CI/CD fix?

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    dda4b66 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3c75150 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    28fea66 View commit details
    Browse the repository at this point in the history
  8. Removes unused import

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    3a180c1 View commit details
    Browse the repository at this point in the history
  9. Introduces LayoutRef and starts to move functionality from ArrayBase …

    …to RefBase and LayoutRef
    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    6b64678 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    4c440a8 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    c183903 View commit details
    Browse the repository at this point in the history
  12. Satisfying CI/CD

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    476dac5 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    68d6f53 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    2fde998 View commit details
    Browse the repository at this point in the history
  15. Satisfying CI/CD

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    d63d26e View commit details
    Browse the repository at this point in the history
  16. Adds some aliases to avoid breaking changes, and adds an example of h…

    …ow to write functionality with the new types
    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    b7281f5 View commit details
    Browse the repository at this point in the history
  17. Adds Borrow and ToOwned

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    663e2f9 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5204f68 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    6a3d131 View commit details
    Browse the repository at this point in the history
  20. Implicitly use deref

    akern40 committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    289130d View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2024

  1. Configuration menu
    Copy the full SHA
    db52eab View commit details
    Browse the repository at this point in the history
  2. Fixes doc links

    akern40 committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    2b34bf8 View commit details
    Browse the repository at this point in the history
  3. Adds formatting for ArrayRef

    akern40 committed Oct 20, 2024
    Configuration menu
    Copy the full SHA
    a40307b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5adbb31 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6e61e83 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0cd4334 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f77ad96 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2024

  1. Configuration menu
    Copy the full SHA
    3888399 View commit details
    Browse the repository at this point in the history
  2. Adds a short snippet of documentation for RawRef and some top-level…

    … bullets on the new types
    akern40 committed Oct 21, 2024
    Configuration menu
    Copy the full SHA
    0a3cad3 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2024

  1. Configuration menu
    Copy the full SHA
    cbed837 View commit details
    Browse the repository at this point in the history
  2. Restore remove_index to DataOwned

    I think I accidentally moved this over to ArrayRef, but we're not sure it should still require DataOwned
    akern40 committed Oct 26, 2024
    Configuration menu
    Copy the full SHA
    945f70d View commit details
    Browse the repository at this point in the history
  3. Fixes unused imports

    akern40 committed Oct 26, 2024
    Configuration menu
    Copy the full SHA
    93dfb38 View commit details
    Browse the repository at this point in the history