Skip to content

C-b · Lean Tholder — leaner weighted representation + satisfied_by(indices) #130

Description

@joeldsouzax

Replace Tholder::Weighted(Vec<Vec<(u64, u64)>>) with a leaner / borrow-capable representation to cut allocation, and promote a proper satisfied_by(indices: &[u32]) -> bool method onto the type.

Why

The current weighted representation is a nested Vec<Vec<_>> — two heap allocations per threshold. K1 (#87) implements weighted satisfaction in keri-rs by matching the public enum (no cesr change) and lives with the representation as-is. This card owns the representation fix and moves threshold satisfaction behind the primitive that owns it (encapsulation).

Scope

  • Leaner representation (e.g. flattened clauses + boundaries, or Cow/inline storage) — no arbitrary cap.
  • Tholder::satisfy(count) today returns false for weighted (a stub); replace with satisfied_by(indices) handling both Simple and Weighted with exact rational arithmetic (checked, no floats).
  • Migrate K1's keri-rs satisfaction logic to call the new method.

Notes

  • Break on Tholder called out in CHANGELOG.

Spawned from #87 (K1) design, 2026-07-05.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions