Commit ee6bfd3
authored
Cleanup (#281)
* Trim verbose doc comments, redundant test docstrings, and decorative dividers
* Remove useless assertions, dead helpers, section dividers, and redundant docstrings
* Move large doc comments to docs/, add tested doc examples
Move tutorial-length comments from source to proper doc pages:
- noise/prelude.rs -> docs/experimental/composable-noise.md
- engine_type.rs -> docs/user-guide/engine-selection.md
- fault_tolerance.rs trimmed (content already in docs/user-guide/fault-tolerance.md)
- classical.rs trait methods trimmed
All doc examples are tested via the unified Rust test crate (13 new tests).
* Fix all doctests: 778 passing, 0 ignored, 0 failing
- Convert 26 ignored doctests to runnable with proper imports and setup
- Fix 1 pre-existing failure (Python example missing language tag)
- Change Python examples from ignore to python language tag
- Change pseudocode examples from ignore to text
- cuQuantum examples: ignore -> no_run (compile-checked, needs GPU .so at runtime)
* Replace cuQuantum static linking with runtime dlopen
Load cuQuantum/CUDA shared libraries at runtime via libloading instead
of linking at build time. This means doctests run everywhere: on GPU
machines they exercise real hardware, without GPU they get a graceful
NotAvailable error via the ? operator.
Removes the cuquantum_stub cfg and all function stubs from build.rs.
Stub path now emits only type definitions. The loader searches
CUQUANTUM_ROOT, ~/.pecos/deps, CUDA_PATH, and system paths.
* Clean remaining doc boilerplate, fix no_run doctests
- Trim "This module/crate/struct/trait provides" from 40 doc comments
- Make 5 no_run doctests fully runnable (qasm, simulator test utils)
- Change 6 pseudocode doctests from no_run to text
* Remove section dividers, trim comprehensive/generic boilerplate
- Replace 211 ASCII art section dividers with clean headers in 8 files
- Remove "Comprehensive" from 9 test file doc comments
- Remove 16 "This generic implementation" boilerplate lines from math.rs
* Remove section dividers from 15 more files (-544 lines)
* Remove section dividers from 10 more files (-276 lines)
* Remove todo!() panic in verify_matrix, dead trait method, empty placeholder files
* Replace dangerous unwrap() calls with proper error handling
QASM parser no longer panics on malformed input -- returns parse errors
instead. Engine code uses expect() with clear invariant messages or
restructured to avoid unwraps entirely.
* Replace unwraps with expect/error handling in pecos-phir, pecos-num, pecos-build
- pecos-num: as_slice().unwrap() now documents contiguity requirement
- pecos-build: download thread panics return errors instead of crashing
- pecos-phir: regex captures and lock acquisitions use expect with reasons
* Replace unwraps in op.rs and cppsparsestab with expect/helpers
* Replace unwraps in GPU sims, circuit passes, HUGR compiler, LDPC decoders
* Replace unwraps in examples and Python bindings
Examples now use ? operator instead of unwrap(), teaching users good
error handling. Python bindings use expect() with clear invariant
messages instead of bare unwrap() that would crash the interpreter.
* Replace unwraps in LLVM bindings, QuEST engine, PyMatching, coordinator
* Replace remaining production unwraps across Python bindings and Rust code
Python bindings: 130 unwraps eliminated -- prevents interpreter crashes
on conversion failures, lock poisoning, and array operations.
Rust: 28 unwraps replaced across 22 files in GPU sims, decoders,
circuit display, PHIR engine, and simulators.
* Fix dangling benchmark module reference, suppress bindgen warnings
* Fix PauliSet::insert doc examples to pass by reference
* lint
* Add missing # Errors and # Panics doc sections for clippy
* Fix GPU resource cleanup races and add concurrent stress tests
- map_async callbacks no longer panic from GPU worker threads when
receiver is dropped (expect -> silent drop on send)
- All 6 GPU simulator types now have explicit Drop that polls the
device to completion before resources are freed
- New concurrent stress test: 8 threads creating/destroying simulators
in parallel, plus rapid sequential create/destroy cycles
* Fix gpu_stab_multi callback panics and receiver diagnostics
* Guard cuquantum doctests with is_cuquantum_available() check
Doctests now pass on systems without cuQuantum by early-returning Ok(())
when the libraries aren't available. On systems with cuQuantum, they
still exercise the real GPU code.
* Revert cuquantum doctest guards -- test runner handles hardware detection
Doctests should test real GPU code without availability guards. The
test runner (pecos rust test) already excludes pecos-cuquantum from
workspace tests and only includes it when cuQuantum SDK is detected.
* Standardize GPU availability pattern: always import, check at construction
Python simulators/__init__.py no longer gates CudaStateVec/CudaStabilizer
imports behind is_cuquantum_available(). Classes are always importable
when the package is installed -- GPU availability is checked at
construction time with a clear RuntimeError, not silently set to None.
* Remove cuda feature gate from pecos-quest, use runtime detection only
pecos-quest now always compiles CUDA engine code. GPU availability is
detected at runtime via libloading (cuda_loader.rs), matching the
pecos-cuquantum pattern. No more --features cuda needed.
Removes cuda feature from pecos-quest, pecos, pecos-rslib, and
benchmarks Cargo.toml files. Simplifies CLI check/clippy/test commands.
* lint
* Fix cast_sign_loss warning in concurrent GPU test
* Fix PR review findings: cuTensor handle lifetime, norm panic, versioned sonames
* Fix concurrent GPU test: reborrow AtomicUsize before move closure
* lint
* Remove cuda feature flag from CI workflows (now runtime-detected)
* Remove dead cuda_feature matrix variable from python-release workflow
* Deduplicate GPU Drop impls, fix CuQuantumBackend drop order, use cudaMemset
* Exclude pecos-cuquantum from CI workspace tests (needs cuQuantum SDK)
* Use pecos rust test in CI for runtime hardware detection
* lint
* Bump wasmtime from 42 to 43
* update lock
* Use pecos rust test on all platforms for runtime hardware detection
* Bump wgpu from 28 to 29
* Add cuda_check probe binary, use it in pecos rust test for runtime GPU detection
* Bump sha2 from 0.10 to 0.11
* Bump Qulacs from 0.6.12 to 0.6.13
* Bump QuEST from v4.1.0 to v4.2.0
* Remove workspace pecos.toml, use per-crate manifests as source of truth
* Use versioned paths for LLVM and CUDA deps (llvm-14, cuda-12.6.3)
* Remove silent auto-install of cuQuantum/cuTensor from build.rs
* Improve pecos setup: show status summary, versioned paths, point build.rs to setup
* Remove silent auto-migration, let pecos setup prompt for legacy path renames
* Show existing install path in pecos install, prompt before replacing system version
* Update build error messages to point to pecos setup, show install paths
* Use cargo run instead of installed binary in Justfile, remove check-cli
* update locks
* Suppress all warnings from third-party Qulacs C++ code
* Request adapter's actual GPU limits instead of wgpu defaults
* Fix clippy warning in install_cmd
* lint
* Use debug mode for CLI in Justfile (faster build, CLI does no heavy computation)
* Update CI and docs to use versioned LLVM path (llvm-14)
* Fix Windows CI: configure MSVC linker before LLVM install to avoid Git link.exe conflict
* Fix Windows CI: write complete .cargo/config.toml to avoid duplicate [env] sections
* Fix Windows link error: add missing arg_parse.cc to pymatching stim build
* Move SUMMARY-AST.md to docs/development/ast-infrastructure.md
* Fix QuEST v4.2.0 GPU stub: add 4th template param (ApplyTransp) to anyCtrlAnyTargDenseMatr
* Fix QuEST v4.2.0 GPU stub: densmatr_allTargDiagMatr now has 4 bool params
* Mark GPU batching stress tests as #[ignore] (need large VRAM, fail on CI GPUs)
* Make GPU batching tests adaptive: work on any GPU, no ignore markers
* Make GPU batching tests handle OOM gracefully via catch_unwind
* lint
* Reject software renderers in GPU probe (only accept DiscreteGpu/IntegratedGpu)1 parent bdf1021 commit ee6bfd3
311 files changed
Lines changed: 5614 additions & 7114 deletions
File tree
- .github/workflows
- crates
- benchmarks
- benches/modules
- pecos-build
- src
- cuda
- cuquantum
- llvm
- pecos-chromobius
- tests
- chromobius
- pecos-cli
- src
- cli
- tests/cli
- pecos-core/src
- pauli
- pecos-cppsparsestab/src
- pecos-cuquantum-sys
- src
- bin
- pecos-cuquantum
- src
- pecos-decoder-core/src
- pecos-engines
- examples
- src
- monte_carlo
- noise
- shot_results
- pecos-fusion-blossom/src
- pecos-gpu-sims
- examples
- src
- tests
- pecos-hugr-qis/src
- pecos-hugr/src
- engine
- pecos-ldpc-decoders
- src
- tests
- pecos-llvm
- src
- pecos-num/src
- pecos-phir-json
- src/v0_1
- tests/common
- pecos-phir
- examples
- src
- tests/engines
- pecos-programs/src
- pecos-pymatching
- examples
- src
- tests
- pecos-qasm
- examples
- src
- parser
- tests
- benchmark
- pecos-qec/src
- fault_tolerance
- dem_builder
- pecos-qis-ffi-types/src
- pecos-qis-ffi/src
- pecos-qis
- src
- pecos-quantum
- src
- tests
- pecos-quest
- src
- tests
- pecos-qulacs
- src
- pecos-random/src
- pecos-relay-bp
- src
- tests
- pecos-simulators
- examples
- src
- clifford_rz
- tests
- pecos-tesseract
- examples
- src
- pecos-wasm/src
- pecos
- examples
- src
- tests
- docs
- development
- experimental
- user-guide
- examples/python_examples
- exp
- pecos-experimental/src
- pecos-neo
- benches
- docs/dev
- examples
- src
- ecs
- extensible
- noise
- composite
- tool
- tests
- pecos-zx/src
- python
- pecos-rslib-llvm/src
- pecos-rslib
- src
- tests
- quantum-pecos
- src/pecos
- analysis
- simulators
- tools
- tests
- docs/rust_crate
- tests
- guppy
- pecos/integration
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
| |||
90 | 89 | | |
91 | 90 | | |
92 | 91 | | |
93 | | - | |
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
| |||
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
104 | | - | |
105 | 102 | | |
106 | 103 | | |
107 | 104 | | |
108 | | - | |
109 | 105 | | |
110 | 106 | | |
111 | 107 | | |
112 | 108 | | |
113 | 109 | | |
114 | | - | |
115 | 110 | | |
116 | 111 | | |
117 | 112 | | |
| |||
192 | 187 | | |
193 | 188 | | |
194 | 189 | | |
195 | | - | |
| 190 | + | |
196 | 191 | | |
197 | | - | |
| 192 | + | |
198 | 193 | | |
199 | | - | |
200 | 194 | | |
201 | 195 | | |
202 | 196 | | |
| |||
223 | 217 | | |
224 | 218 | | |
225 | 219 | | |
226 | | - | |
227 | | - | |
| 220 | + | |
| 221 | + | |
228 | 222 | | |
229 | 223 | | |
230 | 224 | | |
| |||
237 | 231 | | |
238 | 232 | | |
239 | 233 | | |
240 | | - | |
| 234 | + | |
241 | 235 | | |
242 | 236 | | |
243 | 237 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 238 | + | |
| 239 | + | |
247 | 240 | | |
248 | 241 | | |
249 | 242 | | |
250 | | - | |
251 | 243 | | |
252 | 244 | | |
253 | | - | |
254 | | - | |
255 | | - | |
| 245 | + | |
256 | 246 | | |
257 | 247 | | |
258 | 248 | | |
| |||
283 | 273 | | |
284 | 274 | | |
285 | 275 | | |
286 | | - | |
287 | | - | |
| 276 | + | |
| 277 | + | |
288 | 278 | | |
289 | 279 | | |
290 | 280 | | |
| |||
294 | 284 | | |
295 | 285 | | |
296 | 286 | | |
297 | | - | |
298 | | - | |
| 287 | + | |
| 288 | + | |
299 | 289 | | |
300 | 290 | | |
301 | 291 | | |
302 | | - | |
| 292 | + | |
303 | 293 | | |
304 | 294 | | |
305 | 295 | | |
| |||
309 | 299 | | |
310 | 300 | | |
311 | 301 | | |
312 | | - | |
| 302 | + | |
313 | 303 | | |
314 | 304 | | |
315 | | - | |
316 | | - | |
| 305 | + | |
| 306 | + | |
317 | 307 | | |
318 | 308 | | |
319 | | - | |
| 309 | + | |
320 | 310 | | |
321 | 311 | | |
322 | 312 | | |
323 | 313 | | |
324 | | - | |
| 314 | + | |
325 | 315 | | |
326 | 316 | | |
327 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
113 | 132 | | |
114 | 133 | | |
115 | 134 | | |
116 | 135 | | |
117 | | - | |
| 136 | + | |
118 | 137 | | |
119 | 138 | | |
120 | 139 | | |
| |||
134 | 153 | | |
135 | 154 | | |
136 | 155 | | |
137 | | - | |
138 | 156 | | |
139 | 157 | | |
140 | 158 | | |
141 | | - | |
| 159 | + | |
| 160 | + | |
142 | 161 | | |
143 | 162 | | |
144 | 163 | | |
145 | 164 | | |
146 | 165 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
158 | 175 | | |
159 | 176 | | |
160 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 229 | + | |
235 | 230 | | |
236 | 231 | | |
237 | 232 | | |
238 | 233 | | |
239 | | - | |
240 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
241 | 237 | | |
242 | 238 | | |
243 | 239 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 240 | + | |
248 | 241 | | |
249 | 242 | | |
250 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
251 | 247 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 248 | + | |
| 249 | + | |
257 | 250 | | |
258 | 251 | | |
259 | 252 | | |
260 | 253 | | |
261 | | - | |
262 | | - | |
| 254 | + | |
263 | 255 | | |
264 | 256 | | |
265 | 257 | | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 258 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
0 commit comments