Skip to content

Commit da90c20

Browse files
sourcehawkclaude
andauthored
feat(skills/bounding-heavy-commands): record a measured row per --cpus for each self-bounded command (#62)
* feat(skills/bounding-heavy-commands): bound each command before it is measured, and keep a row per --cpus Agents skipped the step that makes a recorded command bound its own parallelism. It was one of six discovery steps, nothing blocked a measurement until it was done, and an entry without a self-bound looked complete. So a session could measure the plain command, record the peak of a command that nothing limits, and later runs waited for twice the slots they needed. Baseline runs also showed that an agent picked the first --cpus by itself, kept only one of two entries measured at different --cpus, and refused a smaller --cpus as if it were a lowered budget, which threw away a finished measurement. Discovery now bounds the command first, as a gate, and measures the bounded line at --cpus of half the machine's processors. Each record entry has a required self-bound field and a table with one row per --cpus: a new --cpus adds a row, the same --cpus replaces its row, and one row is the default. A row at a smaller --cpus is the way to start sooner. When none exists, the run stays queued and the smaller row is measured under the budget of the smallest row for next time. Closes #53 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(skills/bounding-heavy-commands): key an entry on its command without the row values, and pass --cpus to a smaller row The command line of an entry carries the --memory and --cpus of its default row. So two entries of one command with different default rows did not merge, and a change of the default row read as a new command whose rows must be deleted. Both rules now ignore those two values. The measurement of a smaller row now names its --cpus and --memory in place of the values of the command line; before, it named only --memory, and the run used the --cpus of the default row. An entry of the older shape is complete only when its command line reads BOUNDED_RUN_CPUS, because a memory setting alone can be one that covers a single process, which discovery does not accept as a bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(skills/bounding-heavy-commands): say which default row a merged entry keeps Two entries of one command can each have a default row, and the merge rule kept the rows of both without saying which default stays. The merged entry now keeps the default row of the entry that the agent keeps, at its --cpus, and marks no other row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(skills/bounding-heavy-commands): use a smaller --cpus to start sooner only when the command reads it A smaller --cpus makes a smaller command only when the self-bound of the entry reads BOUNDED_RUN_CPUS. For a command with self-bound none, or with a memory setting only, the smaller row measured the same command and did not start sooner. The skill now keeps such a run in the queue and measures no smaller row for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(skills/bounding-heavy-commands): say that a smaller row starts sooner only when it needs fewer slots The queue counts a budget in whole slots, so a smaller row whose budget needs as many slots as the default row waits as long. The skill said that a smaller row always gets a slot sooner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(skills/bounding-heavy-commands): require one default row that matches the command line in a complete entry A complete entry needed only a self-bound and a row, but case 2 runs the default row of the entry. An entry with no default row, or with two, had no row to run, and one whose default row did not match its command line had two values for one run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(skills/bounding-heavy-commands): limit the row values of the key to the wrapper, and do not promise a bound for a smaller row The merge rule and the change rule ignored every --memory and --cpus of the command line, also those of the command after the '--', which can be real options of the tool. They now name the wrapper's two values only. The skill also said that a smaller row never needs more than the budget of the smallest row. A command can keep more state when it does its work in sequence, so the text now says "seldom" and points to the rule for a measurement that the hard cap stops. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(skills/bounding-heavy-commands): write the default row into the command line after a merge A merge keeps the newer row at each --cpus, so the default row can get the budget of the other entry while the command line keeps the old --memory. The entry was then incomplete by its own rule. The merge now ends by writing the values of the default row into the command line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(skills/bounding-heavy-commands): take the --cpus of an old entry from the wrapper options only An old command line can hold a --cpus of the tool after the '--'. The migration rule counted it, but the wrapper then had no --cpus, BOUNDED_RUN_CPUS was the processor count of the machine, and the default row had no --cpus to record. The rule now needs --cpus in the wrapper options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7f23210 commit da90c20

1 file changed

Lines changed: 34 additions & 19 deletions

File tree

0 commit comments

Comments
 (0)