Skip to content

Conversation

Copy link

Copilot AI commented Feb 3, 2026

Multimodal search was being killed by the system due to unbounded memory growth during frontier expansion.

Root Cause

The MaxTripLegs constraint in constraint.rs incorrectly validated same-mode edge continuations:

let n_legs = match active_mode {
    Some(active_mode) if active_mode != edge_mode => n_existing_legs + 1,
    _ => 0,  // Bug: same-mode continuation always returns 0 legs
};
let is_valid = n_legs <= *max_legs;

When active_mode == edge_mode (continuing with the same travel mode), the code returned n_legs = 0, making the constraint check always pass regardless of actual trip leg count. This allowed infinite expansion within a single mode once any mode transition exceeded the limit.

Changes

  • constraint.rs line 92: Changed _ => 0 to _ => n_existing_legs to properly validate same-mode continuations
  • model.rs: Added test_max_trip_legs_same_mode_continuation_at_limit to verify same-mode edges are rejected when over the limit

The constraint now correctly bounds search expansion for both mode transitions and same-mode continuations.

Original prompt

This section details on the original issue you should resolve

<issue_title>bugs during test of template TOML file</issue_title>
<issue_description>while attempting a test run from a bambam-omf import using a new template configuration TOML file as part of #96, we can get as far as running search. however, the app is killed by the system during search, without returning a single successful search result:

queries assigned per executor: [230, 230, 230, 230, 230, 230, 230, 229]
zsh: killed     RUST_LOG=info ../rust/target/release/bambam -c denver/bambam-config-omf.toml 

this is likely a search running without bounds. some possible issues:

  • thrashing in the frontier space due to repeated labels
  • solution size is not sufficient for a termination condition with label setting
  • we should be able to run bambam with query-time assignment of available_modes, but, it seems it is only set at config time (see rust/bambam/src/model/frontier/multimodal/service.rs for the build() method implementation)</issue_description>

<agent_instructions>task: identify what could be causing an infinite loop or overflow of resources</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 3, 2026 23:21
Co-authored-by: robfitzgerald <7003022+robfitzgerald@users.noreply.github.com>
Co-authored-by: robfitzgerald <7003022+robfitzgerald@users.noreply.github.com>
Co-authored-by: robfitzgerald <7003022+robfitzgerald@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bugs during test of template TOML file Fix MaxTripLegs constraint allowing infinite same-mode expansion Feb 3, 2026
Copilot AI requested a review from robfitzgerald February 3, 2026 23:28
@robfitzgerald robfitzgerald changed the base branch from main to rjf/omf-config-and-metadata February 3, 2026 23:47
@robfitzgerald robfitzgerald marked this pull request as ready for review February 3, 2026 23:48
@robfitzgerald robfitzgerald merged commit 0a326fb into rjf/omf-config-and-metadata Feb 3, 2026
1 check failed
@robfitzgerald robfitzgerald deleted the copilot/fix-template-toml-search-bug branch February 3, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bugs during test of template TOML file

2 participants