brotkit 0.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
brotkit/__init__.py ADDED
@@ -0,0 +1,7 @@
1
+ """brotkit: GPU-accelerated, SymPy-driven fractal rendering for notebooks."""
2
+
3
+ from importlib.metadata import version
4
+
5
+ __version__: str = version("brotkit")
6
+
7
+ __all__ = ["__version__"]
@@ -0,0 +1,15 @@
1
+ # AGENTS.md: codegen
2
+
3
+ Rules for `src/brotkit/codegen/` (SymPy → real arithmetic → Numba kernel source). The root
4
+ `AGENTS.md` still applies; these add to it. Background: "Formula pipeline" and "Architecture
5
+ review" in `docs/design/spec.md`.
6
+
7
+ - **fastmath only for f32.** Only `Precision.F32` kernels may compile with `fastmath=True`.
8
+ - **Multi-word arithmetic compiles with fastmath off.** df64, dd and qf rely on error-free
9
+ transformations (two-sum, two-product) that break under reassociation or FMA contraction.
10
+ Their kernels use `fastmath=False` and emit FMAs explicitly. Parity tests must cover this.
11
+ - **Generated source must be inspectable.** Kernels are written to real `.py` files in the
12
+ cache (never `exec`). `.source`, `.ptx` and `.explain()` must keep working. The cache key
13
+ covers source, backend, precision and Numba/numba-cuda versions.
14
+ - Features compose at codegen time through template slots (`init`, `step`, `escape_test`,
15
+ `per_iter`, `finalise`), never through runtime dispatch.
@@ -0,0 +1 @@
1
+ """Code generation: SymPy formulas to Numba kernel source. See AGENTS.md here."""
brotkit/py.typed ADDED
File without changes
@@ -0,0 +1,135 @@
1
+ Metadata-Version: 2.4
2
+ Name: brotkit
3
+ Version: 0.0.2
4
+ Summary: GPU-accelerated, SymPy-driven fractal rendering for notebooks
5
+ Keywords: fractal,mandelbrot,julia,buddhabrot,sympy,numba,cuda,jupyter
6
+ Author: Eoin O'Brien
7
+ License-Expression: BSD-3-Clause
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 2 - Pre-Alpha
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Programming Language :: Python :: 3.15
16
+ Classifier: Topic :: Multimedia :: Graphics
17
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
18
+ Classifier: Typing :: Typed
19
+ Requires-Dist: av ; extra == 'video'
20
+ Requires-Python: >=3.14
21
+ Project-URL: Repository, https://github.com/eoin-obrien/brotkit
22
+ Project-URL: Issues, https://github.com/eoin-obrien/brotkit/issues
23
+ Provides-Extra: cuda
24
+ Provides-Extra: video
25
+ Description-Content-Type: text/markdown
26
+
27
+ <!--
28
+ Hero strip (backlog 1.23): four renders produced in CI from docs/hero/*.recipe.json, so the
29
+ front-page image is also a golden test. Absolute URLs, because PyPI renders this README too.
30
+ Hero PNGs are ordinary git files (not LFS), optimised to ~300 KB each: see ADR-0003.
31
+
32
+ <p align="center">
33
+ <img src="https://raw.githubusercontent.com/eoin-obrien/brotkit/main/docs/hero/mandelbrot-de.png" width="24%" alt="Mandelbrot set with distance-estimate shading">
34
+ <img src="https://raw.githubusercontent.com/eoin-obrien/brotkit/main/docs/hero/nebulabrot.png" width="24%" alt="Nebulabrot">
35
+ <img src="https://raw.githubusercontent.com/eoin-obrien/brotkit/main/docs/hero/newton-basins.png" width="24%" alt="Newton basins">
36
+ <img src="https://raw.githubusercontent.com/eoin-obrien/brotkit/main/docs/hero/oblique-4d-slice.png" width="24%" alt="Oblique 4D slice between the Mandelbrot and Julia planes">
37
+ </p>
38
+ -->
39
+
40
+ # brotkit
41
+
42
+ **GPU-accelerated, SymPy-driven fractal rendering for notebooks.**
43
+
44
+ <!-- Package -->
45
+ <!-- [![PyPI](https://img.shields.io/pypi/v/brotkit.svg)](https://pypi.org/project/brotkit/) -->
46
+ [![Python](https://img.shields.io/badge/python-3.14%20%7C%203.15-blue.svg)](https://github.com/eoin-obrien/brotkit/blob/main/pyproject.toml)
47
+ [![Licence: BSD-3-Clause](https://img.shields.io/badge/licence-BSD--3--Clause-blue.svg)](https://github.com/eoin-obrien/brotkit/blob/main/LICENSE)
48
+ <!-- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.XXXXXXX.svg)](https://doi.org/10.5281/zenodo.XXXXXXX) -->
49
+
50
+ <!-- Quality -->
51
+ [![CI](https://github.com/eoin-obrien/brotkit/actions/workflows/ci.yml/badge.svg)](https://github.com/eoin-obrien/brotkit/actions/workflows/ci.yml)
52
+ <!-- [![GPU nightly](https://github.com/eoin-obrien/brotkit/actions/workflows/gpu-nightly.yml/badge.svg)](https://github.com/eoin-obrien/brotkit/actions/workflows/gpu-nightly.yml) -->
53
+ <!-- [![Coverage](https://codecov.io/gh/eoin-obrien/brotkit/graph/badge.svg)](https://codecov.io/gh/eoin-obrien/brotkit) -->
54
+ <!-- [![Docs](https://github.com/eoin-obrien/brotkit/actions/workflows/docs.yml/badge.svg)](https://github.com/eoin-obrien/brotkit/actions/workflows/docs.yml) -->
55
+
56
+ <!-- Tooling -->
57
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
58
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
59
+ [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
60
+ [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
61
+ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://www.conventionalcommits.org/)
62
+
63
+ <!-- Agent-ready -->
64
+ [![AGENTS.md](https://img.shields.io/badge/AGENTS.md-ready-black)](https://github.com/eoin-obrien/brotkit/blob/main/AGENTS.md)
65
+ <!-- [![llms.txt](https://img.shields.io/badge/llms.txt-available-black)](https://brotkit.readthedocs.io/llms.txt) -->
66
+
67
+ > [!NOTE]
68
+ > brotkit is in early development (phase 0). Nothing below is released yet; this README
69
+ > describes what's being built. See the [design spec](https://github.com/eoin-obrien/brotkit/blob/main/docs/design/spec.md)
70
+ > and the [roadmap](https://github.com/eoin-obrien/brotkit/milestones).
71
+
72
+ ## Highlights
73
+
74
+ - **Any SymPy formula, with analytic derivatives.** Write f(z, c) in SymPy. brotkit
75
+ differentiates it, lowers it to real arithmetic and compiles one fused kernel for the CPU
76
+ (Numba) or GPU (numba-cuda).
77
+ - **Render once, colour many.** A render saves raw data layers (iterations, final z, log|dz|,
78
+ orbit statistics), so you can try 50 palettes on a 16k image without re-iterating.
79
+ - **Correct anti-aliasing.** Adaptive scrambled-Sobol supersampling, with every sample
80
+ coloured and then filtered in linear light.
81
+ - **Precision tiers for deep zooms.** f32, df64, f64, double-double and quad-float picked
82
+ automatically from the zoom, with perturbation to come.
83
+ - **4D animation.** Parameter paths, SO(4) rotations through the (z₀, c) space between
84
+ Mandelbrot and Julia slices, and a frame pipeline straight to video.
85
+
86
+ ## Install
87
+
88
+ ```bash
89
+ uv add brotkit # CPU (Numba)
90
+ uv add "brotkit[cuda]" # NVIDIA GPU (numba-cuda + CUDA runtime wheels)
91
+ uv add "brotkit[video]" # video encoding (PyAV)
92
+ ```
93
+
94
+ The GPU extra needs only an NVIDIA driver; the CUDA runtime and compiler come as wheels.
95
+ The minimum driver and compute capability will be pinned after spike S1. Check your setup
96
+ with `brotkit doctor` (backlog 1.20).
97
+
98
+ ## Quickstart
99
+
100
+ Coming with the walking skeleton (backlog 1.8 and 1.23): at most 10 lines that render a
101
+ Mandelbrot set and then recolour it without re-rendering, each followed by its output image.
102
+ Every code block in this README will run in CI.
103
+
104
+ ## Gallery and features
105
+
106
+ The gallery arrives with the docs site (backlog 1.23).
107
+
108
+ | Area | What's planned |
109
+ | --- | --- |
110
+ | Families | Escape time (Mandelbrot, Julia, Multibrot, Burning Ship, any SymPy f(z, c)); convergent (Newton, Halley, Nova, Magnet); density (Buddhabrot, Nebulabrot, inverse iteration, strange attractors) |
111
+ | Colourings | Smooth iteration, distance estimate, binary/n-ary decomposition, stripe/TIA/curvature averages, orbit traps, potential, interior period/multiplier, Lyapunov |
112
+ | Precision | `f32`, `df64`, `f64`, `dd`, `qf`, with `auto` selection; perturbation + BLA for unbounded zoom |
113
+ | Animation | Keyframe tracks, log-width zooms, complex-parameter paths, SO(4) rotations, exponential-map zooms, iteration-folding views |
114
+
115
+ ## CLI
116
+
117
+ ```bash
118
+ brotkit render recipe.json
119
+ ```
120
+
121
+ (backlog 1.20)
122
+
123
+ ## Docs
124
+
125
+ The documentation site and its [`llms.txt`](https://llmstxt.org/) arrive with backlog 1.23.
126
+
127
+ <!-- [Documentation](https://brotkit.readthedocs.io) · [llms.txt](https://brotkit.readthedocs.io/llms.txt) -->
128
+
129
+ ## Contributing, citing, licence
130
+
131
+ - Contributions are welcome. See [CONTRIBUTING.md](https://github.com/eoin-obrien/brotkit/blob/main/CONTRIBUTING.md),
132
+ and if you work with a coding agent, [AGENTS.md](https://github.com/eoin-obrien/brotkit/blob/main/AGENTS.md).
133
+ - If you use brotkit in research, please cite it using [CITATION.cff](https://github.com/eoin-obrien/brotkit/blob/main/CITATION.cff)
134
+ (GitHub's "Cite this repository" button).
135
+ - Licensed under the [BSD-3-Clause licence](https://github.com/eoin-obrien/brotkit/blob/main/LICENSE).
@@ -0,0 +1,8 @@
1
+ brotkit/__init__.py,sha256=5o5RqbigO_07CuYdRJJxZZ3ewopwKOYtC2lmdrXKUxY,184
2
+ brotkit/codegen/AGENTS.md,sha256=nR6qDQ7Hk19Bd3otg6bnOZLM6CwipDcMm20xAcRSUHs,1012
3
+ brotkit/codegen/__init__.py,sha256=Gp_tBVnFNGbmu7egCTAPT2T4QD6PbK7gUW1AYRf3ZIE,82
4
+ brotkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ brotkit-0.0.2.dist-info/licenses/LICENSE,sha256=GyF7_5N8vDxNZMlbrrxGZASD6lVz6h47c-MjB7dOp-k,1499
6
+ brotkit-0.0.2.dist-info/WHEEL,sha256=G_-rrEibZr7OEM7zdH1dSO6s-VdjfnS5PA4CLAdI9Vw,80
7
+ brotkit-0.0.2.dist-info/METADATA,sha256=yR-Jeut6vlM3AhejniM3adS3hOBQCr6QqlLeWQ9BMzc,7567
8
+ brotkit-0.0.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: uv 0.13.9
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Eoin O'Brien
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.