✨ Expose native target mapping controls - #2551
Open
simon1hofmann wants to merge 10 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
10 tasks
simon1hofmann
added this pull request to stack #2555
September 13, 2026 11:25
simon1hofmann
marked this pull request as ready for review
September 13, 2026 11:42
burgholzer
requested changes
Sep 13, 2026
burgholzer
left a comment
Member
There was a problem hiding this comment.
I have a couple of broader questions on the design here.
I believe we should spend a bit of effort to come up with a good system for these options.
The general addition here makes sense to me.
simon1hofmann
added a commit
that referenced
this pull request
Sep 13, 2026
🤖 *AI text below* 🤖 Merge the compiler-wide options from #2551 and use the same options argument for layout compilation. Preserve explicit input assignments, detached results, metadata invalidation, and saved-pipeline replay. Update usage and tests for the shared seed, timing, statistics, and mapping controls. Assisted-by: GPT-6 via Codex
simon1hofmann
added a commit
that referenced
this pull request
Sep 14, 2026
🤖 *AI text below* 🤖 Align the stacked layout branch with #2551's simplified compiler API. Remove separate timing/statistics arguments from the layout method too. Assisted-by: GPT-6 via Codex
simon1hofmann
force-pushed
the
feat/target-mapping-controls
branch
from
September 14, 2026 09:36
5d3f16c to
8f00093
Compare
🤖 *AI text below* 🤖 Thread the native mapper seed and trial count through C++, Python, device compilation, and mqt-cc. Preserve existing defaults and validate zero trials before rewriting the program. Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖 Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖 Group timing, statistics, mapping trials, and an optional compiler seed in CompilationOptions. Preserve legacy flag calls and propagate explicit seeds through mapping, custom pipelines, and numerical synthesis. Capture scoped seed metadata in crash reproducers and validate its module-level contract. Replace the mapping CLI script with native checks and cover seed precedence, wide seeds, numerical retries, compatibility, and failure cleanup. Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖 Pass synthesis mapping options to the shared preparation pass so invalid trial counts fail before rewriting the input. Cover synthesis alongside both target compilation connectivity modes in the existing regression. Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖 Remove the timing/statistics overloads and Python keyword compatibility layer. Compiler entry points now take CompilationOptions directly, with binding arguments copied before releasing the GIL. Keep omitted options distinct for submission so compiled payloads reject compiler settings. Update native callers, instrumentation tests, documentation, and generated stubs. This intentionally breaks callers that use the separate flags. Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖 Keep the plan scoped to Core's compiler API, remove the obsolete flag compatibility statement, and record the current validation results. Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖 Add layout refinement iterations and routing lookahead to MappingOptions and the CLI. Preserve the defaults of one refinement round and twenty additional gates; permit zero lookahead and reject zero iterations before target compilation or synthesis changes the program. Extend forwarding, repeatability, and CLI validation coverage. Keep all compiler settings grouped in CompilationOptions. Assisted-by: GPT-6 via Codex
🤖 *AI text below* 🤖 Regenerate the Python interface, apply initializer conventions, and record validation for the added mapping controls. Assisted-by: GPT-6 via Codex
Bound routing lookahead storage by actual gates and keep compilation-wide settings in the shared pass-manager runner. Narrow target builders to mapping options, remove duplicate seed plumbing, and check seed precedence and mapping diagnostics at execution boundaries. Fix the CLI example. Assisted-by: GPT-6 via Codex
burgholzer
force-pushed
the
feat/target-mapping-controls
branch
from
September 14, 2026 20:12
8f00093 to
5796ad8
Compare
burgholzer
approved these changes
Sep 14, 2026
burgholzer
left a comment
Member
There was a problem hiding this comment.
I pushed a couple of changes and simplifications here. These look pretty decent to me 🙌🏼
I'll quickly explore one last thing, then I'll likely merge this!
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.
🤖 AI text below 🤖
Description
Add shared
CompilationOptionsfor timing, statistics, a compilation-wide seed,and native mapping trials, refinement iterations, and routing lookahead. C++,
Python, and
mqt-ccuse the same controls through target compilation, synthesis,custom pass pipelines, and QDMI source submission.
Compiler settings are accepted only through
CompilationOptions; separatetiming/statistics arguments are removed.
An explicit seed controls Core's mapper, Pauli twirling, and numerical synthesis
retries. It overrides pass-local seeds, including nested pipelines. The scoped
seed is captured in MLIR crash reproducers and restored after success or failure.
The new CLI tests use GoogleTest and check both exit status and diagnostics.
Usage
Typed programs accept
optionsoncompile_for_target,synthesize_for_target,and
run_pass_pipeline. C++ compiler entry points accept a finalconst CompilationOptions&. Low-level target pipeline builders acceptMappingOptions; execute their pass managers withrunWithCompilationOptionsto apply the seed and instrumentation with the same precedence as the compiler API.
--seedalso works without a device and with custom or isolated pass pipelines.Limitations
seed=Nonepreserves each pass's default or explicit seed. Execution sampling has a separate seed.SIZE_MAX. All-to-all placement ignores valid mapping controls. The mapper may also consider deterministic candidates.options=Noneto mean no supplied compiler settings; other compiler entry points takeCompilationOptionsdirectly.Breaking API change
Replace Python
enable_timing=True, enable_statistics=Truekeywords withoptions=CompilationOptions(enable_timing=True, enable_statistics=True).In C++, replace trailing timing/statistics booleans with
CompilationOptions{.enableTiming = true, .enableStatistics = true}.For source
submitProgram, the options object follows the custom job parameters.Omit
optionswhen defaults are sufficient; for compilation and typed methods,replace explicit
options=Nonewith omission orCompilationOptions().Validation
SIZE_MAXlookahead.CI for the latest push is pending.
Release documentation follows the current release-preparation policy. This PR adds no changelog or upgrade-guide entry.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).