Skip to content

feat(con): use readcon#307

Open
HaoZeke wants to merge 22 commits intoTheochemUI:mainfrom
HaoZeke:feat-readcon
Open

feat(con): use readcon#307
HaoZeke wants to merge 22 commits intoTheochemUI:mainfrom
HaoZeke:feat-readcon

Conversation

@HaoZeke
Copy link
Collaborator

@HaoZeke HaoZeke commented Feb 18, 2026

Because why not.

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

eOn Documentation Preview

Download: documentation.zip

Unzip and open index.html to view.

@HaoZeke HaoZeke force-pushed the feat-readcon branch 3 times, most recently from 2852714 to 076c7bb Compare February 24, 2026 18:35
@github-actions
Copy link

github-actions bot commented Feb 24, 2026

Benchmark Results

Warning

1 benchmark(s) regressed

Count
🔴 Regressed 1
⚪ Unchanged 7

Regressions

Benchmark Before After Ratio
🔴 bench_eonclient.TimePointMorsePt.time_point_evaluation 7.54±0ms 8.63±0ms 1.15x
7 unchanged benchmark(s)
Benchmark Before After Ratio
bench_eonclient.TimeMinimizationLJCluster.peakmem_minimization_lbfgs 27.1M 24.9M ~0.92x
bench_eonclient.TimeMinimizationLJCluster.time_minimization_lbfgs 37.2±0ms 38.8±0ms ~1.04x
bench_eonclient.TimeNEBMorsePt.peakmem_neb 27.1M 24.9M ~0.92x
bench_eonclient.TimeNEBMorsePt.time_neb 512±0ms 525±0ms ~1.02x
bench_eonclient.TimePointMorsePt.peakmem_point_evaluation 27.1M 24.9M ~0.92x
bench_eonclient.TimeSaddleSearchMorseDimer.peakmem_saddle_search_dimer 27.1M 24.9M ~0.92x
bench_eonclient.TimeSaddleSearchMorseDimer.time_saddle_search_dimer 61.3±0ms 63.2±0ms ~1.03x
Details
  • Base: d7b3a604
  • Head: 5531731f
  • Runner: ubuntu-22.04
Raw asv-spyglass output
All benchmarks:

| Change   | Before   | After    |   Ratio | Benchmark (Parameter)                                                             |
|----------|----------|----------|---------|-----------------------------------------------------------------------------------|
|          | 27.1M    | 24.9M    |    0.92 | bench_eonclient.TimeMinimizationLJCluster.peakmem_minimization_lbfgs              |
|          | 37.2±0ms | 38.8±0ms |    1.04 | bench_eonclient.TimeMinimizationLJCluster.time_minimization_lbfgs                 |
|          | 27.1M    | 24.9M    |    0.92 | bench_eonclient.TimeNEBMorsePt.peakmem_neb                                        |
|          | 512±0ms  | 525±0ms  |    1.02 | bench_eonclient.TimeNEBMorsePt.time_neb                                           |
|          | 27.1M    | 24.9M    |    0.92 | bench_eonclient.TimePointMorsePt.peakmem_point_evaluation                         |
| +        | 7.54±0ms | 8.63±0ms |    1.15 | bench_eonclient.TimePointMorsePt.time_point_evaluation                            |
|          | 27.1M    | 24.9M    |    0.92 | bench_eonclient.TimeSaddleSearchMorseDimer.peakmem_saddle_search_dimer            |
|          | 61.3±0ms | 63.2±0ms |    1.03 | bench_eonclient.TimeSaddleSearchMorseDimer.time_saddle_search_dimer               |
|          | 27.1M    | 24.9M    |    0.92 | benchmarks.bench_eonclient.TimeMinimizationLJCluster.peakmem_minimization_lbfgs   |
|          | 37.7±0ms | 38.2±0ms |    1.01 | benchmarks.bench_eonclient.TimeMinimizationLJCluster.time_minimization_lbfgs      |
|          | 27.1M    | 24.9M    |    0.92 | benchmarks.bench_eonclient.TimeNEBMorsePt.peakmem_neb                             |
|          | 515±0ms  | 515±0ms  |    1    | benchmarks.bench_eonclient.TimeNEBMorsePt.time_neb                                |
|          | 27.1M    | 24.9M    |    0.92 | benchmarks.bench_eonclient.TimePointMorsePt.peakmem_point_evaluation              |
|          | 7.25±0ms | 7.89±0ms |    1.09 | benchmarks.bench_eonclient.TimePointMorsePt.time_point_evaluation                 |
|          | 27.1M    | 24.9M    |    0.92 | benchmarks.bench_eonclient.TimeSaddleSearchMorseDimer.peakmem_saddle_search_dimer |
|          | 60.9±0ms | 61.5±0ms |    1.01 | benchmarks.bench_eonclient.TimeSaddleSearchMorseDimer.time_saddle_search_dimer    |

