Skip to content

fix(validation): restore LEAN case-study benchmark#26

Open
stefan-jansen wants to merge 2 commits into
mainfrom
fix/benchmark-zero-cost-reset
Open

fix(validation): restore LEAN case-study benchmark#26
stefan-jansen wants to merge 2 commits into
mainfrom
fix/benchmark-zero-cost-reset

Conversation

@stefan-jansen

@stefan-jansen stefan-jansen commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • restore the LEAN case-study parity harness
  • commit the required compressed/split LEAN reference fixtures so CI runs the benchmark instead of skipping it
  • hard-fail when reference artifacts are missing
  • clear direct cost fields in zero-cost benchmark configs and report LEAN decoded fills as trade counts

Validation

  • pre-commit run --all-files
  • uv run pytest tests/benchmark/test_case_study_lean.py -q
  • uv run pytest tests/ -q
  • clean worktree: uv run pytest tests/benchmark/test_case_study_lean.py -q

Copilot AI review requested due to automatic review settings June 21, 2026 17:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores and hardens the LEAN validation/benchmarking surface so cross-engine parity comparisons remain consistent, and adds a LEAN case-study regression test + harness code under ml4t.backtest._validation.

Changes:

  • Add helpers to fully disable commission/slippage fields in validation/benchmark_suite.py to prevent cost-model auto-activation from preset leftovers.
  • Adjust LEAN benchmark reporting to treat decoded fills as “trade count” for parity with other engines.
  • Add a LEAN case-study parity harness module and a regression test that compares fill multisets + terminal portfolio value.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
validation/benchmark_suite.py Centralizes “zero-cost mode” resets and adjusts LEAN trade-count reporting for cross-engine parity.
tests/benchmark/test_case_study_lean.py Adds a regression test intended to validate ml4t’s LEAN reconstruction against committed LEAN artifacts.
src/ml4t/backtest/_validation/case_study_lean.py Implements the case-study harness: workspace parsing, LEAN zip decoding, ml4t replay, and parity comparison utilities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread validation/benchmark_suite.py Outdated
Comment thread tests/benchmark/test_case_study_lean.py
Comment thread src/ml4t/backtest/_validation/case_study_lean.py Outdated
Restore the LEAN case-study parity harness with committed reference fixtures so CI executes the regression instead of skipping it. Clear direct cost fields in zero-cost benchmark configs and report LEAN decoded fills as trade counts for apples-to-apples parity comparisons.
@stefan-jansen stefan-jansen force-pushed the fix/benchmark-zero-cost-reset branch from d25a4ae to fdcc4cd Compare July 7, 2026 15:18
Clear stop slippage in zero-cost benchmark configs, count empty LEAN fill tables as zero trades, and make the case-study LEAN harness documentation and parameter parsing explicit.
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.

2 participants