Skip to main content

The Quadrants Programming Language

Project description

What is Quadrants?

Quadrants is a high-performance multi-platform compiler for physics simulation being continuously developed by Genesis AI.

It is designed for large-scale physics simulation and robotics workloads. It compiles Python code into highly optimized parallel kernels that run on:

  • NVIDIA GPUs (CUDA)
  • Vulkan-compatible GPUs (SPIR-V)
  • Apple Metal GPUs
  • AMD GPUs (ROCm HIP)
  • x86 and ARM64 CPUs

The origin

The quadrants project was originally forked from Taichi in June 2025. As the original Taichi is no longer being maintained and the codebase evolved into a fully independent compiler with its own direction and long-term roadmap, we decided to give it a name that reflects both its roots and its new identity. The name Quadrants is inspired by the Chinese saying:

太极生两仪,两仪生四象

The Supreme Polarity (Taichi) gives rise to the Two Modes (Yin & Yang), which in turn give rise to the Four Forms (Quadrants).

Quadrants captures the idea of progression originated from taichi — built on the same foundation, evolving in its own direction while acknowledging its roots. This project is now fully independent and does not aim to maintain backward compatibility with upstream Taichi.

How Quadrants differs from upstream Taichi

While the repository still resembles upstream in structure, major changes include:

Platform support

  • LLVM 22, ARM (aarch64) support

CI

  • Kernel-level code coverage — device-side branch coverage in standard coverage.py format, integrated with pytest-cov
  • AI-driven checks for line wrapping, deleted comments, test coverage, and feature factorization

Structural improvements

  • dataclasses.dataclass structs — work with ndarrays and fields, nestable, passable to qd.func, zero kernel-runtime overhead
  • qd.Tensor — unified API over fields and ndarrays with per-tensor layout control, pickle support, and a backend= switch
  • BufferView — safe sub-range ndarray access with bounds checking in debug mode

Removed components

To focus the compiler and reduce maintenance burden, we removed: GUI/GGUI, C-API, AOT, DX11/DX12, iOS/Android, OpenGL/GLES, argpack, CLI.

Performance

  • Reduced launch latency — ndarray CPU performance improved 4.5×; ndarray GPU performance went from 11× slower than fields to ~30% slower (5090 GPU, Genesis benchmark)
  • Fastcache — opt-in source-level cache (@qd.kernel(fastcache=True)) that bypasses front-end AST parsing; reduces warm-cache kernel load from 7.2 s → 0.3 s on Genesis benchmarks
  • GPU Graphs@qd.kernel(graph=True) captures kernel sequences into a graph; qd.graph_do_while runs GPU-side iteration loops (hardware conditional nodes on CUDA SM 9.0+)
  • perf_dispatch — auto-benchmarks multiple kernel implementations and selects the fastest at runtime
  • Zero-copy interopto_torch(copy=False) / to_numpy(copy=False) via DLPack on CUDA, CPU, AMDGPU, and Metal; direct torch tensor pass-through into kernels

SIMT primitives

  • Tile16x16 / Tile32x32 — register-resident 16×16 and 32×32 matrix tiles with Cholesky, triangular solve, and rank-1 updates; 5× faster than shared-memory baselines on blocked linear algebra
  • Subgroup ops — cross-platform shuffle, shuffle_down, reduce_add, reduce_all_add across CUDA, AMDGPU, Metal and Vulkan

Autodiff

  • Autodiff with dynamic loops — computes the gradient of any kernel transparently using reverse-mode differentiation and runtime-based memory allocation
  • Forward-mode AD, custom gradients (@qd.ad.grad_replaced), qd.ad.Tape

Debugging & development

  • Python backendqd.init(qd.python) interprets kernels as plain Python so they can be stepped through in a standard Python debugger

Installation

Prerequisites

  • Python 3.10-3.13
  • Mac OS 14, 15, Windows, or Ubuntu 22.04-24.04 or compatible
  • ROCm 5.2 or newer for AMD GPU support

Procedure

pip install quadrants

(For how to build from source, see our CI build scripts, e.g. linux build scripts )

Documentation

Something is broken!

Acknowledgements

Quadrants stands on the shoulders of the original Taichi project, built with care and vision by many contributors over the years. For the full list of contributors and credits, see the original Taichi repository.

We are grateful for that foundation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

quadrants-1.1.0b2-cp313-cp313-win_amd64.whl (28.3 MB view details)

Uploaded CPython 3.13Windows x86-64

