Skip to content

ltm-finding: truncate-before-filter can drop partition-dominant loops #310

@bpowers

Description

@bpowers

Summary

rank_and_filter() truncates discovered loops to MAX_LOOPS (200) before partition-aware contribution filtering.

Why this is a problem

LTM interpretation is partition-scoped: loops should be compared within cycle partitions. Global pre-truncation can drop loops that are dominant in small partitions but globally below rank 200, violating partition-local dominance semantics.

Literature / algorithm alignment

Reference and design docs emphasize partition-scoped comparison for relative contribution. Global truncation before partition-aware retention introduces cross-partition interference.

Current implementation behavior

Order in rank_and_filter():

  1. global sort by avg abs score
  2. truncate to 200
  3. partition-aware per-timestep contribution filter

Location:

  • src/simlin-engine/src/ltm_finding.rs (rank_and_filter)

Impact

  • False negatives for partition-dominant loops in large models.
  • Reported loop set can underrepresent smaller disconnected feedback subsystems.

Success criteria

  1. Reorder filtering so partition-aware retention is applied before any global cap, or apply per-partition quotas prior to global cap.
  2. Define and document deterministic tie-breaking when the final capped set still exceeds MAX_LOOPS.
  3. Add tests with >200 loops spanning multiple partitions where a low-global-score but high-partition-share loop is retained.
  4. Keep deterministic IDs and output ordering stable.

Notes

This issue concerns post-discovery ranking/filtering only, not the known flow-to-stock timing choice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ltmLoops that Matter (LTM) analysis subsystem

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions