Skip to content

Fix interactive branch-selection sending invalid --branches to HyPHY for FEL/SLAC/BUSTED/aBSREL (#141) - #142

Merged
stevenweaver merged 3 commits into
mainfrom
fix/141-busted-interactive-branches
Jul 14, 2026
Merged

Fix interactive branch-selection sending invalid --branches to HyPHY for FEL/SLAC/BUSTED/aBSREL (#141)#142
stevenweaver merged 3 commits into
mainfrom
fix/141-busted-interactive-branches

Conversation

@stevenweaver

@stevenweaver stevenweaver commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #141 and audits the same bug class across every method. When a user picked the Interactive branch-selection mode, the backend runner passed a value HyPHY rejects (or silently dropped the selection), depending on the method:

Error: 'Interactive' is not a valid choice passed to 'Choose the set of branches to test for selection'.
Valid choices are: All, Internal, Leaves, Unlabeled branches

"Interactive" is a UI concept (let the user label branches on the tree). The interactively-selected branches are tagged {FG} in the submitted tree, so the correct --branches value is FG.

Root cause

In BackendAnalysisRunner.prepareAnalysisParameters, the single-test-set methods handled config.branchesToTest inconsistently. Only PRIME converted InteractiveFG. The rest were broken to varying degrees:

Method Before Symptom
BUSTED config.branchesToTest || 'All' --branches Interactivejob fails (the reported bug)
aBSREL config.branchesToTest || 'All' --branches Interactive → job fails
FEL hardcoded 'All' selection silently ignored
SLAC config.branches || 'All' wrong key (UI emits branchesToTest) → silently ignored
PRIME already Interactive ? 'FG' : ... OK

The live UI is MethodSelector.svelte, which emits branchesToTest and exposes an Interactive option for FEL/SLAC/aBSREL/BUSTED/PRIME. (FelOptions.svelte/SlacOptions.svelte are dead code — only imported by the orphaned MethodOptionsTab.svelte — so their differing key was not the live path.)

Fix

All five single-set methods now use the same mapping, keyed on branchesToTest:

branches: config.branchesToTest === 'Interactive' ? 'FG' : (config.branchesToTest || 'All')

Built-in sets (All, Internal, Leaves, Unlabeled branches) pass through unchanged; default remains All. Tag-based methods (RELAX → test/reference, Contrast-FEL → branch-set) are unaffected and were verified correct. The WASM path (WasmAnalysisRunner) already keyed on branchesToTest and converted correctly, so only the backend runner was affected.

Tests

src/test/branch-selection-mapping.test.js (16 cases) covers, for FEL / SLAC / BUSTED / aBSREL / PRIME:

  • InteractiveFG
  • built-in branch sets pass through unchanged
  • default to All when unset
  • the literal Interactive never reaches --branches

Full unit suite passes (245 tests).

…ches (#141)

The "Interactive" branch-selection mode is a UI concept (label branches on
the tree). It must be translated to the HyPHY branch label "FG" before it
reaches the --branches argument. The BUSTED and aBSREL backend parameter
mappings passed config.branchesToTest verbatim, so an interactive selection
produced `--branches Interactive`, which HyPHY rejects at startup:

    Error: 'Interactive' is not a valid choice passed to
    'Choose the set of branches to test for selection'.

PRIME already had this conversion; apply the same mapping to BUSTED and
aBSREL. Built-in sets (All/Internal/Leaves/Unlabeled branches) still pass
through unchanged.

Add branch-selection-mapping.test.js covering the Interactive→FG conversion,
built-in pass-through, and the default for all three single-set methods.
Auditing all methods for the same class of bug found two more reachable
through the live UI (MethodSelector), which exposes an "Interactive"
branch-selection option for FEL and SLAC:

- FEL hardcoded `branches: 'All'`, silently discarding any user selection.
- SLAC read `config.branches`, but the UI emits `config.branchesToTest`,
  so Interactive (and Internal/Leaves/Custom) fell back to 'All'.

Both now use the same `Interactive -> FG` mapping as BUSTED/aBSREL/PRIME,
keyed on `branchesToTest`. The WASM path already keyed on `branchesToTest`
and was unaffected. FelOptions.svelte/SlacOptions.svelte are dead code
(only imported by the orphaned MethodOptionsTab.svelte), so their differing
key was not the live path.

Extend branch-selection-mapping.test.js to cover FEL and SLAC.
@stevenweaver stevenweaver changed the title Fix BUSTED interactive branch-selection passing invalid --branches to HyPHY (#141) Fix interactive branch-selection sending invalid --branches to HyPHY for FEL/SLAC/BUSTED/aBSREL (#141) Jul 14, 2026
@stevenweaver

Copy link
Copy Markdown
Member Author

Expanded scope after auditing all methods: the same bug class also affected FEL (hardcoded All, selection silently ignored) and SLAC (read the wrong config key branches instead of branchesToTest). Both are reachable through the live MethodSelector UI. All five single-set methods (FEL/SLAC/BUSTED/aBSREL/PRIME) now share one correct mapping. RELAX and Contrast-FEL use tag-based sets and were verified unaffected.

FelOptions.svelte and SlacOptions.svelte were the legacy per-method options
UI, rendered only by MethodOptionsTab.svelte, which is itself imported by
nothing — the live app uses MethodSelector.svelte (via AnalyzeTab.svelte).

Their stale, differing `branches` config key was the source of confusion
while fixing the interactive branch-selection bug in this PR. Removing them
leaves a single source of truth for branch-selection UI.

Deletes:
- src/lib/MethodOptionsTab.svelte (orphaned)
- src/lib/FelOptions.svelte
- src/lib/SlacOptions.svelte
- src/stories/FelOptions.stories.js
- stale MethodOptionsTab entry in src/lib/README.md

BranchSelector.svelte is retained (still used by MethodSelector.svelte).
Build and full unit suite (245 tests) pass.
@stevenweaver
stevenweaver force-pushed the fix/141-busted-interactive-branches branch from c1bdc24 to 7cacef8 Compare July 14, 2026 16:36
@stevenweaver
stevenweaver merged commit 603258d into main Jul 14, 2026
2 checks passed
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.

BUSTED: interactive branch-selection mode passes invalid '--branches Interactive' to HyPHY, job fails

1 participant