ResearchSwift + Metal

Fractlz

GPU fractal renderer achieving 1e10,000,000+ zoom

Real-time Julia set renderer pushing the boundaries of numerical precision. Three-tier architecture enables theoretically unbounded magnification.

Max Zoom
1e10,000,000+
The Challenge

The precision wall

Standard 64-bit floating point gives you about 15 significant digits. That's enough for most applications—but fractals are different. At 1015 magnification, you've exhausted every bit of precision. The image dissolves into noise.

Arbitrary precision arithmetic can go deeper, but it's catastrophically slow—each operation scales with digit count. At 10300, a single frame could take minutes. Real-time rendering seems impossible.

Zoom depth achieved
1e1
That's more digits than atoms in the observable universe
Architecture

Three tiers of precision

Each technique hands off to the next, chaining precision indefinitely

🚀
Tier 11x → 10¹⁵

Native Float64

GPU-accelerated standard precision. Metal shaders process millions of pixels in parallel with hardware double-precision.

📐
Tier 210¹⁵ → 10³⁰⁰

Perturbation Theory

Compute one high-precision reference orbit, derive nearby pixels as small deltas. Quadratic error accumulation bounds iterations.

Tier 310³⁰⁰ → ∞

Self-Similarity Wrapping

At repelling periodic points, the fractal repeats at scale |λ|. Reset coordinates and chain precision indefinitely.

Perturbation Theory

The δ trick

Instead of computing each pixel's orbit independently at high precision, we compute one reference orbit Zn and express nearby pixels as small perturbations δ.

// Recurrence relation
δn+1 = 2Znδn + δn²

For small δ, the quadratic term vanishes. We get the speed of float64 with the depth of arbitrary precision—until error accumulates past pixel scale.

Bivariate Linear Approximation (BLA) takes this further, skipping entire iteration blocks where the linear model holds.

Reference Zn
Perturbed δn
Periodic point
At scale |λ|, coordinates reset and the pattern repeats
1.0x → zoom...
Self-Similarity

The infinite trick

Near repelling periodic points, the Julia set exhibits exact self-similarity. The multiplier λ = ∏2zi determines the scaling and rotation.

When we've zoomed by factor |λ|, the fractal looks identical. We reset coordinates to the periodic point and continue—chaining precision layers indefinitely.

Zoom thresholdscale × |λ|
Transformationscale(1/|λ|) + rotate(arg λ)

This is how we achieve 1010,000,000+ zoom. Not by computing ten million digits—by recognizing the pattern repeats.

Implementation

Built for Apple Silicon

Unified memory, Swift concurrency, and Metal compute shaders—the perfect stack for real-time fractals

120 FPS ProMotion

Metal shaders with early-exit optimization for fast-escaping pixels, buttery smooth on ProMotion displays at any depth.

🔄

Async Orbit Computation

Swift actors isolate precision-critical calculations, preventing data races in multi-threaded big-number arithmetic.

🎯

Zero-Copy GPU Transfer

Apple Silicon's unified memory eliminates CPU-GPU data copying—orbits flow directly to shader buffers.

📐

Adaptive Iteration Limits

Local multiplier |λ| analysis adjusts maxIter per region, avoiding wasted computation in smooth areas.

0 FPS
ProMotion
0+
Lines of code
0ms
Frame budget
0
Precision tiers

Tech Stack

Native performance meets mathematical precision

SwiftMetalGPU ComputeMPFRPerturbation TheoryComplex Dynamics

Interested in numerical computing?

We build software that pushes boundaries. Let's talk about your next challenge.

Start a Conversation