Skip to content

feat: multi-fidelity support via Phase-level world/scorer overrides#101

Merged
jc-macdonald merged 1 commit intomainfrom
feat/multi-fidelity
Apr 17, 2026
Merged

feat: multi-fidelity support via Phase-level world/scorer overrides#101
jc-macdonald merged 1 commit intomainfrom
feat/multi-fidelity

Conversation

@jc-macdonald
Copy link
Copy Markdown
Contributor

Summary

Adds multi-fidelity support: each Phase can optionally override the Study-level world and/or scorer, enabling cheap-surrogate-then-expensive-model workflows (#78).

API change

@dataclass
class Phase:
    name: str
    grid: ...
    filter_fn: ... = None
    n_trials: int = 100
    world: Simulator | None = None   # NEW — None inherits from Study
    scorer: Scorer | None = None     # NEW — None inherits from Study

Backward-compatible — defaults to None, so all existing code works unchanged.

Design rationale

Fidelity is a computational strategy, not a design factor — you don't optimize over it, you use it to allocate compute. A phase-level override keeps fidelity concerns at the architectural level (which phase uses which model) rather than mixing them into the factor space.

Changes

File Change
src/trade_study/study.py Phase gains world and scorer fields; Study.run() resolves per-phase overrides
tests/test_study.py 5 new tests: world override, scorer override, both combined, screen-then-validate, default None
examples/bayesian_study.py Simulator accepts n_samples parameter; new multi-fidelity section (50 draws screen → 2000 draws validate)
docs/guide/bayesian.md Multi-fidelity section with cross-domain examples (epi, engineering, forecasting)

CI

  • 263 tests pass, 99.58% coverage
  • Ruff, mypy all clean
  • Example script runs end-to-end

Closes #78

)

- Phase dataclass gains optional world and scorer fields (default None
  inherits from Study), enabling cheap-surrogate-then-expensive-model
  workflows.
- Study.run() resolves per-phase overrides at the top of each iteration.
- Bayesian example updated: simulator accepts n_samples parameter,
  new _run_multi_fidelity() section screens 60 designs with 50 draws
  then validates top 10 with 2000 draws.
- Guide updated with multi-fidelity section and cross-domain examples.
- 5 new tests covering world override, scorer override, both combined,
  screen-then-validate, and default None behavior.
@jc-macdonald jc-macdonald merged commit f88405f into main Apr 17, 2026
4 checks passed
@jc-macdonald jc-macdonald deleted the feat/multi-fidelity branch April 17, 2026 15:13
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.

Multi-fidelity support: cheap surrogate then expensive model

1 participant