Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion COMPARISON.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
| Crate | Upstream | **Fork** | Detail |
|-------|----------|----------|--------|
| `crates/p64` | Not present | **P64** | Palette64 data structure — convergence highway between ndarray and lance-graph |
| `crates/phyllotactic-manifold` | Not present | **Phyllotactic Manifold** | Golden-angle spiral geometry for uniform point distribution |
| `crates/fractal` | Not present | **Phyllotactic Manifold** | Golden-angle spiral geometry for uniform point distribution |

## Burn Backend (20 ops files)

Expand Down
19 changes: 10 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ libc = { version = "0.2.82", optional = true }
matrixmultiply = { version = "0.3.2", default-features = false, features=["cgemm"] }
blake3 = "1"
p64 = { path = "crates/p64" }
phyllotactic-manifold = { path = "crates/phyllotactic-manifold" }
fractal = { path = "crates/fractal", default-features = false }

serde = { version = "1.0", optional = true, default-features = false, features = ["alloc"] }
rawpointer = { version = "0.2" }
Expand Down Expand Up @@ -81,7 +81,7 @@ blas = ["dep:cblas-sys", "dep:libc"]

serde = ["dep:serde"]

std = ["num-traits/std", "matrixmultiply/std"]
std = ["num-traits/std", "matrixmultiply/std", "fractal/std"]
rayon = ["dep:rayon", "std"]

matrixmultiply-threading = ["matrixmultiply/threading"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
[package]
name = "phyllotactic-manifold"
name = "fractal"
version = "0.1.0"
edition = "2021"
rust-version = "1.94"
description = "7+1 phyllotactic SIMD manifold with Euler-gamma singularity correction"
license = "MIT OR Apache-2.0"

[features]
default = ["std"]
std = []

[dependencies]
libm = { version = "0.2", default-features = false }

[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
use phyllotactic_manifold::*;
use fractal::*;

fn make_seeds(n: usize) -> Vec<[i8; 34]> {
let mut seeds = Vec::with_capacity(n);
for i in 0..n {
let mut seed = [0i8; 34];
seed[0] = (i % 128) as i8; // HEEL
seed[33] = ((i * 7) % 128) as i8; // GAMMA
for j in 1..33 {
seed[j] = ((i * 13 + j * 37) % 256) as i8;
for (j, slot) in seed.iter_mut().enumerate().take(33).skip(1) {
*slot = ((i * 13 + j * 37) % 256) as i8;
}
seeds.push(seed);
}
Expand Down Expand Up @@ -59,10 +59,10 @@ fn bench_resonance(c: &mut Criterion) {
let threshold = 1000.0;

// Pre-encode
let flat8_enc: Vec<_> = seeds.iter().map(|s| flat8::encode(s)).collect();
let spiral8_enc: Vec<_> = seeds.iter().map(|s| spiral8::encode(s)).collect();
let spiral8g_enc: Vec<_> = seeds.iter().map(|s| spiral8_gamma::encode(s)).collect();
let s7p1_enc: Vec<_> = seeds.iter().map(|s| seven_plus_one::encode(s)).collect();
let flat8_enc: Vec<_> = seeds.iter().map(flat8::encode).collect();
let spiral8_enc: Vec<_> = seeds.iter().map(spiral8::encode).collect();
let spiral8g_enc: Vec<_> = seeds.iter().map(spiral8_gamma::encode).collect();
let s7p1_enc: Vec<_> = seeds.iter().map(seven_plus_one::encode).collect();

let mut group = c.benchmark_group("resonance");

Expand All @@ -85,11 +85,7 @@ fn bench_resonance(c: &mut Criterion) {
group.bench_function("spiral8_gamma", |b| {
b.iter(|| {
for (x, y) in &spiral8g_enc {
black_box(spiral8_gamma::resonance(
black_box(x),
black_box(y),
threshold,
));
black_box(spiral8_gamma::resonance(black_box(x), black_box(y), threshold));
}
})
});
Expand All @@ -107,7 +103,7 @@ fn bench_resonance(c: &mut Criterion) {

fn bench_clam48(c: &mut Criterion) {
let seeds = make_seeds(1024);
let manifolds: Vec<_> = seeds.iter().map(|s| seven_plus_one::encode(s)).collect();
let manifolds: Vec<_> = seeds.iter().map(seven_plus_one::encode).collect();

c.bench_function("clam48_extraction", |b| {
b.iter(|| {
Expand All @@ -123,8 +119,8 @@ fn bench_dead_zone(c: &mut Criterion) {
let mut s = [0i8; 34];
s[0] = 42;
s[33] = 7;
for i in 1..33 {
s[i] = (i as i8).wrapping_mul(13).wrapping_add(37);
for (i, slot) in s.iter_mut().enumerate().take(33).skip(1) {
*slot = (i as i8).wrapping_mul(13).wrapping_add(37);
}
s
};
Expand All @@ -151,12 +147,5 @@ fn bench_encode_scaling(c: &mut Criterion) {
group.finish();
}

criterion_group!(
benches,
bench_encode,
bench_resonance,
bench_clam48,
bench_dead_zone,
bench_encode_scaling,
);
criterion_group!(benches, bench_encode, bench_resonance, bench_clam48, bench_dead_zone, bench_encode_scaling,);
criterion_main!(benches);
Loading
Loading