Skip to content

scheduler: use per-group average duration for unknown tests#114

Merged
DanverImbue merged 4 commits intomainfrom
worktree-scheduler-defaults
Mar 18, 2026
Merged

scheduler: use per-group average duration for unknown tests#114
DanverImbue merged 4 commits intomainfrom
worktree-scheduler-defaults

Conversation

@jsk11235
Copy link
Collaborator

Summary

  • Instead of a flat 1-second default for tests without historical timing data, the LPT scheduler now uses the average duration of other tests in the same group
  • Adds group() accessor to TestInstance
  • Computes per-group averages in the orchestrator from the historical durations map and passes them to schedule_lpt
  • Falls back to 1s only when a group has zero historical data

Test plan

  • cargo fmt --check passes
  • cargo clippy --all-targets --all-features passes
  • cargo nextest run passes (128/128 tests)

🤖 Generated with Claude Code

jacobkirmayer-imbue and others added 3 commits March 18, 2026 11:20
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of a flat 1-second default, compute the average duration of
tests in each group from historical data and use that as the fallback
for tests without individual timing history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jsk11235 jsk11235 force-pushed the worktree-scheduler-defaults branch from f5dad40 to faf7ba6 Compare March 18, 2026 18:22
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Vet found 1 issue.

@@ -211,7 +218,7 @@ mod tests {
durations.insert("medium_test".to_string(), Duration::from_secs(5));
durations.insert("fast_test".to_string(), Duration::from_secs(1));

Choose a reason for hiding this comment

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

[test_coverage] (severity 3/5) (confidence 0.92)

The diff adds per-group average duration logic but no test verifies this behavior. All existing scheduler tests pass empty HashMap::new() for group_defaults, so the per-group fallback path (where a group has a computed average that differs from the 1s default) is never tested. A test should be added where some tests have historical durations and others in the same group don't, verifying the group average is used instead of the 1s fallback.

@DanverImbue DanverImbue self-requested a review March 18, 2026 18:26
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Vet found 2 issues.


[commit_message_mismatch] (severity 2/5) (confidence 0.85)

The diff includes changes to skills/offload-onboard/SKILL.md (Step 9 rewrite with baseline comparison instructions) that are unrelated to the user request about replacing flat default_duration with per-group average in the scheduler. This is an unauthorized change not mentioned in the request.

@@ -211,7 +218,7 @@ mod tests {
durations.insert("medium_test".to_string(), Duration::from_secs(5));
durations.insert("fast_test".to_string(), Duration::from_secs(1));

Choose a reason for hiding this comment

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

[test_coverage] (severity 3/5) (confidence 0.92)

No test was added to verify the per-group average duration behavior. There should be a test where some tests in a group have historical durations and others don't, verifying that the unknown tests use the group average rather than the 1s fallback. The existing test test_schedule_uses_default_for_unknown still passes an empty group_to_default_duration map, so it only tests the 1s fallback path, not the new per-group average feature.

Copy link
Collaborator

@DanverImbue DanverImbue left a comment

Choose a reason for hiding this comment

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

LGTM

@DanverImbue DanverImbue merged commit e5504ca into main Mar 18, 2026
4 checks passed
@DanverImbue DanverImbue deleted the worktree-scheduler-defaults branch March 18, 2026 19:28
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.

3 participants