[Type] Tensor 10: Layout aliasing across supported Quadrants p…#530
Draft
hughperkins wants to merge 4 commits intohp/tensor-stork-9from
Draft
[Type] Tensor 10: Layout aliasing across supported Quadrants p…#530hughperkins wants to merge 4 commits intohp/tensor-stork-9from
hughperkins wants to merge 4 commits intohp/tensor-stork-9from
Conversation
…atterns Test-only PR. Investigation found that in-kernel rebinding (``y = x``) is **not** supported by Quadrants for any ndarray — that's an upstream limitation that raises ``QuadrantsTypeError: Invalid constant scalar data type: AnyArray`` regardless of layout. The test file's docstring spells this out explicitly. This PR pins down the aliasing patterns that Quadrants does support and that flexible-tensors layout metadata must propagate through: 1. Same Ndarray passed twice to the same kernel: both AnyArrays get the same layout via the runtime feature tuple. 2. Same Ndarray reused across two consecutive kernel calls: layout persists. 3. Repeated ``.grad`` access inside a single kernel: each access inherits layout from the parent AnyArray. 4. Same Ndarray bound to two kernels with different parameter names but compatible annotations: layout travels with the value, not the annotation. 5. Tagged + untagged ndarrays in the same kernel: layout isolation per argument. 6. Two separately-allocated tagged ndarrays: independence. 6 tests, all pass.
hughperkins
commented
Apr 20, 2026
| @@ -0,0 +1,195 @@ | |||
| """Aliasing of layout metadata across the supported Quadrants aliasing | |||
Collaborator
Author
There was a problem hiding this comment.
lets not mention pr numbers
Collaborator
Author
There was a problem hiding this comment.
also lets put all these tests into a single file probably, across all the prs.
fb5eb4f to
f8c9fbd
Compare
732d1ca to
af5e3be
Compare
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).
- black/ruff/pylint cleanups in python/quadrants/_tensor.py and the three new tensor test files (plus the import-block ordering nudged by the rename in python/quadrants/__init__.py). The pylint disable for the intentional late imports is hoisted to the module level so it does not force black to balloon the import lines (which then re-broke ruff). - Replace the broken `#fields` / `#ndarrays` in-page anchors in tensor.md with a single link to tensor_types.md, which is the actual page where field vs ndarray are described. Made-with: Cursor
…r-stork-10 Made-with: Cursor # Conflicts: # docs/source/user_guide/tensor.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…atterns
Test-only PR. Investigation found that in-kernel rebinding (
y = x) is not supported by Quadrants for any ndarray — that's an upstream limitation that raisesQuadrantsTypeError: Invalid constant scalar data type: AnyArrayregardless of layout. The test file's docstring spells this out explicitly.This PR pins down the aliasing patterns that Quadrants does support and that flexible-tensors layout metadata must propagate through:
.gradaccess inside a single kernel: each access inherits layout from the parent AnyArray.6 tests, all pass.
Issue: #
Brief Summary
copilot:summary
Walkthrough
copilot:walkthrough