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

Abierto
#1,989 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
15/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
cpp, macos, python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)

Lenguaje dominante
Python
Estrellas
397
Forks
127
Merge medio
2 d 19 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de quantumlib/Qualtran

Todos los issues de quantumlib/Qualtran

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.