Skip to content

[Type] Tensor 11: Higher-rank ndarray layout coverage#531

Draft
hughperkins wants to merge 4 commits intohp/tensor-stork-10from
hp/tensor-stork-11
Draft

[Type] Tensor 11: Higher-rank ndarray layout coverage#531
hughperkins wants to merge 4 commits intohp/tensor-stork-10from
hp/tensor-stork-11

Conversation

@hughperkins
Copy link
Copy Markdown
Collaborator

Test-only PR. PR 8's parametrized rank-3 test exercises every permutation on a single canonical cell. PR 11 widens that:

  • Rank 4: every permutation (24), full-grid value comparison.
  • Rank 5: 5 representative permutations (identity, full reverse, inner swap, cyclic shift, adjacent pair swaps), full-grid checks (32 cells).
  • Rank 6: 3 representative permutations, full-grid checks (64 cells).
  • Rank 4 + AugAssign + needs_grad on a non-trivial layout.
  • Rank 4 cross-check: tagged-with-layout vs direct-with-permuted-iteration produce the same physical buffer.

Quadrants supports up to quadrants_max_num_indices=12, so 6-D is well within the safe range; 5-D and 6-D ndranges become expensive at higher sizes so each axis is kept at 2.

34 tests, all pass.

Issue: #

Brief Summary

copilot:summary

Walkthrough

copilot:walkthrough

Test-only PR. PR 8's parametrized rank-3 test exercises every permutation
on a single canonical cell. PR 11 widens that:

- Rank 4: every permutation (24), full-grid value comparison.
- Rank 5: 5 representative permutations (identity, full reverse, inner
  swap, cyclic shift, adjacent pair swaps), full-grid checks (32 cells).
- Rank 6: 3 representative permutations, full-grid checks (64 cells).
- Rank 4 + AugAssign + needs_grad on a non-trivial layout.
- Rank 4 cross-check: tagged-with-layout vs direct-with-permuted-iteration
  produce the same physical buffer.

Quadrants supports up to ``quadrants_max_num_indices=12``, so 6-D is well
within the safe range; 5-D and 6-D ndranges become expensive at higher
sizes so each axis is kept at 2.

34 tests, all pass.
Drops the 'flexible' prefix from filenames and identifiers introduced
in this branch series so the user-visible names are simply 'tensor'.
Also strips PR-N back-references that will be meaningless once these
PRs land. Touches only files owned by this series (no changes to
external/ or unrelated tests).
- Apply black/ruff fixes to _tensor.py and tests; sort imports.
- Silence pylint C0415 on intentional late imports in _tensor.py
  (needed to break circular dependencies).
- Drop broken #fields / #ndarrays anchor links in tensor.md;
  no such headings exist on the page.

Made-with: Cursor
…or-stork-11

Made-with: Cursor

# Conflicts:
#	docs/source/user_guide/tensor.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant