pub struct GeometricSignature { /* private fields */ }Expand description
A geometric signature for a node in hyperbolic space.
This signature uniquely identifies a point or region in the hyperbolic space, enabling O(1) lookups.
Implementations§
Source§impl GeometricSignature
impl GeometricSignature
Sourcepub fn new(hash: String, level: u32, position_signature: Vec<i32>) -> Self
pub fn new(hash: String, level: u32, position_signature: Vec<i32>) -> Self
Create a new geometric signature.
Sourcepub fn position_signature(&self) -> &[i32]
pub fn position_signature(&self) -> &[i32]
Get the position signature.
Sourcepub fn stub(unique_id: &str) -> Self
pub fn stub(unique_id: &str) -> Self
Create a stub signature for data-only nodes (no geometric meaning).
Sourcepub fn is_stub(&self) -> bool
pub fn is_stub(&self) -> bool
Whether this is a stub signature (a data-only node with no geometric
embedding — upgradeable via embed_existing).
Sourcepub fn unique_id(&self) -> String
pub fn unique_id(&self) -> String
Get a unique node identifier, derived from level and position alone.
Deliberately independent of the spatial index. This digest used to
include hash() — the geometric bucket — which made every node’s
identity a function of which bucket the index happened to choose, so
the index could not be changed without renaming every node. The bucket
hash is itself a function of the same position (it is the signature of
the containing bucket’s centre), so it contributed no entropy: two
nodes sharing a level and a position_signature already shared a
bucket. Dropping it loses no discrimination and buys a swappable index.
Uniqueness rests on position_signature, quantised at 2^-20 — the
resolution the hardening audit established (quantize_1000 collided
for depth-2 cousins at a few hundred nodes; 2^-20 pushes the birthday
bound past millions).
For stub signatures (data-only nodes), returns the hash directly.
Source§impl GeometricSignature
impl GeometricSignature
Sourcepub fn embedded(point: &HyperbolicPoint, dimension: usize, level: u32) -> Self
pub fn embedded(point: &HyperbolicPoint, dimension: usize, level: u32) -> Self
Create the signature of an embedded node at point, level deep.
The position signature is the point’s first dimension coordinates
quantised at 2^-20; hash is set to the resulting unique_id, so for
an embedded signature the two agree. No index is consulted: this is a
pure function of position and depth.
Trait Implementations§
Source§impl Clone for GeometricSignature
impl Clone for GeometricSignature
Source§fn clone(&self) -> GeometricSignature
fn clone(&self) -> GeometricSignature
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more