Skip to main content

GroupingConfig

Struct GroupingConfig 

Source
pub struct GroupingConfig {
    pub medoid_min_similarity: f64,
    pub min_pairwise_similarity: f64,
    pub sampling_threshold: usize,
    pub sample_size: usize,
    pub max_component: usize,
}
Expand description

Tuning for grouping. Similarities are in [0, 1]; the defaults are provisional and calibrated against the chain corpus.

Fields§

§medoid_min_similarity: f64

Smallest similarity a member may have to the medoid and stay in the group; members below it are ejected and regrouped.

§min_pairwise_similarity: f64

Complete-linkage floor: the smallest similarity any pair inside a reported group may have. Below it the group is split.

§sampling_threshold: usize

Component size above which medoid selection samples candidates rather than scoring every member, to avoid quadratic blow-up on huge components. The sample is deterministic and key-diverse, so repeated content cannot occupy every medoid candidate.

§sample_size: usize

Number of candidate medoids scored when a component exceeds Self::sampling_threshold.

§max_component: usize

Largest component refined as one piece. A component above this is cut into key-ordered pieces, each refined on its own. Content-identical units are never separated: one equivalence class can therefore exceed this limit by itself.

Refinement materializes the component’s pairwise similarity matrix and orders it once, so it costs O(k² log k) time and O(k²) memory. A codebase of thousands of structurally interchangeable units — generated code, or a repository built to make the scan expensive — still produces exactly that component, which is why the ceiling exists at all (AGENTS.md §2-10, §7).

Cutting costs recall, never soundness: each piece is refined by the same medoid and complete-linkage rules, so every reported group is still cohesive. What is lost is the chance that two members landing in different pieces would have grouped. The cut is by stable key, so it is deterministic, and the count of components it fired on is reported. Keeping equal-key units together prevents independently cut pieces from minting the same content-derived group and finding identifiers.

Which members the cut put apart is reported too, through GroupingSet::severed_by_the_ceiling. A caller that carries out the verified relations no group expresses needs it: a relation across the cut is not one refinement weighed and declined, and carrying it out would restate the set once per crossing — at the size that makes this ceiling fire, that is the whole report.

Trait Implementations§

Source§

impl Clone for GroupingConfig

Source§

fn clone(&self) -> GroupingConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GroupingConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GroupingConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for GroupingConfig

Source§

fn eq(&self, other: &GroupingConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GroupingConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.