⚡ Avoid repeated QDMI result and metadata work - #2481
Merged
Merged
Conversation
Share dense DDSIM initialization across concurrent readers and answer size queries without materializing results. Reuse frontend metadata and decode PennyLane shots with NumPy while preserving validation. Assisted-by: Codex
burgholzer
enabled auto-merge (squash)
September 9, 2026 07:03
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
Concurrent DDSIM probability and statevector readers now share the existing initialization guard. Dense size queries compute the checked byte count from the DD root, without constructing an exponential vector; undersized buffers are rejected before allocation.
PennyLane decodes validated shots through NumPy and uses the known Python operation name to access its per-converter contract cache. Qiskit reads duration units and scale lazily once per target snapshot, preserving validation and floating-point evaluation order.
Regressions cover cold concurrent readers, dense-size overflow, malformed shots and wire order, repeated operation-name queries, and duration metadata reuse across placements and snapshots. The retained audit records the measurements and limits. Open #2373 touches the same DDSIM source; its multi-program changes remain separate.
Validation: 67 DDSIM tests, 241 client tests, and 102 focused Python frontend tests passed. Full Nox lint and C++ lint passed, with all lines of the three changed C++ files checked. The local 22-qubit probe confirms zero dense allocations for size-only requests and sub-microsecond queries. No hosted CI, Windows, ThreadSanitizer, or live cloud validation is claimed.
These changes affect unreleased v4 functionality, so no standalone changelog or migration entry is added. Codex implemented and checked the changes under explicit authorization; human review remains required before merge.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).