Skip to content

refactor: extract reusable RL console panel - #153

Merged
wlgys8 merged 1 commit into
mainfrom
refactor/rl-console-session
Nov 1, 2026
Merged

wlgys8 merged 1 commit into
mainfrom
refactor/rl-console-session

Conversation

@wlgys8

@wlgys8 wlgys8 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • move shared console panel lifecycle and sampling into a reusable motrix_rl.console package
  • refactor FastSAC sync and async trainers to use the shared panel session and stats pipeline
  • decouple panel rendering from TensorBoard/live logging and pass resolved collector devices directly
  • document the architecture and update focused tests

Validation

  • ruff check on changed console and FastSAC modules
  • python -m compileall -q on changed Python modules

Closes #153

wlgys8 added a commit that referenced this pull request Nov 1, 2026
@wlgys8
wlgys8 requested a balanced review from Copilot November 1, 2026 14:02

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.

🟡 Changes recommended

The collector test omits the required collector_device argument and fails with TypeError, while statistics handling misreports weight-publication rates and can permanently discard checkpoint notices.

3 open issues
What changed in this PR

This PR extracts reusable console-panel utilities into motrix_rl and migrates FastSAC to shared lifecycle and sampling components, laying groundwork for other RL providers.

Changes:

  • Adds shared panel sessions, resource sampling, and statistics helpers.
  • Separates FastSAC async statistics aggregation, rendering, and logging; passes resolved collector devices directly.
  • Updates focused tests and documents the console architecture.
File Description
wiki/​design/​rl-console-panel.md Documents shared console architecture and migration plans.
wiki/​design/​index.md Links the console design document.
motrix_rl/​tests/​test_panel_data.py Tests shared statistics helpers.
motrix_rl/​tests/​test_console.py Updates imports and tests session lifecycle.
motrix_rl/​src/​motrix_rl/​console/​panel.py Adds session-owned refresh and cleanup.
motrix_rl/​src/​motrix_rl/​console/​data.py Adds aggregation and system-sampling utilities.
motrix_rl/​src/​motrix_rl/​console/​__init__.py Exposes the shared console API.
motrix_rl_builtin/​tests/​test_fastsac_live_metrics.py Adapts queue and rendering test hooks.
motrix_rl_builtin/​tests/​test_fastsac_collector.py Tests explicit collector-device handoff.
motrix_rl_builtin/​tests/​test_builtin_sim_backend.py Updates collector queue naming.
motrix_rl_builtin/​src/​motrix_rl_builtin/​fastsac/​sync/​train.py Uses shared sessions and samplers.
motrix_rl_builtin/​src/​motrix_rl_builtin/​fastsac/​async_impl/​worker.py Renames data queues and accepts resolved devices.
motrix_rl_builtin/​src/​motrix_rl_builtin/​fastsac/​async_impl/​train.py Integrates separate statistics consumers.
motrix_rl_builtin/​src/​motrix_rl_builtin/​fastsac/​async_impl/​stats.py Extracts aggregation, logging, and rendering components.
motrix_rl_builtin/​src/​motrix_rl_builtin/​fastsac/​async_impl/​collector.py Uses the supplied device without re-resolution.

Review effort: Balanced

@wlgys8
wlgys8 force-pushed the refactor/rl-console-session branch from 9eda055 to 2de6508 Compare November 1, 2026 14:06
@wlgys8
wlgys8 force-pushed the refactor/rl-console-session branch from 2de6508 to 6996c62 Compare November 1, 2026 14:19
@wlgys8
wlgys8 force-pushed the refactor/rl-console-session branch from 6996c62 to 1e8aa28 Compare November 1, 2026 14:21
@wlgys8
wlgys8 force-pushed the refactor/rl-console-session branch from 1e8aa28 to be4f7d4 Compare November 1, 2026 14:28
@wlgys8
wlgys8 force-pushed the refactor/rl-console-session branch from be4f7d4 to 15fd256 Compare November 1, 2026 14:37
@wlgys8
wlgys8 force-pushed the refactor/rl-console-session branch from 15fd256 to 2ada711 Compare November 1, 2026 14:59
@wlgys8
wlgys8 requested a balanced review from Copilot November 1, 2026 15:09

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.

🟡 Changes recommended

The regression fixture relies on three 30-second timeouts due to incorrect expected log counts, and non-TTY output suppresses checkpoint-save notices after the first stats submission.

2 open issues
2 resolved since last review

Review effort: Balanced

@wlgys8
wlgys8 force-pushed the refactor/rl-console-session branch from 2ada711 to 2a0e3b9 Compare November 1, 2026 15:25
@wlgys8
wlgys8 force-pushed the refactor/rl-console-session branch from 2a0e3b9 to a64d549 Compare November 1, 2026 15:42
@wlgys8
wlgys8 merged commit 8a1b6c3 into main Nov 1, 2026
12 checks passed
@wlgys8
wlgys8 deleted the refactor/rl-console-session branch November 1, 2026 15:47
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