Skip to content

fix(runtime): dispatch custom autoscaler triggers - #1021

Merged
Coldwings merged 1 commit into
mainfrom
fix/autoscaler-custom-triggers
Aug 12, 2026
Merged

fix(runtime): dispatch custom autoscaler triggers#1021
Coldwings merged 1 commit into
mainfrom
fix/autoscaler-custom-triggers

Conversation

@Coldwings

@Coldwings Coldwings commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Description

Fix custom autoscaler trigger packs so the documented autoscaler<Scheduler, Triggers...> form compiles and dispatches every configured trigger. The trigger fold now constructs each stateless trigger and passes it to the existing overload set instead of incorrectly treating the trigger type as an action template argument.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (optimization that improves speed/memory usage)
  • Documentation (changes to documentation, comments, or examples)
  • Refactoring (code changes that neither fix bugs nor adds features)
  • Tests (adding or modifying tests)
  • Build/CI (changes to build system, CI configuration, or dependencies)

Related Issues

Closes #1020
Related to #1019

Changes Made

Core Changes

  • Construct each configured trigger in the autoscaler dispatch fold.
  • Pass the trigger object to the matching on_overload, on_idle, or on_block overload.
  • Add a deterministic scheduler/worker test double that activates all three documented trigger kinds and asserts each recording action runs.
  • Record the fix in the unreleased changelog.

API Changes (if applicable)

None. This restores the existing documented API.

Migration Guide (if breaking change)

Not applicable.

Testing

Unit Tests

  • Added new tests for the changes
  • Updated existing tests if needed
  • All focused tests pass locally

Integration Tests

  • Tested with existing examples
  • Tested in real-world scenarios (if applicable)

Sanitizer Testing

  • Tested with ASAN (AddressSanitizer)
  • Tested with TSAN (ThreadSanitizer)
  • No new warnings or errors

Test Results

Release: [autoscaler] — 6 test cases, 21 assertions passed
ASAN:   [autoscaler] — 6 test cases, 21 assertions passed; leak detection enabled
TSAN:   [autoscaler] — 6 test cases, 21 assertions passed; no race reports
GCC 12 Release build: developer warnings and warnings-as-errors enabled

Checklist

Code Quality

  • My code follows the project code style
  • I have added or updated comments for complex logic
  • I have removed any debug code, TODOs, or commented-out code
  • My changes generate no new warnings

Documentation

  • I have updated documentation (wiki, README, code comments)
  • I have added examples for new features (if applicable)
  • I have updated API documentation (if applicable)

The existing wiki already documents the intended custom-trigger form; the changelog now records that it works.

Testing

  • I have added tests that prove my fix is effective
  • New and existing focused unit tests pass locally
  • I have tested with ASAN and TSAN

Compatibility

  • My changes are backward compatible
  • I have considered the impact on existing users
  • I have updated CHANGELOG.md

Performance (if applicable)

  • I have considered the performance impact
  • I have added benchmarks for performance-critical changes

The only added runtime work is constructing empty stateless trigger policy objects, which are optimized away.

Screenshots / Diagrams

Not applicable.

Additional Notes

The default no-trigger autoscaler path is unchanged. This fix was discovered while adding executable on_block coverage for #1019 and is intentionally separated so the performance change can build on a working trigger contract.

Reviewer Guidance

Areas requiring special attention:

  • Verify that Triggers{} selects the existing overload set for every trigger kind.
  • Confirm that this remains source- and behavior-compatible for the default autoscaler path.

Questions for reviewers:

  • Are there any supported stateful trigger types that would make default construction inappropriate? The public trigger types currently carry policy only in their template arguments and contain no state.

Copilot AI balanced review requested due to automatic review settings August 12, 2026 13:57

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

Fixes custom autoscaler trigger-pack compilation and dispatch.

Changes:

  • Constructs trigger objects during fold dispatch.
  • Adds custom-trigger lifecycle coverage.
  • Documents the fix in the changelog.

Reviewed changes

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

File Description
include/elio/runtime/autoscaler.hpp Corrects custom-trigger dispatch.
tests/unit/test_autoscaler.cpp Adds regression coverage.
CHANGELOG.md Records the fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/unit/test_autoscaler.cpp Outdated
@Coldwings
Coldwings force-pushed the fix/autoscaler-custom-triggers branch from a41d4fa to 928e13b Compare August 12, 2026 14:02
@Coldwings

Copy link
Copy Markdown
Owner Author

@copilot please re-review only; do not make direct code modifications.

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@copilot please re-review only; do not make direct code modifications.

Re-reviewed the current head only. I don’t see any additional actionable issues in the autoscaler fix or the revised trigger-pack regression coverage.

@Coldwings
Coldwings force-pushed the fix/autoscaler-custom-triggers branch from 13f985f to 928e13b Compare August 12, 2026 14:12
@Coldwings
Coldwings merged commit 62383e6 into main Aug 12, 2026
18 checks passed
@Coldwings
Coldwings deleted the fix/autoscaler-custom-triggers branch August 12, 2026 14:44
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.

[Bug] Custom autoscaler trigger packs fail to compile

3 participants