Skip to content

ltm: fixed max depth 20 truncates module pathway enumeration #312

Closed

Description

@bpowers

Summary

Module pathway enumeration uses a hardcoded maximum depth of 20 nodes when finding input-port → output paths.

Why this is a problem

Composite link scoring should consider all relevant simple pathways through a dynamic module. A fixed depth cap can truncate valid longer pathways, causing incomplete composite selection and incorrect boundary link scores.

Literature / algorithm alignment

Section 6 (composite link score) relies on evaluating pathway scores across the module’s internal causal pathways and selecting max-abs each timestep. Depth-based truncation is an implementation limit that can violate this for larger internal structures.

Current implementation behavior

enumerate_module_pathways() calls find_all_simple_paths(input_port, output_name, 20).

Location:

  • src/simlin-engine/src/ltm.rs (enumerate_module_pathways)

Impact

  • Under-counted pathways in deeper modules.
  • Potentially wrong composite scores and loop attribution for module-crossing loops.

Success criteria

  1. Remove hardcoded depth cap or derive it safely from graph size/topology (while preventing infinite recursion on cycles).
  2. Ensure all simple input→output paths are considered up to a clearly documented, principled limit.
  3. Add tests with an internal module path length >20 verifying those pathways are included.
  4. Document any remaining practical limits and their behavioral consequences.

Notes

This issue is unrelated to the known flow-to-stock timing offset.

Activity

  1. added
    ltm
    on May 1, 2026
  2. added a commit that references this issue on May 8, 2026
    970429b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ltm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions