Skip to content

Add C and Common Lisp base kernels with a Rust comparison - #1084

Closed
MrJ-am wants to merge 1 commit into
PlummersSoftwareLLC:drag-racefrom
MrJ-am:codex/algorithm-base
Closed

MrJ-am wants to merge 1 commit into
PlummersSoftwareLLC:drag-racefrom
MrJ-am:codex/algorithm-base

Conversation

@MrJ-am

@MrJ-am MrJ-am commented Sep 16, 2026 •

Copy link
Copy Markdown

Series: base #1084, wheel #1085, other #1082.

This is the base part of a three-category C/Rust/Common Lisp comparison. It preserves odd-candidate scanning and source-level individual marking, following the accepted dense/sparse approach in Rust solution 1.

Adds C solution 6 and Common Lisp solution 4. Constant address carries remove sparse-loop indexing work; the Lisp dense generator uses single-assignment bindings so stock SBCL can fold the individual bit operations. Both entries allocate fresh state for every pass. Rust solution 1 is retained unchanged because the attempted changes did not establish a stable gain.

These separate entries keep the direct C kernels independent of the existing C tuning infrastructure and isolate the native-memory, SBCL 2.6.8 implementation from the existing Lisp runtime requirements. The series reserves Lisp 3 for the existing other PR and Lisp 5 for wheel.

On one logical CPU of an AMD EPYC 9V74, four five-second samples at limit 1,000,000 gave these medians:

Language Reference Retained entry Passes/s
C solution 5: 4,041 solution 6 13,815
Lisp solution 2 dense: 3,331 solution 4 10,139
Rust unchanged solution 1 unrolled 14,219

The C/Rust gap is small relative to the observed spread. Commands, raw measurements and limits are included.

Native validation passed: independent full-flag checks, memory guards, 10M counts, and ASan/UBSan for C (leak detection unavailable under container tracing). Dockerfiles are included but Docker was unavailable locally. Submitted as a draft pending container/CI review. Development and source inspirations are credited in the READMEs.

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.

2 participants