Skip to content

[mdspan.sub.sub] Fix submdspan slice canonicalization#8996

Merged
tkoeppe merged 1 commit into
cplusplus:mainfrom
abhinavagarwal07:fix-submdspan-canonicalize
May 12, 2026
Merged

[mdspan.sub.sub] Fix submdspan slice canonicalization#8996
tkoeppe merged 1 commit into
cplusplus:mainfrom
abhinavagarwal07:fix-submdspan-canonicalize

Conversation

@abhinavagarwal07
Copy link
Copy Markdown
Contributor

Two integration errors in submdspan's slice canonicalization Let clause introduced by P3663R3:

  • the function parameter pack is named slices, but the Let clause references an undefined raw_slices; rename the parameter to match subextents ([mdspan.sub.extents]).
  • src is an mdspan but canonical_slices takes an extents object ([mdspan.sub.canonical]); pass src.extents() instead of src.

Two integration errors in the Let clause introduced by P3663R3:
- the function parameter pack is named "slices", but the Let clause
  references an undefined "raw_slices"; rename the parameter to match
  subextents (mdspan.sub.extents);
- src is an mdspan but canonical_slices takes an extents object;
  pass src.extents() instead of src.
@eisenwave eisenwave added the P1-Important Misapplication of paper, malformed code, internal inconsistencies label Apr 27, 2026
@jwakely jwakely requested a review from tomaszkam May 12, 2026 09:46
Comment thread source/containers.tex
constexpr auto submdspan(
const mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>& src,
SliceSpecifiers... slices) -> @\seebelow@;
SliceSpecifiers... raw_slices) -> @\seebelow@;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread source/containers.tex
constexpr auto submdspan(
const mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>& src,
SliceSpecifiers... slices) -> @\seebelow@;
SliceSpecifiers... raw_slices) -> @\seebelow@;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have been changed by the paper, to match the change to [mdspan.sub.sub] in the paper.

Comment thread source/containers.tex
Let \tcode{slices} be the pack introduced by the following declaration:
\begin{codeblock}
auto [...slices] = canonical_slices(src, raw_slices...);
auto [...slices] = canonical_slices(src.extents(), raw_slices...);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bug in the paper.

@tkoeppe tkoeppe merged commit 7c2e7f8 into cplusplus:main May 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1-Important Misapplication of paper, malformed code, internal inconsistencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants