This artifact measures the initial kernel-primitive implementation at 134218dd34. The current PR uses a transparent Lean definition; its measurements and reproducible drivers are separate.
On the popcount PR branch, copy KernelBench.lean to tests/elab_bench/popcount_bench.lean and NativeBench.lean to tests/compile/popcount_bench.lean. Create an empty tests/compile/popcount_bench.lean.no_interpret_test so the compile test executes only the C-compiled binary, then run:
POPCOUNT_SAMPLES=/tmp/kernel.csv tests/with_stage1_test_env.sh tests/elab_bench/run_bench.sh popcount_bench.lean
POPCOUNT_NATIVE_SAMPLES=/tmp/native.csv tests/with_stage1_test_env.sh tests/compile/run_test.sh popcount_bench.lean
Both drivers use four adjacent AB/BA blocks on the same shared host. Dense inputs are 2^width−1; sparse inputs contain the highest and lowest bits. CSV fields: block,width,dense,reference arm,measured arm,nanoseconds. Runtime samples contain 100 calls; kernel samples contain one fresh Kernel.check, excluding imports, input construction, and expected-result calculation. Wrong-result controls are required to fail. The runtime driver is compiled to C and linked by Lean's standard compile-test harness, not timed through the interpreter.
bits is the original bit-by-bit counting recurrence. chunks adapts the masked 64-bit parallel count from Bhavik Mehta's PrimeCert #156, applying it only to masked words and summing into Nat (counts above 255 do not wrap). These are comparison implementations, not exported APIs. The new primitive scans stored limbs. kernel-record.json and native-record.json retain CPU affinity and host load; all completed samples are included.
The earlier samples.csv/record.json run is retained. Its native100 rows ran in elaborator evaluation and are not compiled-runtime evidence; use native-samples.csv for that comparison.