Skip to content

quadrants: Add version 1.3.3 - #3270

Draft
luhenry wants to merge 2 commits into
mainfrom
port/quadrants
Draft

luhenry wants to merge 2 commits into
mainfrom
port/quadrants

Conversation

@luhenry

@luhenry luhenry commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Genesis-AI's scikit-build-core fork of taichi: a C++ compiler with an LLVM JIT CPU backend. Upstream publishes no riscv64 wheel.

Mirrors upstream's manylinux_wheel.yml.

Differs from upstream

  • Builds LLVM+clang 22.1.0 from source (RISCV target only) - quadrants-sdk-builds ships no riscv64 LLVM
  • CUDA/AMDGPU/Vulkan turned off - no riscv64 backend exists for any of them
  • --group dev trimmed to the build-only subset - full group pulls pyright, which has no riscv64 wheel/sdist

Testing

  • smoke import + qd.init(arch=qd.cpu) only - upstream's pytest suite (tests/run_tests.py) is deferred to a follow-up

License: OK

Patches

  • 0001-Add-a-riscv64-CPU-arch.patch - To upstream. Adds riscv64 to the CPU-arch enum; without it CMake FATAL_ERRORs on an unknown processor.
  • 0002-CI-support-riscv64-in-the-LLVM-sccache-manylinux-build-scripts.patch - Inappropriate [no riscv64 LLVM/sccache release exists]. Wires our from-source LLVM in and turns off the nonexistent GPU backends.
  • 0003-CI-trim-riscv64-dev-group-install-and-drop-submodule-reinit.patch - Inappropriate [riscv64 has no pyright wheel]. pip install --group dev otherwise fails outright.

First riscv64 attempt; CI running at the time of this PR, see checks for current status.

Genesis-AI's fork of taichi: a scikit-build-core C++ compiler with an
LLVM JIT CPU backend. Compared with the parked taichi entry, two of
taichi's three walls are gone here: quadrants targets LLVM 22.1.0
(opaque pointers; RuntimeDyldELF has real RISC-V relocation handling
since LLVM 20, confirmed directly against llvmorg-22.1.0 source: 42
riscv hits, a real resolveRISCVRelocation()) and finds clang via
clang-22/21/20. The remaining wall is quadrants having no riscv64 CPU
arch and no riscv64 LLVM to build against:

- patches/quadrants/1.3.3/0001 adds a riscv64 CPU arch alongside
  x64/arm64 everywhere they're handled (CXXFlags, the arch enum,
  rhi/arch.cpp, and four scattered "is this a CPU arch" checks in the
  LLVM codegen/transforms).
- 0002/0003 patch the CI build scripts: no riscv64 LLVM/sccache
  release exists to download, so setup_llvm() expects LLVM_DIR to
  already point at the LLVM we build ourselves, setup_sccache()
  no-ops (ccache from the manylinux image covers it instead), CUDA/
  AMDGPU/Vulkan (no riscv64 backend for any of them) are turned off,
  and the dev dependency group is trimmed to what the build actually
  needs (full --group dev pulls pyright, which has no riscv64 wheel
  or sdist).

build-quadrants.yml builds LLVM+clang 22.1.0 from source once (RISCV
target only, matching build-libclang.yml's from-source precedent but
also linking OrcJIT/ExecutionEngine/RuntimeDyld, which libclang.so
doesn't need), then reuses it across the cp310/cp311/cp312/cp313
matrix - mirroring upstream's own manylinux_wheel.yml scripts
(1_prerequisites.sh/2_build.sh/3_check.sh) almost verbatim, pointed at
our own LLVM instead of their quadrants-sdk-builds releases. GCC (not
our built clang) still compiles the bulk of the project, same as
upstream; clang only compiles the LLVM JIT's runtime.cpp bitcode, and
the main library links the static LLVM libraries GCC-side, which is
an ordinary cross-compiler-ABI link on Linux.

No gpl_sources job: the build doesn't statically link libstdc++ into
the wheel (that flag is MinGW-only in QuadrantsCXXFlags.cmake), and
glibc-based manylinux auditwheel doesn't bundle it either.
jobs.<job_id>.container and jobs.<job_id>.name don't have the env
context available (only github/needs/strategy/matrix/inputs/vars), so
${{ env.MANYLINUX_RISCV64_IMAGE }} in container: and ${{ env.LLVM_VERSION }}
in a job name failed workflow validation outright (zero jobs scheduled,
run marked failed). Hardcode the image literal in both container
blocks, matching build-openmm.yml/build-syntaqlite.yml, and drop the
now-unused MANYLINUX_RISCV64_IMAGE workflow env (LLVM_VERSION stays -
run/with contexts do have env available).
luhenry added a commit that referenced this pull request Oct 15, 2026
@luhenry
luhenry marked this pull request as draft October 15, 2026 12:13

This branch has not been deployed

No deployments
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.

1 participant