Skip to content

Refill action#21

Open
rbx wants to merge 3 commits intomasterfrom
refill-action
Open

Refill action#21
rbx wants to merge 3 commits intomasterfrom
refill-action

Conversation

@rbx
Copy link
Member

@rbx rbx commented Feb 4, 2026

An alternative to #20, with:

  • an action for the agent to trigger a refill from the backlog.
  • few stats about the remaining jobs in the observation space.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The changes extend the job scheduling environment to support backlog-to-queue refilling. Key modifications include: adding a refill flag to the action space, tracking pending job statistics (count, core-hours, average duration, max nodes, backlog size), implementing greedy backlog refill loops in the baseline scheduler, increasing the maximum queue size, and logging additional metrics. Documentation updated to reflect the new action and state structures.

Changes

Cohort / File(s) Summary
Documentation
CLAUDE.md
Updated state and action space descriptions to document pending job metrics, backlog size, and the new 3-element action tuple [action_type, magnitude, do_refill]. Added baseline scheduler overview.
Configuration
src/config.py
Increased MAX_QUEUE_SIZE constant from 1000 to 2500 to accommodate larger job queues.
Core Environment
src/environment.py
Extended action space to 3-element tuple with refill flag; augmented observation with pending job statistics (count, core-hours, avg duration, max nodes) and backlog size; introduced _update_pending_job_stats() method to compute job summary metrics; added optional backlog refill in step() based on action flag.
Baseline Scheduler
src/baseline.py
Introduced greedy backlog refill loop: captures job launch count from assign_jobs_to_available_nodes() and repeatedly fills from backlog and re-assigns jobs while progress is made, chaining operations until no further scheduling occurs.
Metrics & Monitoring
src/callbacks.py
Added logging of metrics/on_nodes and metrics/used_nodes during the final episode hour using new environment tracking metrics.
Tests
test/test_sanity_env.py
Updated test action vector from 2-element [1, 0] to 3-element [1, 0, 1] to match new action space structure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Next empty slot bump #2: Modifies return value handling in assign_jobs_to_available_nodes() and related queue allocation logic, which directly intersects with the baseline scheduler changes in this PR.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Refill action' directly corresponds to the main change: adding a refill action to the agent's action space that allows triggering backlog refills, which is the primary objective mentioned in the PR description.
Description check ✅ Passed The description accurately relates to the changeset by mentioning both key components: an action for backlog refills and statistics about remaining jobs in observations, both of which are implemented across the modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refill-action

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant