Skip to content

feat: phyllotactic-manifold + p64 crates (additive, 44 tests)#64

Merged
AdaWorldAPI merged 6 commits into
masterfrom
feat/p64-phyllotactic-manifold
Mar 30, 2026
Merged

feat: phyllotactic-manifold + p64 crates (additive, 44 tests)#64
AdaWorldAPI merged 6 commits into
masterfrom
feat/p64-phyllotactic-manifold

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

feat: phyllotactic-manifold + p64 — 7+1 φ/γ spiral + 64×64 BNN palette

Two new standalone crates. Additive only — zero changes to existing files.

phyllotactic-manifold (876 LOC, 14 tests)

7+1 phyllotactic SIMD manifold with Euler-gamma singularity correction.

  • 4 encoding strategies: Flat8 / Spiral8 / Spiral8Gamma / SevenPlusOne
  • Rust 1.94: std::f64::consts::GOLDEN_RATIO + EULER_GAMMA
  • 7 lanes on φ-spiral (prime = zero aliasing) + 1 contradiction channel
  • Gap CV improvement: 49.5% (√n → √(n+γ))
  • Dead Zone: contradiction displacement = 0.000 exact
  • NARS truth extraction: <f, c> from resonance + contradiction

p64 (1817 LOC, 23 tests)

Palette64: 64×64 BNN attention matrix from 8 phyllotactic HEEL planes.

  • 512 bytes = 8 cache lines, #[repr(align(64))]
  • HeelPlanes → expand() via golden shift 39 (gcd(39,64)=1)
  • BNN attention: Q AND K → POPCNT → Gamma threshold
  • MoE fanout: 8 expert gates, soft/hard combination
  • Denoising: convergence in 2 steps to fixed point

sparse256 module:

  • 256×256 HHTL via CLAM triangle inequality pruning
  • BSR SpMV: 32× speedup vs dense (3.12% FLOP ratio)
  • HHTL cascade: 4 of 256 computed (64× pruning)

Palette3D (4KB L1-resident):

  • 8 layers × 64×64 = predicate-typed attention
  • 6 ThinkingStyles: ANALYTICAL / CREATIVE / FOCUSED / INTEGRATIVE / DIVERGENT / META
  • 4 CombineModes: Union / Intersection / Majority / Weighted
  • 4 ContraModes: Suppress / Ignore / Invert / Tension
  • 3 deduction rules: CAUSES×ENABLES / SUPPORTS² / REFINES-chain
  • Dynamic masking: palette GROWS during inference

Connection to existing stack

CausalEdge64 u64 layout → palette block addressing (S→row/4, O→col/4)
Pearl causal mask 3-bit  → 8 predicate layer selection
NARS InferenceType       → deduction rule mapping
HdrSemiring              → CombineMode + ContraMode
ThinkingStyle 12×3=36    → LazyLock<[ThinkingStyle; 12]>
DeepNSM codebook 256     → Palette64 interaction matrix
SimdCaps LazyLock        → avx512vpopcntdq dispatch
F64x8 / U64x8           → manifold expansion + batch attend

Bridge code (p64_bridge.rs, 695 LOC) ready for integration into ndarray --features p64 or as lance-graph consumer crate.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 750ca413c5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/p64/src/lib.rs
Comment on lines +385 to +386
let result = self.attend(noisy, noise_level);
self.rows[result.best_idx as usize]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Make denoise_step honor the noise_level parameter

denoise_step passes noise_level into attend, but attend uses gamma only to build the fires bitmask and not to choose best_idx, so the returned row is identical for all noise_level values. This means the denoising schedule in denoise has no effect on the actual state updates, which breaks the intended coarse-to-fine behavior for every nontrivial denoising call.

Useful? React with 👍 / 👎.

Comment thread crates/p64/src/lib.rs
Comment on lines +1041 to +1044
block_active = true;
interactions += 1;
} else {
pruned += 1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Track sparse256 active_blocks at block granularity

from_clam_leaves increments interactions (and pruned) inside the inner 4×4 leaf-pair loop, but later publishes these as active_blocks/pruned_blocks. That counts leaf pairs rather than blocks, so reported block statistics can exceed total_blocks and misstate sparsity, which can mislead downstream tuning or pruning decisions that rely on these metrics.

Useful? React with 👍 / 👎.

@AdaWorldAPI AdaWorldAPI merged commit 03f1aa0 into master Mar 30, 2026
6 of 15 checks passed
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