Repository navigation
fix(skills/bounding-heavy-commands): stop a first measurement from blocking every session where the hard cap protects the machine - #66
Merged
Conversation
sourcehawk
force-pushed
the
fix/first-measure-default-budget
branch
from
September 30, 2026 02:27
463b547 to
7f37c1a
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the issue’s acceptance criteria and includes focused automated coverage.
Review effort: Balanced
Findings: None
What changed in this PR
This PR prevents capped first measurements from monopolizing the heavy-command queue.
Changes:
- Uses the default budget when a hard cap is available.
- Preserves whole-queue reservation without a cap.
- Adds tests and updates user guidance.
| File | Description |
|---|---|
bounded_run.py |
Selects reservation size after probing cap availability. |
test_bounded_run.py |
Covers measurement behavior with and without caps. |
SKILL.md |
Updates measurement workflow guidance. |
README.md |
Clarifies first-measurement queue behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sourcehawk
force-pushed
the
fix/first-measure-default-budget
branch
from
September 30, 2026 08:50
7f37c1a to
52152f7
Compare
sourcehawk
force-pushed
the
fix/first-measure-default-budget
branch
from
September 30, 2026 08:57
52152f7 to
6aa78c6
Compare
sourcehawk
force-pushed
the
fix/first-measure-default-budget
branch
from
September 30, 2026 09:06
6aa78c6 to
f27fd12
Compare
…lding the whole queue where the hard cap protects the machine A measurement with no --memory reserved every slot of the queue, so no other heavy command on the machine could start while it ran. Where the hard cap is usable, that buys no safety: a command that passes its budget is stopped with exit code 137 and the machine does not swap. One observed first measurement held a 20 GiB queue while it used under 1 GiB. Where the cap is usable, a first measurement, and the largest row of --measure-rows with no --memory, now reserves the slots of the default budget and runs with that budget as its cap. Where there is no cap, it still takes the whole queue. The cap probe runs before this choice, with the default budget, which is the budget of the capped run. The skill and the README now say which case takes the whole queue, and a first measurement that the cap stopped is measured again at two times the default budget, up to the whole queue. Fixes #60 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sourcehawk
force-pushed
the
fix/first-measure-default-budget
branch
from
September 30, 2026 10:22
f27fd12 to
e675fc2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #60
A first measurement (
--measurewith no--memory) reserved the whole queue, so while it ran, often for many minutes, no other heavy command on the machine could start, even when it used a small part of that memory. On Linux the hard cap already protects the machine from a command whose peak is not known, so a first measurement now runs with the default budget (a quarter of the machine's memory) where the cap is available, and takes the whole queue only where there is no cap. A command that needs more than the default budget is now stopped by the cap on its first measurement and is measured again at twice the budget. That costs one extra run, and the other sessions no longer wait for it.Changes
--measurewith no--memoryreserves the slots of the default budget and runs under a cap of that budget. Without the cap it still takes the whole queue.--measure-rowsfollows the same rule for its largest row.Related
Testing
TDD. A new in-process test class checks the slots reserved,
BOUNDED_RUN_MEMORY_MIB, and the cap for--measureand for the largest row of--measure-rows, each with and without the cap. The two tests with the cap failed before the change, because they got all the slots. The full suite passes through the queue.🤖 Generated with Claude Code