Skip to content

Rebase libAtoms changes on top of latest cesbit/libcleri master#2

Merged
jameskermode merged 11 commits into
masterfrom
rebase-on-upstream-master
Apr 30, 2026
Merged

Rebase libAtoms changes on top of latest cesbit/libcleri master#2
jameskermode merged 11 commits into
masterfrom
rebase-on-upstream-master

Conversation

@jameskermode
Copy link
Copy Markdown
Member

Brings libAtoms/libcleri's master up to date with cesbit/libcleri upstream and the libAtoms-specific commits that have been accumulating on the `meson` branch.

Why

`origin/master` (libAtoms/libcleri) currently sits at `be1dd1b` (Oct 2022), well behind upstream cesbit/libcleri master at `2964b6c` (Oct 2023). The `meson` branch has been the de-facto active branch and already contains both the upstream commits and our 6 libAtoms-specific ones, with one extra merge commit on top from PR #1 (the JIT change).

What

Rebases the libAtoms-specific commits cleanly on top of upstream cesbit/libcleri master, producing a fully linear history. The new commit chain on top of upstream's tip (`2964b6c`) is:

  1. `afa3f7b` — add meson build script
  2. `bb1a7c3` — Add minimal Windows/MSVC compatibility for attribute
  3. `5cbb6b9` — Fix meson.build: remove deleted children.c source file
  4. `e36632a` — Add strncasecmp compatibility for MSVC
  5. `afc3f01` — Add libcleri.a static library target to makefile
  6. `1ff22a2` — perf: JIT-compile PCRE2 patterns when supported

Tree contents are byte-identical to `origin/meson`'s tip (`git diff --stat rebase-on-upstream-master origin/meson` is empty); only the merge commit from PR #1 was flattened into a linear pick of `893a7aa`.

Effect on consumers

  • libAtoms/extxyz pins this submodule by SHA, so it can move to `1ff22a2` (this branch's tip) at its convenience to pick up the JIT speedup. Bumping that pointer is a separate PR there.
  • Anyone who was tracking `origin/master` was looking at 3-year-old code; this brings them current.

Risk

Pure history rewrite of the 6 libAtoms-specific commits. The cherry-picks applied without conflict. Nothing else changed.

🤖 Generated with Claude Code

giordano and others added 11 commits October 31, 2022 14:28
Do not hard-code GCC as compiler
This adds a minimal compatibility header wincompat.h that makes
__attribute__ a no-op on MSVC compilers, which don't support it.

This is the only compatibility fix needed on top of upstream/master,
as the ssize_t issue was already resolved upstream by changing
return types to uint8_t in kwcache.h.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The children.c file was removed in commit 3894be2 ("no more children type")
but the meson.build file was not updated. This commit removes the reference
to the deleted source file from the static library sources list.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
MSVC doesn't have strncasecmp, it uses _strnicmp instead.
This adds a define to map strncasecmp to _strnicmp on MSVC.

Fixes Windows linking error: unresolved external symbol strncasecmp

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The makefile only had targets for the shared library, but the
Python package workflow needs to build the static library.

This adds an ar target to create libcleri.a from the object files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add pcre2_jit_compile(re, PCRE2_JIT_COMPLETE) immediately after each
pcre2_compile() call:

- src/regex.c: per-rule regex objects (cleri_regex)
- src/grammar.c: the global keyword-matching pattern

pcre2_match() automatically uses the JIT'd code paths when present
and silently falls back to the interpreter otherwise, so this is a
strict perf win where supported and a no-op everywhere else (e.g.
PCRE2 builds without --enable-jit, in which case
pcre2_jit_compile returns PCRE2_ERROR_JIT_BADOPTION which we ignore).

Measured against the libAtoms/extxyz benchmark (ase.io.read on a
trajectory of N atoms, comparing extxyz's cextxyz path to ASE's
built-in regex extxyz reader), the per-atom JIT in extxyz.c gave
~1.85x; this libcleri-side JIT contributes additional speedup on
files with rich comment-line info dicts where cleri grammar walking
+ regex matching dominates.
@jameskermode jameskermode force-pushed the rebase-on-upstream-master branch from 1ff22a2 to 31a507b Compare April 30, 2026 08:31
@jameskermode jameskermode merged commit d12f5fa into master Apr 30, 2026
1 check passed
@jameskermode jameskermode deleted the rebase-on-upstream-master branch April 30, 2026 08:33
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.

3 participants