kickmix on Apple Silicon: a NEON build in a separate repo (not a PR, per your CLA policy)

Open
#1,989 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
cpp, macos, python

Research direction

The report points to kickmix-macos and describes proposed NEON additions under simd/, dispatch in simd.h, and test and benchmark instantiations. Read the linked repository and its patch as reference; there is no upstream change requested or defined as done. The report also flags a macOS 26 sanitizer startup hang and a working setup.py build path.

Written by the indexing model from the issue text.

Description

Hi all,

First, thanks for kickmix and for the Kaggle competition. The verifier design
(seeded fuzz testing of kickmix circuits) is what made the competition workable
for people like me who are not quantum specialists.

I want to flag something I built, and I want to be upfront about why it is not a
pull request. Your CONTRIBUTING.md says AI-generated code does not qualify as a
contributor's original creation under the CLA. The code below was written with an
AI coding assistant working under my direction, so I have not offered it upstream
and I am not asking you to take it. It exists, it is Apache-2.0, and if any of it
is useful as a reference or a spec for someone to implement independently, that
would be great.

What it is: https://github.com/manwithacat/kickmix-macos

  • The kickmix/ directory from your main at 638777fa, unchanged except for an
    overlay that adds simd/b128_neon.h and simd/b256_neon.h (AArch64 NEON word
    types with the same interface as b128_sse / b256_avx), the dispatch in
    simd.h behind a KICKMIX_DISABLE_NEON opt-out, and the corresponding
    TEST_EACH_SIZE_W / BENCHMARK_EACH_SIZE_W instantiations. The whole change is
    one patch file; modified files are listed in the NOTICE as the license asks.
  • Motivation: on Apple Silicon kickmix currently runs the scalar polyfill for
    b256, which is what the Python Simulator uses. The competition's shipped
    kickmix.so is x86-64 Linux only, so Mac users had no native verifier at all.

What we measured (10-core Apple Silicon, macOS 26, Apple clang 17, CPython 3.13):

  • Your Python suite: 3,403 passed. Your C++ simd, ChaCha and popcount suites
    compiled directly with googletest: 174 passed, 58 of them the NEON instantiations.
    Simulation transcripts are bit-identical between the NEON and portable builds.
  • The three competition verifiers reproduce their hosted Kaggle results to the
    last digit on the reference circuits, including DQI's sampled mean Toffoli count,
    so the seeded ChaCha sampling matches your Bazel-built binary.
  • Throughput on the competition reference circuits: invsqrt 29.4 → 56.0 G
    gate-shots/s (1.90×), DQI 71.8 → 83.1 (1.16×). On a random-gate synthetic circuit
    there is no gain (clang already vectorizes the polyfill well there), so the win is
    specific to structured circuits.

Two things that may be useful to you regardless of the NEON code:

  1. bazel test kickmix:kickmix_test hangs before any output on macOS 26 with Apple
    clang 17. A sample trace shows AddressSanitizer's own start-up
    (AsanInitInternal → InitializeShadowMemory → StaticSpinMutex::LockSlow)
    deadlocking. Your macOS CI runners are fine, so this looks toolchain-specific,
    but it is worth knowing if you get reports from people on the newest macOS.
    --copt=-fno-sanitize=all --linkopt=-fno-sanitize=all is not a clean
    workaround either; the test target then fails to link a GF2Field constructor.
  2. Apple clang 17 builds the current setup.py path with zero errors (11 warnings,
    mostly -Wpessimizing-move), so the pip install ./kickmix route works on macOS
    without Homebrew LLVM now.

No action needed. If you would rather I did not keep a vendored copy public, or
you would like it renamed or described differently, say so and I will do it.

Thanks again,
James (manwithacat)

Dominant language
Python
Stars
397
Forks
127
Avg merge
2d 22h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quantumlib/Qualtran

All issues in quantumlib/Qualtran

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.