Skip to content

[Type] Tensor 9: Extended AugAssign coverage for layout-tagged…#529

Draft
hughperkins wants to merge 7 commits intohp/tensor-stork-8from
hp/tensor-stork-9
Draft

[Type] Tensor 9: Extended AugAssign coverage for layout-tagged…#529
hughperkins wants to merge 7 commits intohp/tensor-stork-8from
hp/tensor-stork-9

Conversation

@hughperkins
Copy link
Copy Markdown
Collaborator

… ndarrays

Test-only PR pinning down the trickier subscript-rewrite paths that PR 8 covered only at the basic-AugAssign level:

  • All standard operators on the same canonical cell (+=, -=, *=, //=, %=) through one composite kernel.
  • Each AugAssign operator in its own kernel: +=, -=, *=, //=, %=, &=, |=, ^=
  • Read-and-write of the same canonical index in one statement (x[i, j] = x[i, j] * 2 + x[i, j]).
  • Neighbour dependence along a canonical axis (cumulative scan).
  • Mixed layout-tagged + untagged ndarrays in the same kernel — the rewrite must apply only to the tagged operand.
  • Three layout-tagged operands consumed by one composite expression.

11 tests, all pass.

Issue: #

Brief Summary

copilot:summary

Walkthrough

copilot:walkthrough

… ndarrays

Test-only PR pinning down the trickier subscript-rewrite paths that PR 8
covered only at the basic-AugAssign level:

- All standard operators on the same canonical cell (+=, -=, *=, //=, %=)
  through one composite kernel.
- Each AugAssign operator in its own kernel: +=, -=, *=, //=, %=, &=, |=, ^=
- Read-and-write of the same canonical index in one statement
  (``x[i, j] = x[i, j] * 2 + x[i, j]``).
- Neighbour dependence along a canonical axis (cumulative scan).
- Mixed layout-tagged + untagged ndarrays in the same kernel — the rewrite
  must apply only to the tagged operand.
- Three layout-tagged operands consumed by one composite expression.

11 tests, all pass.
@@ -0,0 +1,322 @@
"""Extended AugAssign coverage for layout-tagged ndarrays (PR 9).
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

lets not mention pr numbers

@@ -0,0 +1,322 @@
"""Extended AugAssign coverage for layout-tagged ndarrays (PR 9).

PR 8 already covered the basic ``x[i, j] += scalar`` case. This file
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

lets not mention pr numbers

@hughperkins hughperkins force-pushed the hp/tensor-stork-9 branch 2 times, most recently from 732d1ca to af5e3be Compare April 20, 2026 20:59
The intro paragraph linked to `#fields` and `#ndarrays`, which never
existed as headings on this page. The next paragraph already points
readers at `tensor_types.md` for the underlying primitives, so just
demote the broken links to plain code spans to satisfy
markdown-link-check.

Made-with: Cursor
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).
- Hoist a module-level pylint disable for import-outside-toplevel in
  python/quadrants/_tensor.py so the deliberate late imports (used to
  break circular dependencies with quadrants.lang and quadrants.types)
  do not trip pylint, without forcing black to balloon the import lines.
- Reformat long raise statements in _tensor.py per black.
- Apply ruff I001 import-order fixes to python/quadrants/__init__.py
  and the three new tensor test files.

Made-with: Cursor
…r-stork-9

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