Conversation
…e and delete the compiled-primitive prototype
ciaranra
marked this pull request as ready for review
September 12, 2026 22:22
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.
Summary
Puts pecos-neo's composite noise DSL (
noise::composite, about 13k lines ofCondition/Primitive/GateActionmachinery) behind a cargo feature,composite-noise, off by default, and deletes the compiled-primitive prototype that nothing ever wired in. Step 4 of the pecos-neo core-adoption sequence (after #711, #712, #756, #761).The default stack that
sim()will eventually run on uses the plain channels:GeneralNoiseModelBuilder, which the facade maps onto, never constructs a composite type. The DSL stays available to anyone who wants it; it just stops being part of what every downstream compiles, lints and audits.What changed
composite-noise = []inexp/pecos-neo/Cargo.toml, not indefault. Gated as whole items: thenoise::compositemodule, the composite re-export innoise::prelude,NoiseModelBuilder's fivewith_*_noise(primitive)/with_custom_channelmethods and their imports, and innoise::patternsthe composite-backed functions (dephasing_only,with_leakage,chain_measurement_crosstalk,grid_measurement_crosstalk,realistic_device_noise,surface_code_noise) together withDeviceNoiseParams. The four plain patterns stay ungated. The feature adds or removes whole items only; no field, parameter or variant changes shape with it.noise/composite/compiled.rs(761 lines) deleted with its re-exports, thebench_dispatch_comparisonbenchmark, and the documentation section that called acompile()that did not exist. The enum-dispatch idea it prototyped was measured and rejected in Dispatch pecos-neo noise events only to channels that declare the event kind #761.introspection/topology/general_builderexamples rewritten without composite; intra-doc links to composite types are plain text socargo docis clean with the feature off. README, user guide, dev docs anddocs/experimental/composable-noise.mdname the feature.composite-noise(as it already doesqasm), so every test, doctest, bench and example keeps building and running exactly as before. That mechanism means no dev target of this crate can ever be feature-off; the feature-off build is the library, and it is checked by two new lanes:cargo clippy -p pecos-neo --lib -- -D warnings(added to therust-lint-no-llvmCI job) andcargo doc -p pecos-neo --no-depswith-D warnings.python/quantum-pecos/tests/docs/rust_crate) is a separate package and does not inherit that dev-dependency, so its manifest enables the feature explicitly; the 176 generated doc tests pass unchanged.No consumer in
crates/pecos,pecos-rslib-exporpecos-qecuses composite (grepped).Verification
All green on a cold build (changed crates cleaned first). Net diff about minus 830 lines.