Skip to content

perf: pack reference orbit to 16 bytes/point, fast-extend periodic orbits, and scale deep-zoom slice ceiling - #98

Merged
rowan-m merged 1 commit into
mainfrom
perf/orbit-packing-and-periodicity
Sep 28, 2026
Merged

rowan-m merged 1 commit into
mainfrom
perf/orbit-packing-and-periodicity

Conversation

@rowan-m

@rowan-m rowan-m commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Halve reference_orbit buffer size (32 bytes/point -> 16 bytes/point): Store each reference orbit point as a single vec4<f32> ([re_hi, re_lo, im_hi, im_lo]) using split_f64_to_2_f32 instead of 2 × vec4<f32>. Since reference points are converted from f64 (53-bit significand), two f32s already capture the full Double-Single significand while halving WASM memory allocation, worker transfer size, writeBuffer upload bandwidth, GPU storage cache footprint, and raw_xm register pressure in fs_main_qs.
  • Fast periodic orbit extension & deep-zoom periodicity:
    • In wasm/src/lib.rs (Orbit::advance), record the detected cycle period from CycleDetector and, once a full period of p consecutive points is stationary in qs, copy the p-point cycle directly up to limit instead of re-iterating in arbitrary-precision FBig.
    • In src/renderer/shader.wgsl, extend fs_main_f32 Brent periodicity detection across its full zoom range by comparing perturbations delta whenever next_m == period_m (where X_m cancels out), and use fma in ds_mul.
  • Scale adaptive slice ceiling at ultra-high iteration counts: In Renderer._sliceRows(), floor maxOps at MIN_SLICE_ROWS * 2 * rowOps so fast exterior slices at ultra-high iteration counts (where 16 * budget < 32 rows) can still scale up to 2 × MIN_SLICE_ROWS (64 rows) while keeping slow interior slices floored at 32 rows.

@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit fa42de4):

https://fractious-deep--pr98-perf-orbit-packing-a-f1zzexlj.web.app

(expires Mon, 05 Oct 2026 15:21:47 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 348393a9746312ebab7a45ce5eba16e6d119af34

@rowan-m
rowan-m merged commit f7684e0 into main Sep 28, 2026
2 checks passed
@rowan-m
rowan-m deleted the perf/orbit-packing-and-periodicity branch September 28, 2026 15:29
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