Improve dry-run wait-line output readability #59

Merged
JackFrostbyte merged 2 commits from fix/issue-50-dry-run-output-readability into develop 2026-05-15 18:08:06 -04:00
Collaborator

Summary

  • Collapses consecutive "all logical zones already active" wait ticks in the dry-run preview into a single summary line per wait run.
  • Each summary shows the time range (t=X -> t=Y) and total waited duration.
  • The final Scheduler wait points: N summary line is unchanged and still reflects the true total tick count, so no scheduler information is lost.
  • Runtime scheduling behavior is unchanged. The dry-run loop math is identical; only the print structure differs.

Why

A --seed 42 dry-run currently prints 17 consecutive identical wait lines between events 5 and 6, then another 3 between events 12 and 13. The actual scheduler events get visually buried by repetitive noise. With this change, the same run produces two readable summary lines instead of 20 near-duplicates.

Before / after

Same run with --seed 42.

Before

05. t=  12.00s | gpu | gpu_aurora_wave_reverse | duration=10.30s | next_delay=2.12s
    t=  14.37s | all logical zones already active; scheduler waits 0.25s
    t=  14.62s | all logical zones already active; scheduler waits 0.25s
    ...   14 more identical lines   ...
    t=  18.37s | all logical zones already active; scheduler waits 0.25s
06. t=  18.37s | motherboard | motherboard_low_resolution_aurora | ...

After

05. t=  12.00s | gpu | gpu_aurora_wave_reverse | duration=10.30s | next_delay=2.12s
    t=  14.12s -> t=  18.37s | all logical zones already active; waited 4.25s
06. t=  18.37s | motherboard | motherboard_low_resolution_aurora | ...

A short wait run (e.g. 3 ticks) renders the same way for consistency:

    t=  41.76s -> t=  42.51s | all logical zones already active; waited 0.75s

Implementation

Inside _print_dry_run_scheduler_preview in src/rgb_aura/dry_run.py:

  • Added wait_run_start_time and wait_run_ticks accumulators.
  • When the scheduler picks None, accumulate (don't print) and capture the start time on the first tick of the run.
  • When the scheduler picks a zone OR the loop exits, flush the accumulated wait run via a small inline _emit_wait_summary helper.
  • The existing wait_count total is unchanged, so the Scheduler wait points: N line at the bottom of the preview still reports the true tick count.

Verification

  • python -m rgb_aura.main --dry-run --seed 42 — preview now shows two collapsed wait lines instead of 20 individual ones. All 14 events still print in order. Scheduler wait points: 20 summary preserved.
  • python -m rgb_aura.main --dry-run --dry-run-events 14 — random-seed run also collapses cleanly. Scheduler wait points: N summary still printed.
  • python -m pytest tests/ — 1 passed (existing test_run_combined_runtime_returns_mapping_error_when_validation_fails).
  • ruff format src tests scripts — 29 files left unchanged.
  • ruff check src tests scripts — all checks passed.

Hardware verification

Not required. Pure stdout-format change. Runtime scheduling logic untouched (runtime._run_semi_random_scheduler is in a different module entirely). The runtime module's --seed reproducibility is unaffected.

Linked issue

Closes #50.

Branch workflow

  • Base branch: develop
  • Work branch: fix/issue-50-dry-run-output-readability
  • Pull request target: develop
  • Not merged directly into main.

Notes for reviewer

  • No new tests added. Stdout-format tests are brittle and the issue's acceptance criteria ("Tests pass where applicable") leaves the call open. The change is mechanically simple and isolated to one function; manual --seed 42 verification is the natural check.
  • ASCII -> chosen for the time-range separator to match the rest of the preview output (no non-ASCII characters elsewhere).
## Summary - Collapses consecutive "all logical zones already active" wait ticks in the dry-run preview into a single summary line per wait run. - Each summary shows the time range (`t=X -> t=Y`) and total waited duration. - The final `Scheduler wait points: N` summary line is unchanged and still reflects the true total tick count, so no scheduler information is lost. - Runtime scheduling behavior is unchanged. The dry-run loop math is identical; only the print structure differs. ## Why A `--seed 42` dry-run currently prints 17 consecutive identical wait lines between events 5 and 6, then another 3 between events 12 and 13. The actual scheduler events get visually buried by repetitive noise. With this change, the same run produces two readable summary lines instead of 20 near-duplicates. ## Before / after Same run with `--seed 42`. ### Before ``` 05. t= 12.00s | gpu | gpu_aurora_wave_reverse | duration=10.30s | next_delay=2.12s t= 14.37s | all logical zones already active; scheduler waits 0.25s t= 14.62s | all logical zones already active; scheduler waits 0.25s ... 14 more identical lines ... t= 18.37s | all logical zones already active; scheduler waits 0.25s 06. t= 18.37s | motherboard | motherboard_low_resolution_aurora | ... ``` ### After ``` 05. t= 12.00s | gpu | gpu_aurora_wave_reverse | duration=10.30s | next_delay=2.12s t= 14.12s -> t= 18.37s | all logical zones already active; waited 4.25s 06. t= 18.37s | motherboard | motherboard_low_resolution_aurora | ... ``` A short wait run (e.g. 3 ticks) renders the same way for consistency: ``` t= 41.76s -> t= 42.51s | all logical zones already active; waited 0.75s ``` ## Implementation Inside `_print_dry_run_scheduler_preview` in `src/rgb_aura/dry_run.py`: - Added `wait_run_start_time` and `wait_run_ticks` accumulators. - When the scheduler picks `None`, accumulate (don't print) and capture the start time on the first tick of the run. - When the scheduler picks a zone OR the loop exits, flush the accumulated wait run via a small inline `_emit_wait_summary` helper. - The existing `wait_count` total is unchanged, so the `Scheduler wait points: N` line at the bottom of the preview still reports the true tick count. ## Verification - [x] `python -m rgb_aura.main --dry-run --seed 42` — preview now shows two collapsed wait lines instead of 20 individual ones. All 14 events still print in order. `Scheduler wait points: 20` summary preserved. - [x] `python -m rgb_aura.main --dry-run --dry-run-events 14` — random-seed run also collapses cleanly. `Scheduler wait points: N` summary still printed. - [x] `python -m pytest tests/` — 1 passed (existing `test_run_combined_runtime_returns_mapping_error_when_validation_fails`). - [x] `ruff format src tests scripts` — 29 files left unchanged. - [x] `ruff check src tests scripts` — all checks passed. ## Hardware verification Not required. Pure stdout-format change. Runtime scheduling logic untouched (`runtime._run_semi_random_scheduler` is in a different module entirely). The `runtime` module's `--seed` reproducibility is unaffected. ## Linked issue Closes #50. ## Branch workflow - Base branch: `develop` - Work branch: `fix/issue-50-dry-run-output-readability` - Pull request target: `develop` - Not merged directly into `main`. ## Notes for reviewer - No new tests added. Stdout-format tests are brittle and the issue's acceptance criteria ("Tests pass where applicable") leaves the call open. The change is mechanically simple and isolated to one function; manual `--seed 42` verification is the natural check. - ASCII `->` chosen for the time-range separator to match the rest of the preview output (no non-ASCII characters elsewhere).
JackFrostbyte deleted branch fix/issue-50-dry-run-output-readability 2026-05-15 18:08:06 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JackFrostbyte/rgb-aura!59
No description provided.