@HaoZeke HaoZeke force-pushed the feat-readcon branch 2 times, most recently from c1f4680 to 74504c0 Compare February 24, 2026 20:01
Use readcon-core (https://github.com/lode-org/readcon-core) v0.2.0 as a
meson subproject for reading .con files.  The hand-written sscanf/fgets
parser is replaced by readcon::ConFrameIterator which delegates to the
Rust-based parser.

- Add subprojects/readcon-core.wrap pinned to v0.2.0
- Link readcon-core statically into eonclib
- Replace Matter::con2matter(FILE*) with Matter::con2matter(ConFrame&)
- Bump meson_version to >= 1.8.0 (required by readcon-core's Rust support)
- Add rust >= 1.88 to pixi base dependencies
- Add ensure_cbindgen pixi task (cbindgen not yet on conda-forge)
- matter2con and convel2matter remain FILE*-based (readcon-core lacks a
  frame-builder API)

Entire-Checkpoint: c0e7b0158776
Replace matter2con(FILE*), matter2convel(FILE*), and convel2matter(FILE*)
with readcon ConFrameBuilder, ConFrameWriter, and mmap reader. Adds
cell_to_lengths_angles() helper. Uses precision=17 for .con roundtrip
and precision=6 for .convel.

Also speeds up con2matter by using read_first_frame (mmap) instead
of the iterator path.
Convert all callers of matter2con(FILE*) to use the string filename
overload directly. For multi-frame NEB paths, use the append parameter
instead of manually opening a file handle.
…files

Replace all FILE*/fprintf/fclose patterns with fmt::output_file and
.print() in every Job file. Also modernize saveMode in HelperFunctions
to take a filename string, replace fopen-for-existence-check with
std::filesystem::exists, and convert GlobalOptimizationJob member
FILE* to fmt::ostream.
loadcon/loadcons/savecon now delegate to readcon.read_con,
readcon.read_con_string, readcon.write_con, and
readcon.write_con_string. Preserves StringIO support for
server communication and append mode for multi-frame files.
Remove tool.pdm sections, move dev-dependencies to
dependency-groups. Delete pdm.lock, generate uv.lock.
Drop unsupported 2>&1 redirect in ensure_cbindgen pixi task.
Use direct cargo install in benchmark CI (main lacks the task).
Switch docs CI from pdm to uv sync --group docs.
Reflect that both read and write now use readcon-core.
Add Python server section. Fix pixi reference in install guide.
v0.4.3 uses read_to_string for files under 64 KiB instead of mmap,
avoiding fixed VMA/page-fault overhead for small .con files. Also
adds a dedicated read_first_frame path that stops after one frame.
The pixi workspace sets UV_EXTRA_INDEX_URL to the pytorch CPU wheel
index. When uv lock runs inside a pixi environment, it picks up that
variable and resolves packages against the pytorch index, which only
carries cp314 wheels for markupsafe. This broke the docs CI on
Python 3.12.

Regenerated with UV_EXTRA_INDEX_URL="" to get clean PyPI-only
resolution.
The pixi workspace sets UV_EXTRA_INDEX_URL to the PyTorch CPU wheel
index. Running uv lock inside a pixi shell picks this up and resolves
packages against the PyTorch index, which can produce lockfiles with
incompatible wheels for CI. Documented the workaround (unset the
variable before running uv lock) and updated all PDM references to
uv throughout.
…evdocs

The docs workflow uses --no-build-isolation so uv skips installing
build-system.requires (meson-python, numpy). Install them explicitly.

Also updated docbuild.md from PDM to uv and documented the
UV_EXTRA_INDEX_URL pitfall when regenerating uv.lock inside a pixi
environment that sets extra-index-urls for the PyTorch wheel index.
The eon Python package is pure Python and does not need C++ extension
compilation for documentation. Using pip install triggers mesonpy
which requires cbindgen, cargo, and the full toolchain. Setting
PYTHONPATH to the repo root makes the package importable for
autodoc-pydantic without building anything.
Annotated tags do not dereference properly with depth=1 shallow
clones in meson wraps, producing "is not a commit" warnings. Use the
commit hash for v0.4.3 directly.
uv run implicitly builds and installs the project, triggering the
full mesonpy build (C++, Rust subprojects, cbindgen). The docs only
need the pure-Python eon package, which is already on PYTHONPATH.
Adding --no-project prevents uv from attempting to build.
pixi run bash on Windows triggers vcvarsall.bat activation which
hits the CMD line length limit. Use plain bash shell with direct
cargo install instead of pixi run ensure_cbindgen in all CI
workflows.
Fragments cover:
- C++ client con I/O replaced with readcon-core FFI
- Python fileio replaced with readcon package
- readcon-core added as meson subproject dependency
- FILE*/fprintf replaced with fmt::output_file in Job files
- PDM replaced with uv for Python dependency management
Docs CI: uv run --no-project could not find sphinx-build in the path.
Use .venv/bin/sphinx-build directly since uv sync installs it there.

readcon-core wrap: updated to 3b80468 which fixes Windows builds by
installing the cargo custom_target (avoiding link_whole promotion
error) and using python for cross-platform cargo build commands.
Three fixes for Windows and docs CI failures:

1. client/meson.build: use partial_dependency() to give eonclib only
   compile-time readcon headers. The full link dep goes to executables
   and eclib_dep. Prevents Meson from promoting link_with to
   link_whole on the cargo custom_target (which is unsupported).

2. ci_docs.yml: replace uv sync + PYTHONPATH approach with a pixi
   makedocs task. Sphinx and all extensions are now pypi-dependencies
   in the docs feature, eliminating the need for uv in the docs CI.

3. readcon-core.wrap: update to a8617119 which removes install: true
   from the cargo custom_target (the other half of the Windows fix).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant