feat: add portable liblecore ABI-0 kernel - #30
Conversation
…PIPELINE_MAP, FACULTY_MAP, DOC_MAP) [skip ci]
Optimized performance regression gateCommit Final local comparison: Apple arm64, Apple Clang 17 Release, Python 3.14.5, NumPy 2.4.4, deterministic inputs, ten aligned candidate/base samples per cell. Candidate is
All six paired regimes pass the The gate now:
The exact bootstrap run also passes; its shortest sample was 36.58 ms. The current PR is bootstrap-only on GitHub because |
Summary
Why
leCore already had frozen Python HRR semantics, while related projects maintained separate native kernels with different normalization, numeric, and packaging behavior. This introduces one clean-room MIT C implementation whose behavior is defined by the existing ISA/reference rather than by adopter-specific policy.
The native layer remains optional. Existing Python behavior and persisted formats are unchanged unless a consumer explicitly adopts liblecore.
Developer impact
0is an implementation preview, not the stable ABI-1 release.major.minoras their preview SONAME/install-name; this0.1.xline uses0.1.AUTOdeliberately remains on the direct reference backend; radix-2 must be selected explicitly until adopter workloads justify a portable crossover policy.Optimization review
The final Apple-arm64 Release comparison loads the optimized build and pre-optimization commit
bd8da06together, uses identical inputs and iteration counts, and alternates candidate/base order for ten paired samples per cell.Direct results remain bit-for-bit equal to the ordered reference. Maximum radix/direct disagreement was
1.665e-16for f64 and1.192e-7for f32. Focused local probes measured about 1.5x for fixed-role bind/unbind and about 1.1–1.2x for repeated-query scoring/cleanup, with exact outputs and decisions.Performance gate
The Linux Release job times a pre-resolved public C ABI call rather than the checked Python adapter. Candidate and exact base-commit libraries run in one process as aligned, alternating pairs; the checker gates the median of per-pair slowdown ratios at
1.35xfor direct and radix-2 independently.The harness uses three pilots, calibrates from the fastest observation, and requires final samples to meet the duration target. If either side has an undersized sample, it discards and symmetrically reacquires the whole pair with more work, bounded to three attempts and 1,000,000 calls. There is one policy evaluation and no asymmetric “retry until pass.” Raw JSON is uploaded and the scorecard is written to the job summary.
Because
maindoes not yet contain liblecore, this introductory PR takes the documented bootstrap path and makes no hosted candidate/base speed claim. The local paired report above is the pre/post evidence; after merge, every relevant PR automatically compares against its exact base commit. Specialized batch/scoring performance cells are explicitly tracked asLC-047.Validation
actionlintFollow-ups
LC-047paired batch/scoring performance cells and consumer-level benchmarks