Mapping comparison operators are not constrained properly
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 507
- Forks
- 87
- Avg merge
- 15h 27m
- Merged PRs (30d)
- 2
Description
For instance with layout_right, the standard says
template<class OtherExtents> friend constexpr bool operator==(const mapping& x, const mapping<OtherExtents>& y) noexcept;Constraints:
extents_type::rank() == OtherExtents::rank()istrue.
Effects: Equivalent to:return x.extents() == y.extents();
and our implementation does
https://github.com/kokkos/mdspan/blob/26f4d3aaeead1e2ac2d892737c5b488136653620/include/experimental/__p0009_bits/layout_left.hpp#L190-L194
I realized that as I was reviewing Chrisitan's tests for libcxx
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the comparison operators in include/experimental/__p0009_bits/layout_left.hpp and the corresponding mapping implementations, then compare their constraints with the linked C++ standard wording for layout_right. Check the libcxx tests mentioned in the issue for expected coverage. Done means mapping comparisons reject extents with different ranks while preserving the stated equality behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100