Skip to content

♻️ Use LLVM results for compiler Program APIs - #2733

Merged
burgholzer merged 3 commits into
mainfrom
codex/compiler-program-results
Oct 10, 2026
Merged

burgholzer merged 3 commits into
mainfrom
codex/compiler-program-results

Conversation

@burgholzer

@burgholzer burgholzer commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Description

Compiler Program APIs currently convert MLIR results to bool or std::optional, and callers convert them back. Use LLVM's LogicalResult and FailureOr<T> directly in fallible Program operations and the benchmark generators that produce Programs. Remove the private boolean linearity wrapper and the OpenQASM binding's optional-to-result conversion.

This extracts the independent Program API cleanup from #2545. Ownership, diagnostics, Python APIs, and Python exception categories are preserved. C++ callers must replace boolean or has_value() checks on these results with failed() or succeeded(); the source-tree API example documents this migration.

Two separate commits restore the HOME/.config fallback when XDG_CONFIG_HOME is empty and remove the configuration paragraph about empty environment variables. The registry regression covers both unset and empty XDG values.

Codex implemented the changes, ran local validation, and performed the requested ponytail review. The review found no actionable correctness or simplification issues.

Validation on Linux aarch64 with GCC 13.3, LLVM/MLIR 23.1, and Python 3.14:

  • Release build and CTest: 4,006 tests passed, one existing test skipped.
  • Rebuilt wheel: all 1,960 Python tests passed.
  • Stub generation: passed with no generated API changes.
  • Repository lint and whole-file C++ lint across 31 files: passed.
  • Executable documentation and local documentation links: passed after clearing stale generated pages from ♻️ Return owned errors at native boundaries #2545.

Windows, macOS, and hosted CI results remain to be checked.

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

🤖 *AI text below* 🤖

Return FailureOr and LogicalResult from fallible Program operations and
their benchmark generators. Forward MLIR results directly while preserving
diagnostics, ownership and Python exception behavior.

Update callers, tests and the C++ example, and remove the private boolean
linearity wrapper.

Assisted-by: Codex
🤖 *AI text below* 🤖

Use HOME/.config when XDG_CONFIG_HOME is unset or empty, as required by
the XDG contract. Cover both cases in the registry tests.

Assisted-by: Codex
🤖 *AI text below* 🤖

Remove the requested paragraph about empty configuration variables.

Assisted-by: Codex
@burgholzer burgholzer added refactor Anything related to code refactoring fix Fix for something that isn't working MLIR Anything related to MLIR labels Oct 10, 2026
@burgholzer burgholzer self-assigned this Oct 10, 2026
@burgholzer burgholzer added this to the v4.1.0 - QDMI 1.4 / MQSF milestone Oct 10, 2026
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

@burgholzer
burgholzer enabled auto-merge (squash) October 10, 2026 17:37
@burgholzer
burgholzer merged commit b35d333 into main Oct 10, 2026
25 of 26 checks passed
@burgholzer
burgholzer deleted the codex/compiler-program-results branch October 10, 2026 17:45
burgholzer added a commit that referenced this pull request Oct 10, 2026
🤖 *AI text below* 🤖

Record the remaining QIR lifetime, QDMI allocation recovery, Python
compatibility, and documentation findings after rebasing on #2733.
Keep the proposed fixes separate from the rebase and distinguish passing
local suites from the failed documentation build and untested platforms.

Assisted-by: GPT-6 via Codex
burgholzer added a commit that referenced this pull request Oct 10, 2026
🤖 *AI text below* 🤖

Record the remaining QIR lifetime, QDMI allocation recovery, Python
compatibility, and documentation findings after rebasing on #2733.
Keep the proposed fixes separate from the rebase and distinguish passing
local suites from the failed documentation build and untested platforms.

Assisted-by: GPT-6 via Codex
burgholzer added a commit that referenced this pull request Oct 12, 2026
🤖 *AI text below* 🤖

Record the remaining QIR lifetime, QDMI allocation recovery, Python
compatibility, and documentation findings after rebasing on #2733.
Keep the proposed fixes separate from the rebase and distinguish passing
local suites from the failed documentation build and untested platforms.

Assisted-by: GPT-6 via Codex
burgholzer added a commit that referenced this pull request Oct 17, 2026
🤖 *AI text below* 🤖

Record the remaining QIR lifetime, QDMI allocation recovery, Python
compatibility, and documentation findings after rebasing on #2733.
Keep the proposed fixes separate from the rebase and distinguish passing
local suites from the failed documentation build and untested platforms.

Assisted-by: GPT-6 via Codex
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 refactor Anything related to code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant