Skip to content

Commit 27ed885

Browse files
burgholzermqt-app[bot]renovate[bot]denialhaagsimon1hofmann
authored
🔀 Backport selected main changes for MQT Core 3.8.0 (#1966)
🤖 *AI text below* 🤖 ## Description Backport selected changes from `main` to the maintained `v3.x` branch in preparation for MQT Core 3.8.0. The commits are kept separate by upstream change wherever practical. The series includes: - configurable QDMI device discovery and stable-ID registration from #1912 - binary-safe FoMaC/QDMI program handling from #1957 - CMake subproject composability and individually selectable bundled QDMI devices from the current #1965 head (`cdc740398e472c19b585cf6dbd7d41de053d84a6`) - optional QIR support for the DDSIM QDMI device and the associated QIR runtime improvements - native RCCX support and the bottom-up DD construction path - Python CI performance improvements from #1944 - template synchronization through #1964, agent/contributor guide updates, dependency and pre-commit updates, and related maintenance ## v3 compatibility This backport deliberately preserves the v3 architecture: - LLVM/MLIR remains optional and continues to use LLVM/MLIR 21. - QIR support is available behind the existing MLIR-dependent feature flags. - The mandatory LLVM/MLIR 22 transition from #1953 and compiler-collection changes that depend on the v4 MLIR/QCO redesign are not included. - #1965 is adapted to retain optional MLIR and the v3 documentation roles while preserving its CMake and QDMI behavior. ## Validation - configured and built the complete non-MLIR library - configured the MLIR build against LLVM/MLIR 21.1.8 - built and ran focused DD, FoMaC, QDMI driver/registry/device, and QIR tests - verified 435 #1965-affected C++ test cases, with two expected device capability skips - configured MQT Core as an embedded CMake subproject with all bundled devices disabled by default - configured an embedded build with only the DDSIM QDMI device enabled - built and ran the device-free registry suite: 11 tests passed - focused Python FoMaC suite: 181 passed, two expected non-MLIR skips - regenerated Python stubs without a diff - complete lint, lockfile validation, commit-signature audit, and `git diff --check` passed The pre-existing v3 test configuration still requires `llc` even when MLIR is disabled. The non-MLIR library build itself succeeds; MLIR/QIR validation used LLVM/MLIR 21. ## Checklist - [x] The pull request only contains commits that are focused and relevant to this change. - [x] I have added appropriate tests that cover the new/changed functionality. - [x] I have updated the documentation to reflect these changes. - [x] I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals. - [x] I have added migration instructions to the upgrade guide (if needed). - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes. **If PR contains AI-assisted content:** - [x] Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines. - [x] Every agent-authored or agent-edited public text body begins with the visible disclosure `🤖 *AI text below* 🤖` (titles are exempt). - [x] I have disclosed AI assistance in the PR description. - [x] I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it. --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Signed-off-by: Lukas Burgholzer <burgholzer@me.com> Signed-off-by: Roberto Turrado Camblor <rturrado@gmail.com> Signed-off-by: rturrado <rturrado@gmail.com> Co-authored-by: mqt-app[bot] <219534693+mqt-app[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Co-authored-by: simon1hofmann <119581649+simon1hofmann@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Roberto Turrado Camblor <rturrado@gmail.com> Co-authored-by: Yannick Stade <100073938+ystade@users.noreply.github.com>
1 parent 73c364f commit 27ed885

143 files changed

Lines changed: 25911 additions & 1992 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agent/PLANS.md

Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
# Codex Execution Plans (ExecPlans)
2+
3+
This document describes the requirements for an execution plan ("ExecPlan"), a
4+
design document that a coding agent can follow to deliver a working feature or
5+
system change. Treat the reader as a complete beginner to this repository: they
6+
have only the current working tree and the single ExecPlan file you provide.
7+
There is no memory of prior plans and no external context.
8+
9+
## How to use ExecPlans and PLANS.md
10+
11+
When authoring an executable specification (ExecPlan), follow PLANS.md
12+
_to the letter_. If it is not in your context, refresh your memory by reading
13+
the entire PLANS.md file. Be thorough in reading (and re-reading) source
14+
material to produce an accurate specification. When creating a spec, start from
15+
the skeleton and flesh it out as you do your research.
16+
17+
When implementing an executable specification (ExecPlan), do not prompt the user
18+
for "next steps"; simply proceed to the next milestone. Keep all sections up to
19+
date, add or split entries in the list at every stopping point to affirmatively
20+
state the progress made and next steps. Resolve ambiguities autonomously, and
21+
commit frequently.
22+
23+
When discussing an executable specification (ExecPlan), record decisions in a
24+
log in the spec for posterity; it should be unambiguously clear why any change
25+
to the specification was made. ExecPlans are living documents, and it should
26+
always be possible to restart from _only_ the ExecPlan and no other work.
27+
28+
When researching a design with challenging requirements or significant unknowns,
29+
use milestones to implement proof of concepts, "toy implementations", and
30+
similar work that validates whether the proposal is feasible. Read relevant
31+
library source code, research deeply, and include prototypes that guide a fuller
32+
implementation.
33+
34+
## Requirements
35+
36+
NON-NEGOTIABLE REQUIREMENTS:
37+
38+
- Every ExecPlan must be fully self-contained. Self-contained means that in its
39+
current form it contains all knowledge and instructions needed for a novice to
40+
succeed.
41+
- Every ExecPlan is a living document. Contributors are required to revise it as
42+
progress is made, discoveries occur, and design decisions are finalized. Each
43+
revision must remain fully self-contained.
44+
- Every ExecPlan must enable a complete novice to implement the feature
45+
end-to-end without prior knowledge of this repository.
46+
- Every ExecPlan must produce demonstrably working behavior, not merely code
47+
changes that meet a definition.
48+
- Every ExecPlan must define every term of art in plain language or not use it.
49+
50+
Purpose and intent come first. Begin by explaining, in a few sentences, why the
51+
work matters from a user's perspective: what someone can do after this change
52+
that they could not do before, and how to see it working. Then guide the reader
53+
through the exact steps to achieve that outcome, including what to edit, what to
54+
run, and what they should observe.
55+
56+
The agent executing the plan can list files, read files, search, run the
57+
project, and run tests. It does not know prior context and cannot infer intent
58+
from earlier milestones. Repeat every assumption the plan relies on. Do not
59+
point to external blogs or documentation; embed required knowledge in the plan
60+
in your own words. If an ExecPlan builds on a checked-in prior ExecPlan,
61+
incorporate it by reference. Otherwise, include all relevant context from that
62+
plan.
63+
64+
## Formatting
65+
66+
Format and envelope are simple and strict. Each ExecPlan must be one single
67+
fenced code block labeled `md` that begins and ends with triple backticks. Do
68+
not nest additional triple-backtick code fences inside it. Present commands,
69+
transcripts, diffs, and code as indented text within that single fence instead.
70+
Use indentation for clarity rather than code fences that could prematurely close
71+
the ExecPlan.
72+
73+
Use two newlines after every heading, use `#`, `##`, and deeper headings
74+
correctly, and use correct ordered and unordered list syntax. When writing an
75+
ExecPlan to a Markdown file whose content is only that single ExecPlan, omit the
76+
outer triple backticks.
77+
78+
Write in plain prose. Prefer sentences over lists. Avoid checklists, tables, and
79+
long enumerations unless brevity would obscure meaning. Checklists are permitted
80+
only in the `Progress` section, where they are mandatory. Narrative sections
81+
must remain prose-first.
82+
83+
## Guidelines
84+
85+
Self-containment and plain language are paramount. If you introduce a phrase
86+
that is not ordinary English, define it immediately and explain how it appears
87+
in this repository by naming the files or commands where it occurs. Do not say
88+
"as defined previously" or "according to the architecture document." Include the
89+
needed explanation in the ExecPlan, even if that repeats information.
90+
91+
Avoid common failure modes. Do not rely on undefined jargon. Do not describe a
92+
feature so narrowly that the resulting code compiles but does nothing
93+
meaningful. Do not outsource key decisions to the reader. When ambiguity exists,
94+
resolve it in the plan and explain why. Err on the side of over-explaining
95+
user-visible effects and under-specifying incidental implementation details.
96+
97+
Anchor the plan with observable outcomes. State what the user can do after
98+
implementation, the commands to run, and the outputs they should see. Acceptance
99+
should be phrased as behavior a human can verify rather than internal
100+
attributes. If a change is internal, explain how to demonstrate its impact, for
101+
example with a test that fails before the change and passes after it or through
102+
a small end-to-end scenario.
103+
104+
Specify repository context explicitly. Name files with full repository-relative
105+
paths, functions and modules precisely, and where new files belong. If touching
106+
multiple areas, include a short orientation paragraph explaining how those parts
107+
fit together. When running commands, show the working directory and exact
108+
command line. State environment assumptions and reasonable alternatives.
109+
110+
Be idempotent and safe. Write steps that can be repeated without damage or
111+
drift. If a step can fail halfway, include how to retry or adapt. If a migration
112+
or destructive operation is necessary, spell out backups or safe fallbacks.
113+
Prefer additive, testable changes that can be validated as work proceeds.
114+
115+
Validation is not optional. Include instructions to run tests, start the system
116+
when applicable, and observe useful behavior. Describe comprehensive tests for
117+
new capabilities. Include expected outputs and error messages so a novice can
118+
distinguish success from failure. Where possible, prove the change beyond
119+
compilation through an end-to-end scenario, CLI invocation, or equivalent. State
120+
the project's exact test commands and how to interpret their results.
121+
122+
Capture evidence. Put concise, focused transcripts, diffs, and logs inside the
123+
ExecPlan when they prove success. Prefer file-scoped diffs or small excerpts to
124+
large patches.
125+
126+
## Milestones
127+
128+
Milestones are narrative, not bureaucracy. Introduce each milestone with a short
129+
paragraph describing its scope, what will exist at its end, the commands to run,
130+
and the acceptance to observe. Keep the sequence readable as a story: goal,
131+
work, result, proof. Progress and milestones are distinct: milestones tell the
132+
story, while progress tracks granular work. Both must exist.
133+
134+
Never abbreviate a milestone merely for brevity or omit details crucial to a
135+
future implementation. Each milestone must be independently verifiable and
136+
incrementally implement the overall goal.
137+
138+
## Living plans and design decisions
139+
140+
- ExecPlans are living documents. Record each key design decision and its
141+
rationale in the `Decision Log`.
142+
- Every ExecPlan must contain and maintain `Progress`,
143+
`Surprises & Discoveries`, `Decision Log`, and `Outcomes & Retrospective`
144+
sections.
145+
- Capture unexpected behavior, performance tradeoffs, and bugs that shape the
146+
approach in `Surprises & Discoveries`, with short evidence snippets such as
147+
test output.
148+
- If the implementation changes course, document why in the `Decision Log` and
149+
reflect the implications in `Progress`.
150+
- At the end of a major task or the complete plan, add an
151+
`Outcomes & Retrospective` entry that records what was achieved, what remains,
152+
and lessons learned.
153+
154+
## Prototyping milestones and parallel implementations
155+
156+
Explicit prototyping milestones are encouraged when they de-risk a larger
157+
change. Keep prototypes additive and testable. Label them as prototyping,
158+
describe how to run and observe them, and state the criteria for promotion or
159+
discarding.
160+
161+
Prefer additive changes followed by safe subtractions that keep tests passing.
162+
Parallel implementations, such as an adapter alongside an older path during a
163+
migration, are appropriate when they reduce risk or keep tests running. Explain
164+
how to validate both paths and retire one safely. When several libraries or
165+
feature areas are involved, consider independent spikes that prove each external
166+
dependency has the required behavior in isolation.
167+
168+
## MQT Core requirements
169+
170+
In addition to the requirements above, an MQT Core ExecPlan must describe its
171+
repository-relative scope and any coordination boundaries relevant to the task.
172+
It must preserve unrelated user changes and never modify another task's
173+
worktree. Do not record local filesystem paths, developer accounts, a specific
174+
checkout location, or an ephemeral branch name: the checked-in plan must work
175+
from any clone. Describe command locations as "from the repository root" and
176+
refer to files by repository-relative path.
177+
178+
It must follow the repository's `AGENTS.md` and `docs/ai_usage.md`, including
179+
the rules for generated files, secrets, AI disclosure, authorization, and human
180+
review. An ExecPlan does not itself authorize external GitHub actions.
181+
182+
Use the exact Core commands relevant to the change. For example, name the
183+
applicable CMake preset and focused C++ or MLIR test binary; for Python changes,
184+
name the relevant `pytest` or Nox command; for documentation, include the Nox
185+
documentation command. End with `uvx nox -s lint` unless an existing, documented
186+
limitation prevents it, and record the limitation and its evidence.
187+
188+
## Skeleton of a good ExecPlan
189+
190+
## <Short, action-oriented description>
191+
192+
This ExecPlan is a living document. The sections `Progress`,
193+
`Surprises & Discoveries`, `Decision Log`, and `Outcomes & Retrospective` must
194+
be kept up to date as work proceeds.
195+
196+
This ExecPlan must be maintained in accordance with `.agent/PLANS.md` from the
197+
repository root.
198+
199+
### Purpose / Big Picture
200+
201+
Explain in a few sentences what someone gains after this change and how they can
202+
see it working. State the user-visible behavior to enable.
203+
204+
### Progress
205+
206+
Use a checkbox list to summarize granular steps. Document every stopping point,
207+
including partially completed work split into completed and remaining parts.
208+
This section must always reflect the current state.
209+
210+
- [x] (2026-01-01 00:00Z) Example completed step.
211+
- [ ] Example incomplete step.
212+
- [ ] Example partially completed step (completed: X; remaining: Y).
213+
214+
Use timestamps to measure the rate of progress.
215+
216+
### Surprises & Discoveries
217+
218+
Document unexpected behavior, bugs, optimizations, or insights discovered during
219+
implementation. Provide concise evidence.
220+
221+
- Observation: … Evidence: …
222+
223+
### Decision Log
224+
225+
Record every decision made while working on the plan in this form:
226+
227+
- Decision: … Rationale: … Date/Author: …
228+
229+
### Outcomes & Retrospective
230+
231+
Summarize outcomes, gaps, and lessons learned at major milestones or completion.
232+
Compare the result against the original purpose.
233+
234+
### Context and Orientation
235+
236+
Describe the relevant current state as if the reader knows nothing. Name key
237+
files and modules by full path. Define non-obvious terms. Do not refer to prior
238+
plans.
239+
240+
### Plan of Work
241+
242+
Describe the sequence of edits and additions in prose. For each edit, name the
243+
file, location, and exact change. Keep it concrete and minimal.
244+
245+
### Concrete Steps
246+
247+
State the exact commands and working directories. When a command generates
248+
output, show a short expected transcript. Update this section as work proceeds.
249+
250+
### Validation and Acceptance
251+
252+
Describe how to exercise the system and what to observe. Phrase acceptance as
253+
behavior with specific inputs and outputs. Name the relevant Core test commands
254+
and what success looks like.
255+
256+
### Idempotence and Recovery
257+
258+
State which steps are repeatable. For risky steps, provide a safe retry or
259+
rollback path. Keep the environment clean after completion.
260+
261+
### Artifacts and Notes
262+
263+
Include the most important transcripts, diffs, or snippets as indented examples.
264+
Keep them concise and focused on evidence.
265+
266+
### Interfaces and Dependencies
267+
268+
Be prescriptive. Name the libraries, modules, and services to use and why.
269+
Specify the types, interfaces, and function signatures that must exist at the
270+
end of the milestone. Prefer stable names and repository-relative paths.
271+
272+
When you revise an ExecPlan, ensure the change is reflected across all sections,
273+
including the living-document sections, and add a note at the end describing
274+
what changed and why. An ExecPlan must describe not only what to do, but why.

.agent/clean-caches.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env sh
2+
# Copyright (c) 2026 Chair for Design Automation, TUM
3+
# Copyright (c) 2026 Munich Quantum Software Company GmbH
4+
# All rights reserved.
5+
#
6+
# SPDX-License-Identifier: MIT
7+
#
8+
# Licensed under the MIT License
9+
10+
# Clear only the mutable tool state belonging to this worktree.
11+
set -eu
12+
13+
script_directory=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
14+
repository_root=$(CDPATH= cd -- "${script_directory}/.." && pwd)
15+
cache_root="${repository_root}/.cache"
16+
uv_cache="${cache_root}/uv"
17+
uv_python="${cache_root}/uv-python"
18+
uv_tool_bin="${cache_root}/uv-bin"
19+
uv_tools="${cache_root}/uv-tools"
20+
ccache_cache="${cache_root}/ccache"
21+
sccache_cache="${cache_root}/sccache"
22+
sccache_socket="${cache_root}/sccache.sock"
23+
24+
if [ -d "${uv_cache}" ]; then
25+
if command -v uv >/dev/null 2>&1; then
26+
UV_CACHE_DIR="${uv_cache}" uv cache clean
27+
else
28+
rm -rf -- "${uv_cache}"
29+
fi
30+
fi
31+
32+
rm -rf -- "${uv_python}" "${uv_tool_bin}" "${uv_tools}"
33+
34+
if [ -d "${ccache_cache}" ]; then
35+
if command -v ccache >/dev/null 2>&1; then
36+
CCACHE_DIR="${ccache_cache}" ccache --clear
37+
else
38+
rm -rf -- "${ccache_cache}"
39+
fi
40+
fi
41+
42+
if [ -S "${sccache_socket}" ]; then
43+
SCCACHE_DIR="${sccache_cache}" SCCACHE_SERVER_UDS="${sccache_socket}" \
44+
sccache --stop-server
45+
fi
46+
47+
rm -rf -- "${cache_root}"
48+
49+
echo "Cleared worktree-local caches under ${cache_root}"

.agent/run.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env sh
2+
# Copyright (c) 2026 Chair for Design Automation, TUM
3+
# Copyright (c) 2026 Munich Quantum Software Company GmbH
4+
# All rights reserved.
5+
#
6+
# SPDX-License-Identifier: MIT
7+
#
8+
# Licensed under the MIT License
9+
10+
# Run a command with all mutable tool state kept inside this worktree.
11+
set -eu
12+
13+
script_directory=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
14+
repository_root=$(CDPATH= cd -- "${script_directory}/.." && pwd)
15+
cache_root="${repository_root}/.cache"
16+
17+
export XDG_CACHE_HOME="${cache_root}/xdg"
18+
export PREK_HOME="${cache_root}/prek"
19+
export UV_CACHE_DIR="${cache_root}/uv"
20+
export UV_PYTHON_INSTALL_DIR="${cache_root}/uv-python"
21+
export UV_TOOL_BIN_DIR="${cache_root}/uv-bin"
22+
export UV_TOOL_DIR="${cache_root}/uv-tools"
23+
export CCACHE_DIR="${cache_root}/ccache"
24+
export CCACHE_MAXSIZE="4GiB"
25+
export CCACHE_TEMPDIR="${cache_root}/ccache/tmp"
26+
export SCCACHE_CACHE_SIZE="4G"
27+
export SCCACHE_DIR="${cache_root}/sccache"
28+
export SCCACHE_IDLE_TIMEOUT="60"
29+
30+
case "$(uname -s)" in
31+
Darwin | Linux)
32+
export SCCACHE_SERVER_UDS="${cache_root}/sccache.sock"
33+
;;
34+
esac
35+
36+
exec "$@"

.github/pull_request_template.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This checklist serves as a reminder of a couple of things that ensure your pull
2727

2828
**If PR contains AI-assisted content:**
2929

30-
- [ ] I have disclosed the use of AI tools in the PR description as per our [AI Usage Guidelines](https://github.com/munich-quantum-toolkit/core/blob/main/docs/ai_usage.md).
31-
- [ ] AI-assisted commits include an `Assisted-by: [Model Name] via [Tool Name]` footer.
30+
- [ ] Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our [AI Usage Guidelines](https://github.com/munich-quantum-toolkit/core/blob/main/docs/ai_usage.md).
31+
- [ ] Every agent-authored or agent-edited public text body begins with the visible disclosure `🤖 *AI text below* 🤖` (titles are exempt).
32+
- [ ] I have disclosed AI assistance in the PR description.
3233
- [ ] I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

0 commit comments

Comments
 (0)