Skip to content

🐛 Traverse reordered while tensors#1936

Merged
burgholzer merged 4 commits into
mainfrom
agent/1910-qtensor-while
Jul 24, 2026
Merged

🐛 Traverse reordered while tensors#1936
burgholzer merged 4 commits into
mainfrom
agent/1910-qtensor-while

Conversation

@burgholzer

@burgholzer burgholzer commented Jul 24, 2026

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Summary

  • Teach TensorIterator to follow tensor values through scf.while.
  • Resolve the actual before-region argument → condition operand → result mapping
    instead of assuming positional identity.
  • Support backward traversal from a while result to its corresponding init
    value.
  • Add a regression test with reordered classical and tensor values.
  • Add this general SCF/QTensor fix to the existing MLIR infrastructure changelog
    entry.

Context

This general SCF/QTensor issue was found while working on loop lowering for the
OpenQASM integration in #1910. It is independent of the frontend and applies to
any pipeline that carries linearly typed quantum tensors through scf.while.

Validation

  • QTensor utility tests: 2 passed
  • uvx prek run --from-ref origin/main --to-ref HEAD
  • git diff --check origin/main...HEAD

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mlir/lib/Dialect/QTensor/Utils/TensorIterator.cpp 76.4% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@denialhaag denialhaag added fix Fix for something that isn't working MLIR Anything related to MLIR labels Jul 24, 2026
@denialhaag denialhaag added this to the MLIR Support milestone Jul 24, 2026
@mergify mergify Bot added the conflict label Jul 24, 2026
Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6 via Codex
@burgholzer
burgholzer force-pushed the agent/1910-qtensor-while branch from fbb0e31 to 21a394a Compare July 24, 2026 16:08
@mergify mergify Bot removed the conflict label Jul 24, 2026
@burgholzer
burgholzer marked this pull request as ready for review July 24, 2026 16:27
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
@burgholzer burgholzer self-assigned this Jul 24, 2026
@burgholzer
burgholzer enabled auto-merge (squash) July 24, 2026 17:58
@burgholzer
burgholzer disabled auto-merge July 24, 2026 18:14
@burgholzer
burgholzer merged commit 5a5ec13 into main Jul 24, 2026
27 of 28 checks passed
@burgholzer
burgholzer deleted the agent/1910-qtensor-while branch July 24, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix for something that isn't working MLIR Anything related to MLIR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants