fix(kvb-org-queue): book a job at its own command's footprint
A command with 5+ runs is booked at its own p90 RAM and CPU share, an unlearned one at its kind's p90. The old rule took the larger of kind and command, and for an unlearned command the largest command of its kind: test-nostack-788 (docker build) sat 90 min at position 1, booked at 42.6 % RAM from a legacy gate.py hold row while test-nostack measures 5.6 %; skills make test (3.3 %) was booked at the test kind's 35 %. 🎯 Fix: 93 % 💥 Break: 5 % 💸 Cost: 99 % ⏱️ Time: 100 % 🛡️ Security: 100 % 🏆 Score: 89 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
45063dc71f
commit
7043cdfd98
3 files changed
+17
-15
No files matched your search
+11
-1
@@ -308,7 +308,17 @@ class TestHistory(unittest.TestCase):
|
||||
crowded = [history_row(n, mem_before=90, mem_max=95) for n in range(5)]
|
||||
self.assertEqual(self.learn(crowded)[1]["test"]["limit"], 1)
|
||||
|
||||
def test_footprint_takes_the_larger_of_kind_and_signature_at_least_the_minimum_and_none_for_a_new_kind(self):
|
||||
def test_a_light_command_of_a_heavy_kind_and_an_unlearned_one_are_not_booked_at_the_heaviest_share(self):
|
||||
signatures = {
|
||||
"skills: make test": {"ram_share": 3.3, "cpu_share": 4, "kinds": {"test"}},
|
||||
"gate.py hold": {"ram_share": 42.6, "cpu_share": 93.5, "kinds": {"test", "test-nostack"}},
|
||||
}
|
||||
kinds = {"test": {"ram_share": 35.2, "cpu_share": 83.6}, "test-nostack": {"ram_share": 5.6, "cpu_share": 73.8}}
|
||||
footprint = self.history.footprint
|
||||
self.assertEqual(footprint("test", "skills: make test", signatures, kinds), {"ram": 3.3, "cpu": 4})
|
||||
self.assertEqual(footprint("test-nostack", "core: docker build", signatures, kinds), {"ram": 5.6, "cpu": 73.8})
|
||||
|
||||
def test_footprint_takes_the_learned_signature_else_the_kind_at_least_the_minimum_and_none_for_a_new_kind(self):
|
||||
small = [history_row(n, signature="make test", mem_max=25, cpu_max=20) for n in range(5)]
|
||||
big = [
|
||||
history_row(n + 5, kind="quality-high", signature="make verify-test", mem_max=80, cpu_max=90)
|
||||
|
||||
Reference in new issue
Block a user