Rebase libAtoms changes on top of latest cesbit/libcleri master#2
Merged
Conversation
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.
1ff22a2 to
31a507b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
Risk
Pure history rewrite of the 6 libAtoms-specific commits. The cherry-picks applied without conflict. Nothing else changed.
🤖 Generated with Claude Code