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 +7 -0
- brotkit/codegen/AGENTS.md +15 -0
- brotkit/codegen/__init__.py +1 -0
- brotkit/py.typed +0 -0
- brotkit-0.0.2.dist-info/METADATA +135 -0
- brotkit-0.0.2.dist-info/RECORD +8 -0
- brotkit-0.0.2.dist-info/WHEEL +4 -0
- brotkit-0.0.2.dist-info/licenses/LICENSE +28 -0
brotkit/__init__.py
ADDED
|
@@ -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
|
+
<!-- [](https://pypi.org/project/brotkit/) -->
|
|
46
|
+
[](https://github.com/eoin-obrien/brotkit/blob/main/pyproject.toml)
|
|
47
|
+
[](https://github.com/eoin-obrien/brotkit/blob/main/LICENSE)
|
|
48
|
+
<!-- [](https://doi.org/10.5281/zenodo.XXXXXXX) -->
|
|
49
|
+
|
|
50
|
+
<!-- Quality -->
|
|
51
|
+
[](https://github.com/eoin-obrien/brotkit/actions/workflows/ci.yml)
|
|
52
|
+
<!-- [](https://github.com/eoin-obrien/brotkit/actions/workflows/gpu-nightly.yml) -->
|
|
53
|
+
<!-- [](https://codecov.io/gh/eoin-obrien/brotkit) -->
|
|
54
|
+
<!-- [](https://github.com/eoin-obrien/brotkit/actions/workflows/docs.yml) -->
|
|
55
|
+
|
|
56
|
+
<!-- Tooling -->
|
|
57
|
+
[](https://github.com/astral-sh/uv)
|
|
58
|
+
[](https://github.com/astral-sh/ruff)
|
|
59
|
+
[](https://microsoft.github.io/pyright/)
|
|
60
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
61
|
+
[](https://www.conventionalcommits.org/)
|
|
62
|
+
|
|
63
|
+
<!-- Agent-ready -->
|
|
64
|
+
[](https://github.com/eoin-obrien/brotkit/blob/main/AGENTS.md)
|
|
65
|
+
<!-- [](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,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.
|