Skip to content

Commit 08a3f88

Browse files
committed
docs: separate maintainer guidance from user docs
1 parent afaf7e5 commit 08a3f88

File tree

3 files changed

+118
-148
lines changed

3 files changed

+118
-148
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thank you for your interest in contributing! We welcome contributions from the c
44

55
## Getting Started
66

7-
See the [Development section](README.md#development) in the README for setup instructions, testing, and build processes.
7+
See [DEVELOPMENT.md](DEVELOPMENT.md) for setup instructions, test commands, build processes, and LLVM maintenance guidance. For release notes, see [CHANGELOG.md](CHANGELOG.md).
88

99
## How to Contribute
1010

@@ -70,12 +70,6 @@ type(scope): brief description
7070

7171
## Testing
7272

73-
See [README Testing section](README.md#testing) for details on:
74-
75-
- Running the test suite
76-
- Testing individual files
77-
- Simulation testing with Selene
78-
7973
Always add tests for new features and ensure all tests pass before submitting a PR.
8074

8175
## Documentation

DEVELOPMENT.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Development Notes
2+
3+
## Setup
4+
5+
The default development toolchain is tracked in `rust-toolchain.toml` and follows the latest stable Rust release. The minimum supported Rust version (MSRV) is tracked separately in `Cargo.toml` and wheel-build settings.
6+
7+
```sh
8+
# Clone the repository
9+
git clone https://github.com/quantinuum/qir-qis.git
10+
cd qir-qis
11+
12+
# Install LLVM 21 (macOS/Homebrew example)
13+
brew install llvm@21
14+
if [ "$(uname -m)" = "arm64" ]; then
15+
export LLVM_SYS_211_PREFIX=/opt/homebrew/opt/llvm@21
16+
else
17+
export LLVM_SYS_211_PREFIX=/usr/local/opt/llvm@21
18+
fi
19+
20+
# Install Rust dependencies and build
21+
cargo build
22+
23+
# Install Python dependencies
24+
uv sync
25+
```
26+
27+
## Building
28+
29+
```sh
30+
# Build Rust binary
31+
LLVM_SYS_211_PREFIX=${LLVM_SYS_211_PREFIX:-/opt/homebrew/opt/llvm@21} \
32+
cargo build --release
33+
34+
# Build Python package
35+
LLVM_SYS_211_PREFIX=${LLVM_SYS_211_PREFIX:-/opt/homebrew/opt/llvm@21} \
36+
uv run maturin build --release
37+
```
38+
39+
## Testing
40+
41+
Tests require [cargo-nextest](https://nexte.st/docs/installation/pre-built-binaries/).
42+
43+
```sh
44+
# Run all tests
45+
LLVM_SYS_211_PREFIX=${LLVM_SYS_211_PREFIX:-/opt/homebrew/opt/llvm@21} \
46+
make test
47+
48+
# Or directly with the same target as `make test`
49+
LLVM_SYS_211_PREFIX=${LLVM_SYS_211_PREFIX:-/opt/homebrew/opt/llvm@21} \
50+
cargo nextest run --all-targets --all-features
51+
```
52+
53+
### QIR Fixtures
54+
55+
```sh
56+
# Compile a single QIR file
57+
make compile FILE=tests/data/adaptive.ll
58+
59+
# Compile all test files
60+
make allcompile
61+
```
62+
63+
### Simulation
64+
65+
Test the compiled QIS using [Selene quantum simulator](https://docs.quantinuum.com/selene/).
66+
67+
```sh
68+
# Simulate a single file (runs 5 shots by default)
69+
make sim FILE=tests/data/adaptive.ll
70+
71+
# Simulate all test files
72+
make allsim
73+
```
74+
75+
### Code Quality
76+
77+
```sh
78+
# Run linters
79+
make lint
80+
```
81+
82+
`make lint` runs:
83+
84+
- `prek` pre-commit checks
85+
- `typos`
86+
- `cargo clippy`
87+
88+
### Python Stubs
89+
90+
After modifying the Python API:
91+
92+
```sh
93+
make stubs
94+
```
95+
96+
This updates `qir_qis.pyi` with the latest type signatures.
97+
98+
## Updating LLVM
99+
100+
For an LLVM bump, update:
101+
102+
1. `LLVM_VERSION` in `.github/workflows/CI.yml`, `.github/workflows/rust-release.yml`, and `.github/workflows/wheels-release.yml` to the new full release, for example `22.1.0`.
103+
2. The versioned `llvm-sys` env var name everywhere it appears, for example `LLVM_SYS_211_PREFIX` to `LLVM_SYS_220_PREFIX`.
104+
3. `Cargo.toml`:
105+
- `inkwell` feature, for example `llvm21-1` to `llvm22-1`
106+
- `llvm-sys` crate version, for example `211.0.0` to `220.0.0`
107+
4. `pyproject.toml` and `README.md` for any remaining version-specific install examples, especially `llvm@21` and `LLVM_SYS_*`.
108+
109+
The manylinux images already install to `/opt/llvm`, so they should not need path changes for a version bump.
110+
111+
After the bump, run:
112+
113+
1. `cargo test --lib --all-features`
114+
2. `cargo run --example rust_api --all-features`
115+
3. `make lint`
116+
4. the CI matrix and wheel builds

README.md

Lines changed: 1 addition & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ uv pip install qir-qis
5555
pip install qir-qis
5656
```
5757

58-
For development installation:
59-
60-
```sh
61-
uv sync
62-
```
63-
6458
## Usage
6559

6660
### Command Line
@@ -101,136 +95,6 @@ See [examples/rust_api.rs](https://github.com/quantinuum/qir-qis/blob/main/examp
10195
cargo run --example rust_api
10296
```
10397

104-
## Development
105-
106-
### Setting Up Development Environment
107-
108-
```sh
109-
# Clone the repository
110-
git clone https://github.com/quantinuum/qir-qis.git
111-
cd qir-qis
112-
113-
# Install LLVM 21 (macOS/Homebrew example)
114-
brew install llvm@21
115-
export LLVM_SYS_211_PREFIX=/opt/homebrew/opt/llvm@21
116-
117-
# Install Rust dependencies and build
118-
cargo build
119-
120-
# Install Python dependencies
121-
uv sync
122-
```
123-
124-
### Building
125-
126-
```sh
127-
# Build Rust binary
128-
LLVM_SYS_211_PREFIX=${LLVM_SYS_211_PREFIX:-/opt/homebrew/opt/llvm@21} \
129-
cargo build --release
130-
131-
# Build Python package
132-
LLVM_SYS_211_PREFIX=${LLVM_SYS_211_PREFIX:-/opt/homebrew/opt/llvm@21} \
133-
uv run maturin build --release
134-
```
135-
136-
### Testing
137-
138-
#### Running Tests
139-
140-
Tests require [cargo-nextest](https://nexte.st/docs/installation/pre-built-binaries/):
141-
142-
```sh
143-
# Run all tests
144-
LLVM_SYS_211_PREFIX=${LLVM_SYS_211_PREFIX:-/opt/homebrew/opt/llvm@21} \
145-
make test
146-
147-
# Or directly with cargo
148-
LLVM_SYS_211_PREFIX=${LLVM_SYS_211_PREFIX:-/opt/homebrew/opt/llvm@21} \
149-
cargo nextest run --all-targets --all-features
150-
```
151-
152-
#### Testing Individual Files
153-
154-
```sh
155-
# Compile a single QIR file
156-
make compile FILE=tests/data/adaptive.ll
157-
158-
# Compile all test files
159-
make allcompile
160-
```
161-
162-
#### Simulation Testing with Selene
163-
164-
Test the compiled QIS using [Selene quantum simulator](https://docs.quantinuum.com/selene/):
165-
166-
```sh
167-
# Simulate a single file (runs 5 shots by default)
168-
make sim FILE=tests/data/adaptive.ll
169-
170-
# Simulate all test files
171-
make allsim
172-
```
173-
174-
This will:
175-
176-
1. Compile the QIR to QIS
177-
2. Run it on the Selene/Quest simulator
178-
3. Display measurement results
179-
180-
### Code Quality
181-
182-
```sh
183-
# Run linters
184-
make lint
185-
186-
# This runs:
187-
# - prek (pre-commit checks, https://prek.j178.dev/)
188-
# - typos checker
189-
# - cargo clippy
190-
```
191-
192-
### Regenerating Python Stubs
193-
194-
After modifying the Python API:
195-
196-
```sh
197-
make stubs
198-
```
199-
200-
This updates [qir_qis.pyi](https://github.com/quantinuum/qir-qis/blob/main/qir_qis.pyi) with the latest type signatures.
201-
202-
## Project Structure
203-
204-
```text
205-
qir-qis/
206-
├── src/
207-
│ ├── main.rs # CLI entry point
208-
│ ├── lib.rs # Library and Python bindings
209-
│ ├── convert.rs # QIR to QIS conversion logic
210-
│ ├── decompose.rs # Gate decomposition
211-
│ ├── opt.rs # LLVM optimization passes
212-
│ └── utils.rs # Helper utilities
213-
├── tests/
214-
│ ├── data/ # Test QIR files
215-
│ └── snaps/ # Snapshot test results
216-
├── main.py # Example Python usage with simulation
217-
├── Cargo.toml # Rust package configuration
218-
├── pyproject.toml # Python package configuration
219-
└── Makefile # Common development tasks
220-
```
221-
222-
## Common Makefile Targets
223-
224-
| Command | Description |
225-
|----------------------------|------------------------------------|
226-
| `make test` | Run all unit and integration tests |
227-
| `make compile FILE=<path>` | Compile a single QIR file |
228-
| `make sim FILE=<path>` | Compile and simulate a QIR file |
229-
| `make lint` | Run code quality checks |
230-
| `make stubs` | Regenerate Python type stubs |
231-
| `make allcompile` | Compile all test files |
232-
| `make allsim` | Simulate all test files |
233-
23498
## Contributing
23599

236100
Contributions are welcome! Please read [CONTRIBUTING.md](https://github.com/quantinuum/qir-qis/blob/main/CONTRIBUTING.md) for:
@@ -239,11 +103,7 @@ Contributions are welcome! Please read [CONTRIBUTING.md](https://github.com/quan
239103
- Coding standards and commit message format
240104
- Development workflow and testing requirements
241105

242-
**Quick checklist before submitting:**
243-
244-
- [ ] Tests pass: `make test`
245-
- [ ] Linters pass: `make lint`
246-
- [ ] Documentation updated
106+
Development setup, test commands, and LLVM upgrade guidance live in [DEVELOPMENT.md](https://github.com/quantinuum/qir-qis/blob/main/DEVELOPMENT.md). Release notes are available in [CHANGELOG.md](https://github.com/quantinuum/qir-qis/blob/main/CHANGELOG.md).
247107

248108
## License
249109

0 commit comments

Comments
 (0)