Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Swift 6 strict concurrency on `Foundation`, `simd`, `CryptoKit`, Metal (the ACOM
module. The one accelerated path, `ACOMMatcher.matchAll(..., backend: .metal)`, keeps the CPU path as its reference and is
checked against it.
**Status: 0.x** ([semantic versioning](https://semver.org): a minor release may change the API, and every release has a
`CHANGELOG.md` entry with a migration note where needed). Pin an exact tag and bump on purpose.
`CHANGELOG.md` entry with a migration note where needed). Commit your `Package.resolved` and read the CHANGELOG before an update.

**Platform.** Apple platforms today (macOS 15 or later, iOS 18 or later). Linux is not supported yet: `DiffractoCore` imports
`CryptoKit` and `DiffractoOrientation` depends on ImagoKit, which uses Accelerate.
Expand All @@ -38,7 +38,7 @@ One SwiftPM product per module; a module imports only the ones above it in this
```swift
// Package.swift
dependencies: [
.package(url: "https://github.com/mac4DSTEM/DiffractoKit", exact: "0.11.0"), // x-release-please-version
.package(url: "https://github.com/mac4DSTEM/DiffractoKit", from: "0.11.0"), // x-release-please-version
],
targets: [
.target(name: "MyApp", dependencies: [
Expand Down Expand Up @@ -261,18 +261,17 @@ and ported from: pymatgen, spglib, py4DSTEM and, for the orientation work, pyxem
- One real-data test (`testRinglessFitOnARealMeanPatternFallsBackToTheConic`, a Ni65Cu35 mean pattern) is disabled until that
dataset is published with the tests.
- Policies not yet parameters (profile-fit plausibility bounds, cell volume 1e-6) remain.
- The open list, worst first, with causes: `docs/open-items.md`; timings against Python: `docs/benchmarks.md`.
- Open work: the GitHub issues; known limits with their causes: `docs/parity.md`; timings against Python: `docs/benchmarks.md`.

## Status and documents

0.x: the API may change between minor versions; pin an exact tag. Numbers are held to the Python reference within its own tolerance; `docs/parity.md` lists each function, its state and its tolerance.
0.x: the API may change between minor versions; commit `Package.resolved` and read the CHANGELOG before an update. Numbers are held to the Python reference within its own tolerance; `docs/parity.md` lists each function, its state and its tolerance.

| Document | What |
|---|---|
| `CHANGELOG.md` | what changed in each release, with migration notes |
| `docs/parity.md` | the checklist against pymatgen, py4DSTEM, pyxem / diffsims / orix |
| `docs/benchmarks.md` | the per-function timings against the Python counterparts and the backend decision |
| `docs/open-items.md` | what is open, with causes |
| `docs/orientation-symmetry.md` | orientation conventions |
| `tools/consumer-check/README.md` | the separate package that uses the public API only |
| `tools/readme-consumer/README.md` | the separate package that compiles and runs exactly this README's program |
Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Roadmap

Where DiffractoKit is going next, in order. `docs/parity.md` says what is held today, `docs/open-items.md` what is known to be
open, and the GitHub issues track each piece of work. The numbers below are the ones `docs/parity.md` cites as "ROADMAP item n".
Where DiffractoKit is going next, in order. `docs/parity.md` says what is held today and its known limits, and the GitHub
issues track each piece of work. The numbers below are the ones `docs/parity.md` cites as "ROADMAP item n".

1. **Diagnose before fixing.** Phase matching (`minimumVectors` = 2 makes "matrix" by exclusion; the cross-phase winner
ignores completeness), the ACOM mirror (a mirrored win carries `inPlaneAngle` + π with no flag; some off-grid
Expand Down
6 changes: 3 additions & 3 deletions docs/benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Float64 unless the function is Float32 by design (ACOM, ellipse pattern pixels).
| Python | 3.12.14, NumPy 2.5.4, SciPy 1.18.1, in two virtual environments: py4DSTEM 0.14.19 in one; pymatgen-core 2026.10.16 (the code; its `pymatgen` metapackage dist-info reads 2026.9.24), orix 0.15.0 and spglib 2.8.0 in the other |
| Load | **10.5 on a 12-core machine while other builds ran** (uptime 17:39): every figure carries that noise, the single-core rows least. Re-run when the machine is quiet before quoting a ratio. |
| Pin note | The pymatgen environment runs pymatgen-core **2026.10.16** under a `pymatgen` 2026.9.24 metapackage, and every fixture that records pymatgen-core records 2026.10.16 (`tools/pins/requirements/pymatgen.txt`). Nothing here compares numbers, only time |
| 0.9.1 | The `symmetry_detection` and `cif_import` rows above are the 2026-10-21 measurement of 0.9.0. 0.9.1 replaced the closure check that took 95 % of them (see `docs/open-items.md`); measured in-process on the same `al_super2.cif` (machine load 3.6): `cif_import` typical median 67 ms (min 67, max 77), against 297 ms (one run at load 9) before the change and the table's 351 ms. Not yet re-run through `run.sh` |
| 0.9.1 | The `symmetry_detection` and `cif_import` rows above are the 2026-10-21 measurement of 0.9.0. 0.9.1 replaced the closure check that took 95 % of them (see `docs/parity.md`, known limits); measured in-process on the same `al_super2.cif` (machine load 3.6): `cif_import` typical median 67 ms (min 67, max 77), against 297 ms (one run at load 9) before the change and the table's 351 ms. Not yet re-run through `run.sh` |

Re-run from a fresh clone of the kit, on a quiet Mac: `gen_inputs.py` writes the shared inputs, `run.sh` builds the benchmark
package (`tools/benchmarks`, release) and prints the kit's JSON lines, `bench_python.py` prints the Python lines, and `merge.py`
Expand Down Expand Up @@ -74,7 +74,7 @@ The raw lines of the run below are `tools/benchmarks/results/2026-10-21.jsonl`.
- `symmetry_detection` and `cif_import`: the kit's `CIFImport.read` always detects the symmetry of the cell it reads;
pymatgen's `CifParser` only parses and `SpacegroupAnalyzer` is spglib in C. On a 32-atom P1 cell (an fcc supercell with
1 536 operations) the kit took 361 ms against 13 ms, **28 times slower**; on a four-atom cell they are level. The cause was the
closure check, not the symmetry search (`docs/open-items.md`); 0.9.1 made the check about five times faster, the rest stays listed there.
closure check, not the symmetry search (`docs/parity.md`, known limits); 0.9.1 made the check about five times faster, the rest stays listed there.
- `orientation_reduce`: the kit reduces one matrix at a time (24 proper operators); orix reduces a vectorised batch
(`Orientation.from_matrix` + `map_into_symmetry_reduced_zone`). The kit is 2.5 to 12 times faster at these sizes.
- `ellipse_fit_1d`: level with py4DSTEM's `fit_ellipse_1D` (0.94 and 1.1).
Expand All @@ -88,7 +88,7 @@ The raw lines of the run below are `tools/benchmarks/results/2026-10-21.jsonl`.

| Function | Backend | Why / break-even |
|---|---|---|
| `niggli_reduce`, `reflections`, `kinematic_reflections`, `symmetry_detection`, `cif_import` | CPU only | small arrays, branchy integer logic, readers; the kit is already faster than Python except where `docs/open-items.md` lists it |
| `niggli_reduce`, `reflections`, `kinematic_reflections`, `symmetry_detection`, `cif_import` | CPU only | small arrays, branchy integer logic, readers; the kit is already faster than Python except where `docs/parity.md` (known limits) lists it |
| `orientation_reduce` | CPU only | 24 small matrix products per rotation; the batch (100 000 in 0.2 s) is bound by memory traffic, a GPU would pay the transfer for no gain at these sizes |
| `ellipse_fit_1d` | CPU only | one 1D least-squares fit per pattern; level with Python |
| `acom_library` | CPU only | built once per phase (60 ms for 600 axes), not per pattern |
Expand Down
57 changes: 0 additions & 57 deletions docs/open-items.md

This file was deleted.

Loading
Loading