Skip to content

Launch Lean through the dotnet host in the console optimizer - #9835

Merged
jhonabreul merged 1 commit into
QuantConnect:masterfrom
jhonabreul:bug-9821-optimizer-arm64-launcher
Sep 28, 2026
Merged

jhonabreul merged 1 commit into
QuantConnect:masterfrom
jhonabreul:bug-9821-optimizer-arm64-launcher

Conversation

@jhonabreul

Copy link
Copy Markdown
Collaborator

Description

lean optimize fails every backtest in the linux/arm64 quantconnect/lean image, while lean backtest works:

LeanOptimizer.NewResult(...): Got null/empty backtest result for backtest id '<guid>'

Cause: ConsoleLeanOptimizer executes the Launcher apphost, a native x86-64 executable that cannot run in the arm64 image.

The fix:

  • lean-binaries-location now defaults to QuantConnect.Lean.Launcher.dll instead of the apphost.
  • ConsoleLeanOptimizer.CreateLeanStartInfo runs .dll locations through the dotnet host, which works on any architecture.
  • Explicitly configured executables are still run as they are.

Related Issue

Closes #9821

Motivation and Context

Optimizations are unusable on arm64 hosts running the Lean Docker image.

Requires Documentation Change

No.

How Has This Been Tested?

  • ConsoleLeanOptimizerTests: .dll locations (any case) run as dotnet "<dll>" <args> from the launcher directory.
  • ConsoleLeanOptimizerTests: configured executables (with or without .exe) run directly, even with the .dll next to them.
  • Full QuantConnect.Tests.Optimizer namespace: 187 passed, 0 failed.
  • Ran the optimizer in the linux/arm64 image: fails to start Lean on master, completes all backtests with the fix.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

The native launcher apphost only runs on the architecture it was built for,
so the optimizer could not start backtests in the linux/arm64 Docker image.
Default the Lean location to the launcher assembly and run .dll locations
with dotnet; explicitly configured executables are still run as they are.

@Martin-Molinero Martin-Molinero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@jhonabreul
jhonabreul merged commit 452c79d into QuantConnect:master Sep 28, 2026
8 checks passed
@jhonabreul
jhonabreul deleted the bug-9821-optimizer-arm64-launcher branch September 28, 2026 14:55
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.

Optimizer cannot run backtests in the linux/arm64 Docker image: QuantConnect.Lean.Launcher apphost is x86-64

2 participants