quadrants-1.1.0b2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (48.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

quadrants-1.1.0b2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl (45.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ ARM64manylinux: glibc 2.34+ ARM64

quadrants-1.1.0b2-cp313-cp313-macosx_11_0_arm64.whl (27.5 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

quadrants-1.1.0b2-cp312-cp312-win_amd64.whl (28.3 MB view details)

Uploaded CPython 3.12Windows x86-64

quadrants-1.1.0b2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (48.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

quadrants-1.1.0b2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl (45.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ ARM64manylinux: glibc 2.34+ ARM64

quadrants-1.1.0b2-cp312-cp312-macosx_11_0_arm64.whl (27.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

quadrants-1.1.0b2-cp311-cp311-win_amd64.whl (28.3 MB view details)

Uploaded CPython 3.11Windows x86-64

quadrants-1.1.0b2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (48.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

quadrants-1.1.0b2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl (45.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ ARM64manylinux: glibc 2.34+ ARM64

quadrants-1.1.0b2-cp311-cp311-macosx_11_0_arm64.whl (27.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

quadrants-1.1.0b2-cp310-cp310-win_amd64.whl (28.3 MB view details)

Uploaded CPython 3.10Windows x86-64

quadrants-1.1.0b2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (48.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

quadrants-1.1.0b2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl (45.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ ARM64manylinux: glibc 2.34+ ARM64

quadrants-1.1.0b2-cp310-cp310-macosx_11_0_arm64.whl (27.5 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file quadrants-1.1.0b2-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: quadrants-1.1.0b2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 28.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for quadrants-1.1.0b2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 0839b1f7fa8601321678c41c6c8bf37f679391117e405c8df55096bd36d8f954
MD5 33a151cbda45363de4391f9779d475b1
BLAKE2b-256 d94ca73560f8a95c44da7af8acaa2b7c2a64ce4b313d87de496057ab038c6056

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 52d1cc54138f183bab1c2bc6719654f7f4b84b09f5b2805767857112160a3e8b
MD5 5d93d3a6f464f746e9f3f647a859e580
BLAKE2b-256 5cdc1278b23ade01c415f8e8422ae643485ba7f5413c1d962cfe5b4499e5bea3

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 4c65ccbb6e8d4bd4625285d8c3dbd0e6bd1259f874e3bb36bd35f84d729af494
MD5 cd4c68962c882c828f98f72caded3aef
BLAKE2b-256 ba615e40ae9ec8dbafaa20cfc846477813009e32ef246dffbb5fc3e6d8d12ccf

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d30bf549864d4682aa358182f79e921c009916fbd4bc9d8782ecf645918754e2
MD5 dc350354fd2e856e93645ccc3a4859e8
BLAKE2b-256 40144615b0ea62a988fcc770380ef949ce22b5760ee9a3253435be53695847b3

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: quadrants-1.1.0b2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 28.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for quadrants-1.1.0b2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ba02d76237611c7996b12489484639d9f3b257a7f05bb7111c5bb40449afafe1
MD5 c39163a31270fb18535dddbce214a162
BLAKE2b-256 ff99ea6f40f0318a0bb5b76ac4cd4c6f6070361da27136ff984e8e6dcdcafdf3

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5592212b445f36de90eec1464d5e069d58a089027d858f13276f100a00b4134f
MD5 caf4489173890671c0f374f7c22bb64a
BLAKE2b-256 2fbd433a4a750b3fce9f0815fc3eb13f279d5943b64179179e0d840bd6db76c6

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 64287d217321e0f33001fc9644f0de8996ad13b7e9ac5bda37fef69a90056779
MD5 11b1477201fa45b3fdd433cb2ea8d5a6
BLAKE2b-256 a765d1b76a6339f991c7183b117a5d39329e68b005d49737fb853239b1fe767a

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d4b01cff06859fa98aca6388faa6af8bc32b1f592566b69673be8b9f24f2375
MD5 24f11ae0f06953a0e92716fcc10bcfc1
BLAKE2b-256 ad1ffaa5fe434ad81342d91cac77d03acf7ec6446e0c5cea0aedc5be0ca2c605

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: quadrants-1.1.0b2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 28.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for quadrants-1.1.0b2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 baf07c4178e666bcfcb3095b114b4ba7bbf4f0ef48c210ee9bf57bd5a268f617
MD5 0fbf045e1915b739e8b87575cee3be4e
BLAKE2b-256 f558c5df817ce8aeec735386d69b8c1e225f92a85f7540afd119364f3b66c041

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 19e5b7b51f86cbe79c9dbbcfcf463900b4b2f6a553ccfa2c4631756f1b7bc8a5
MD5 c11b420d8165ccfcd90b7152a3d3f839
BLAKE2b-256 240e742b929853fa111d38319aad9b78b6452db1296e9bac25ed41a3e0ff4d51

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 5109867ce58e4bbba26df084d2a81e61efaf0a2185e290cd6f4595823bd34919
MD5 9dc09342aeb6bb4f609fbbde3c11621b
BLAKE2b-256 f877813e815ce31bb1d1ac79cf4b64c9360803b747b5a08710fa682c46224bf1

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 539f7cc9056facc776c49f0123d5cf3ce58de6b18e1462b533ac92bce659656d
MD5 e57e90d92ed320b5b051658716282e3f
BLAKE2b-256 ebf6cda8acdf0a135a83998575d0778697718238a4d9513b1c76dd98b62b376a

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: quadrants-1.1.0b2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 28.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for quadrants-1.1.0b2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8b16ed66e26eb5f0c07aa2179f9e410672434f11f3d2379d0749b03e72f41c6e
MD5 464d465dedd63883f44438791a25182a
BLAKE2b-256 a541a21882b758cb4ad05585e370464a271515aa1a3373959517e5927a34d458

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 566305dafe0a411709f89e40df85eb7d7f182ba2fee1bd194c74433779d0bc86
MD5 cdd2c0a6153f9ca2c68ccfc97749ad96
BLAKE2b-256 12d9641febec8a2619e7bfa5185acfcfdb0557e5b96096bef28718321bf8b6dc

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 74f1ffbb5f39e82df7da8a87e6b20e05eda18f4447704c927fe45a17bd5d8f97
MD5 27899722f4a76faee57e82928a10a884
BLAKE2b-256 a415f30488d13db0f9bd45cdacede46724940c7ee6ed45326cff81036752640c

See more details on using hashes here.

File details

Details for the file quadrants-1.1.0b2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for quadrants-1.1.0b2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c80fd8806f2cc203cfb1a6443bf6bcb64647de18b0f3e9c888d6a3d00e1fc2a
MD5 4f277002224a5f99364dd89a838cedab
BLAKE2b-256 c9e74adfbabacdf02c1c1a169953a492247970c8ffef7055431621bd4af6b2ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page