Skip to content

Commit 1197203

Browse files
committed
perf(ci): let measured compact weights outrank pinned hints
The hand-fitted compact tables were read before the committed measurements, so every pinned group was immune to the nightly `ci:timings:refit`. Stale low pins (agentic-agents-core-models 41 vs 121 measured, agentic-agents-embedded-base 79 vs 147, auto-reply-reply-dispatch 18 vs 53) kept packing partners onto the tallest bins: 17 of 36 measured stripe groups had drifted >=10s, which is why compact-large jobs ran ~195s of body in bins predicted at 85s. The tables' own comments describe them as stand-ins "until direct Blacksmith samples exist", so a committed measurement now owns the weight and the tables cover only groups the refit has never observed. Also refresh the measurements themselves; the standing refit PR was closed by an invalidation reset on 2026-08-30 and never reopened, leaving the weights stale since 2026-08-27. Hybrid push plan: tallest bin 171s -> 128s, total predicted 4945s -> 4540s, 55 -> 51 jobs. The exclusive-bin guard duplicated EXCLUSIVE_COMPACT_GROUP_RE and had drifted past agentic-gateway-core-runtime, so it silently stopped covering it; it now uses the exported predicate. Its companion assertion that the push plan holds no exclusive group was only true through that drift and duplicated the stronger pushExcludedShardNames check, so it is removed.
1 parent 19fe10b commit 1197203

3 files changed

Lines changed: 113 additions & 94 deletions

File tree

‎config/ci-test-timings.json‎

Lines changed: 85 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,144 @@
11
{
22
"compactGroupSeconds": {
33
"blacksmith": {
4-
"agentic-agents-core-auth": 40,
5-
"agentic-agents-core-isolated": 24,
4+
"agentic-agents-core-auth": 48,
5+
"agentic-agents-core-isolated": 14,
66
"agentic-agents-core-models": 121,
7-
"agentic-agents-core-runner-cli-1": 14,
8-
"agentic-agents-core-runner-cli-2": 24,
9-
"agentic-agents-core-runner-cli-3": 19,
10-
"agentic-agents-core-runner-commands": 46,
7+
"agentic-agents-core-models-hosted-1": 118,
8+
"agentic-agents-core-models-hosted-2": 99,
9+
"agentic-agents-core-runner-cli-1": 9,
10+
"agentic-agents-core-runner-cli-2": 17,
11+
"agentic-agents-core-runner-cli-3": 15,
12+
"agentic-agents-core-runner-commands": 31,
1113
"agentic-agents-core-runner-embedded": 24,
12-
"agentic-agents-core-runner-sessions": 20,
13-
"agentic-agents-core-runtime-hosted-1": 70,
14+
"agentic-agents-core-runner-sessions": 16,
15+
"agentic-agents-core-runtime-hosted-1": 83,
1416
"agentic-agents-core-runtime-hosted-2": 100,
15-
"agentic-agents-core-subagents": 24,
17+
"agentic-agents-core-subagents": 12,
1618
"agentic-agents-core-tools": 79,
17-
"agentic-agents-embedded-base": 81,
18-
"agentic-agents-embedded-incomplete-turn": 8,
19+
"agentic-agents-embedded-base": 147,
20+
"agentic-agents-embedded-incomplete-turn": 3,
1921
"agentic-agents-embedded-overflow-compaction": 22,
2022
"agentic-agents-embedded-run": 51,
21-
"agentic-agents-support-hosted-1": 117,
22-
"agentic-agents-support-hosted-2": 84,
23+
"agentic-agents-support-hosted-1": 148,
24+
"agentic-agents-support-hosted-2": 153,
2325
"agentic-agents-tools": 80,
2426
"agentic-cli": 136,
2527
"agentic-cli-process": 133,
26-
"agentic-command-support": 30,
28+
"agentic-command-support": 42,
2729
"agentic-commands-agent-channel": 71,
28-
"agentic-commands-doctor": 39,
29-
"agentic-commands-doctor-auth": 24,
30-
"agentic-commands-doctor-config-state": 196,
31-
"agentic-commands-doctor-device": 3,
32-
"agentic-commands-doctor-gateway": 5,
33-
"agentic-commands-doctor-platform": 5,
34-
"agentic-commands-doctor-plugins-tools": 15,
35-
"agentic-commands-doctor-sessions-cron": 46,
36-
"agentic-commands-doctor-shared": 34,
37-
"agentic-commands-doctor-whatsapp": 2,
38-
"agentic-commands-doctor-workspace": 2,
39-
"agentic-commands-models": 22,
40-
"agentic-commands-onboard-config": 41,
30+
"agentic-commands-doctor": 48,
31+
"agentic-commands-doctor-auth": 19,
32+
"agentic-commands-doctor-config-state": 144,
33+
"agentic-commands-doctor-device": 2,
34+
"agentic-commands-doctor-gateway": 7,
35+
"agentic-commands-doctor-platform": 1,
36+
"agentic-commands-doctor-plugins-tools": 12,
37+
"agentic-commands-doctor-sessions-cron": 91,
38+
"agentic-commands-doctor-shared": 29,
39+
"agentic-commands-doctor-whatsapp": 1,
40+
"agentic-commands-doctor-workspace": 1,
41+
"agentic-commands-models": 17,
42+
"agentic-commands-onboard-config": 33,
4143
"agentic-commands-status-tools": 50,
42-
"agentic-control-plane-agent-chat-hosted-1": 101,
43-
"agentic-control-plane-agent-chat-hosted-2": 114,
44-
"agentic-control-plane-auth-node-hosted-1": 77,
44+
"agentic-control-plane-agent-chat-hosted-1": 134,
45+
"agentic-control-plane-agent-chat-hosted-2": 78,
46+
"agentic-control-plane-auth-node-hosted-1": 48,
4547
"agentic-control-plane-auth-node-hosted-2": 54,
46-
"agentic-control-plane-http-models": 39,
47-
"agentic-control-plane-http-plugin-ws": 48,
48-
"agentic-control-plane-runtime": 10,
49-
"agentic-control-plane-runtime-config": 13,
50-
"agentic-control-plane-runtime-cron": 41,
48+
"agentic-control-plane-http-models": 32,
49+
"agentic-control-plane-http-plugin-ws": 39,
50+
"agentic-control-plane-runtime": 8,
51+
"agentic-control-plane-runtime-config": 18,
52+
"agentic-control-plane-runtime-cron": 32,
5153
"agentic-control-plane-runtime-network": 1,
5254
"agentic-control-plane-runtime-server": 45,
53-
"agentic-control-plane-runtime-shared-token": 25,
54-
"agentic-control-plane-runtime-state": 41,
55-
"agentic-control-plane-runtime-ui-tools": 22,
56-
"agentic-control-plane-startup-config": 11,
57-
"agentic-control-plane-startup-core": 36,
55+
"agentic-control-plane-runtime-shared-token": 15,
56+
"agentic-control-plane-runtime-state": 16,
57+
"agentic-control-plane-runtime-ui-tools": 6,
58+
"agentic-control-plane-startup-config": 5,
59+
"agentic-control-plane-startup-core": 24,
5860
"agentic-control-plane-startup-health-runtime": 21,
59-
"agentic-control-plane-startup-restart-close": 12,
61+
"agentic-control-plane-startup-restart-close": 9,
6062
"agentic-gateway-core-1": 127,
63+
"agentic-gateway-core-1-hosted-1": 149,
64+
"agentic-gateway-core-1-hosted-2": 72,
6165
"agentic-gateway-core-2": 118,
6266
"agentic-gateway-core-3": 123,
67+
"agentic-gateway-core-runtime": 16,
6368
"agentic-gateway-methods-hosted-1": 129,
64-
"agentic-gateway-methods-hosted-2": 103,
69+
"agentic-gateway-methods-hosted-2": 83,
6570
"agentic-gateway-server-isolated": 21,
6671
"agentic-plugin-sdk": 59,
67-
"auto-reply-core-top-level": 30,
72+
"auto-reply-core-top-level": 23,
6873
"auto-reply-reply-agent-runner": 52,
69-
"auto-reply-reply-commands-1": 34,
70-
"auto-reply-reply-commands-2": 24,
71-
"auto-reply-reply-commands-3": 21,
74+
"auto-reply-reply-agent-runner-hosted-1": 101,
75+
"auto-reply-reply-agent-runner-hosted-2": 59,
76+
"auto-reply-reply-commands-1": 25,
77+
"auto-reply-reply-commands-2": 20,
78+
"auto-reply-reply-commands-3": 16,
7279
"auto-reply-reply-dispatch": 53,
73-
"auto-reply-reply-dispatch-core": 43,
80+
"auto-reply-reply-dispatch-core": 16,
7481
"auto-reply-reply-dispatch-delivery": 21,
75-
"auto-reply-reply-dispatch-lifecycle": 19,
82+
"auto-reply-reply-dispatch-lifecycle": 16,
7683
"auto-reply-reply-session": 42,
7784
"auto-reply-reply-state-routing": 30,
78-
"core-runtime-config-hosted-1": 79,
85+
"core-runtime-config-hosted-1": 60,
7986
"core-runtime-config-hosted-2": 70,
8087
"core-runtime-cron-core": 29,
81-
"core-runtime-cron-isolated-agent-hosted-1": 62,
88+
"core-runtime-cron-isolated-agent-hosted-1": 40,
8289
"core-runtime-cron-isolated-agent-hosted-2": 33,
83-
"core-runtime-cron-service": 128,
90+
"core-runtime-cron-service": 93,
8491
"core-runtime-hooks": 27,
85-
"core-runtime-infra-approval-exec": 31,
86-
"core-runtime-infra-channel-plugin": 24,
87-
"core-runtime-infra-cli-ui": 3,
92+
"core-runtime-infra-approval-exec": 25,
93+
"core-runtime-infra-channel-plugin": 15,
94+
"core-runtime-infra-cli-ui": 2,
8895
"core-runtime-infra-core-utils": 4,
89-
"core-runtime-infra-device": 10,
90-
"core-runtime-infra-diagnostics-state": 27,
91-
"core-runtime-infra-env-auth": 6,
92-
"core-runtime-infra-events-runtime": 9,
93-
"core-runtime-infra-file-safety": 3,
96+
"core-runtime-infra-device": 8,
97+
"core-runtime-infra-diagnostics-state": 20,
98+
"core-runtime-infra-env-auth": 5,
99+
"core-runtime-infra-events-runtime": 6,
100+
"core-runtime-infra-file-safety": 2,
94101
"core-runtime-infra-files-commands": 5,
95-
"core-runtime-infra-gateway-lock-argv": 3,
102+
"core-runtime-infra-gateway-lock-argv": 2,
96103
"core-runtime-infra-gateway-processes": 1,
97104
"core-runtime-infra-gateway-watch": 1,
98105
"core-runtime-infra-heartbeat-core": 6,
99-
"core-runtime-infra-heartbeat-runner": 72,
100-
"core-runtime-infra-misc": 28,
106+
"core-runtime-infra-heartbeat-runner": 57,
107+
"core-runtime-infra-misc": 24,
101108
"core-runtime-infra-misc-dedupe-disk": 1,
102-
"core-runtime-infra-misc-os": 2,
109+
"core-runtime-infra-misc-os": 1,
103110
"core-runtime-infra-misc-values": 1,
104111
"core-runtime-infra-net-install": 14,
105112
"core-runtime-infra-network-node": 5,
106113
"core-runtime-infra-network-platform": 6,
107-
"core-runtime-infra-outbound-actions": 43,
114+
"core-runtime-infra-outbound-actions": 31,
108115
"core-runtime-infra-outbound-core": 74,
109116
"core-runtime-infra-process": 38,
110-
"core-runtime-infra-provider-push": 16,
117+
"core-runtime-infra-provider-push": 12,
111118
"core-runtime-infra-repo-tooling": 4,
112-
"core-runtime-infra-storage-state-hosted-1": 56,
119+
"core-runtime-infra-storage-state-hosted-1": 76,
113120
"core-runtime-infra-storage-state-hosted-2": 75,
114-
"core-runtime-infra-system-runtime": 65,
121+
"core-runtime-infra-system-runtime": 55,
115122
"core-runtime-media-ui-1": 91,
116123
"core-runtime-media-ui-2": 77,
117124
"core-runtime-media-ui-3": 73,
118-
"core-runtime-media-ui-support": 105,
119-
"core-runtime-secrets": 56,
120-
"core-runtime-shared": 64,
121-
"core-unit-fast-1": 83,
122-
"core-unit-fast-2": 74,
123-
"core-unit-fast-fake-timers": 23,
125+
"core-runtime-media-ui-support": 73,
126+
"core-runtime-secrets": 37,
127+
"core-runtime-shared": 31,
128+
"core-unit-fast-1": 38,
129+
"core-unit-fast-2": 52,
130+
"core-unit-fast-fake-timers": 15,
124131
"core-unit-fast-isolated-hosted-1": 51,
125132
"core-unit-fast-isolated-hosted-2": 63,
126-
"core-unit-src-security-1": 148,
127-
"core-unit-src-security-2": 113,
133+
"core-unit-src-security-1": 107,
134+
"core-unit-src-security-2": 94,
128135
"core-unit-src-security-3": 110,
129-
"core-unit-src-security-support": 16,
136+
"core-unit-src-security-support": 13,
130137
"core-unit-support": 24
131138
},
132139
"github": {}
133140
},
134-
"source": "median of 5 successful main CI runs: 33122714354, 33123002646, 33123527449, 33123593458, 33124586726",
141+
"source": "median of 7 successful main CI runs: 33343593817, 33343841195, 33344104231, 33344247366, 33344484878, 33344787149, 33344819471",
135142
"uiE2e": {
136143
"fileSeconds": {
137144
"ui/src/e2e/about.e2e.test.ts": 1,
@@ -436,6 +443,6 @@
436443
},
437444
"perFileOverheadSeconds": 0.7
438445
},
439-
"updatedAt": "2026-08-27",
446+
"updatedAt": "2026-08-31",
440447
"version": 1
441448
}

‎scripts/lib/ci-node-test-plan.mts‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,12 @@ const EXCLUSIVE_COMPACT_GROUP_RE =
656656
// Exclusive bins run serially, so their packed estimate is their wall clock.
657657
const COMPACT_EXCLUSIVE_JOB_SECONDS = 150;
658658

659+
export function isExclusiveCompactShardName(shardName: string): boolean {
660+
return EXCLUSIVE_COMPACT_GROUP_RE.test(shardName);
661+
}
662+
659663
function isExclusiveCompactGroup(group: NodeTestShardGroup): boolean {
660-
return EXCLUSIVE_COMPACT_GROUP_RE.test(group.shard_name);
664+
return isExclusiveCompactShardName(group.shard_name);
661665
}
662666

663667
// Spawn/signal/PTY-timing suites also flake under high in-process worker
@@ -692,13 +696,27 @@ function usesExpandedRunnerProfile(runnerBackend: string | undefined): boolean {
692696
return runnerBackend === "github" || runnerBackend === "hybrid";
693697
}
694698

699+
// Hand-fitted tables stand in only until a group has direct Blacksmith samples,
700+
// so a committed measurement owns the weight and the table covers the rest.
701+
// Reading the tables first made every pinned group immune to the nightly refit:
702+
// pins stale-low kept packing partners onto the tallest bins, and pins
703+
// stale-high kept splitting groups that had since become cheap.
704+
function readUnmeasuredCompactHint(
705+
group: NodeTestShardGroup,
706+
hints: ReadonlyMap<string, number>,
707+
): number | undefined {
708+
return readCompactGroupTimings("blacksmith")[group.shard_name] === undefined
709+
? hints.get(group.shard_name)
710+
: undefined;
711+
}
712+
695713
function estimateHybridCompactGroupSeconds(group: NodeTestShardGroup, seconds: number): number {
696714
// The 4,723s Blacksmith push hint sum measured 3,742.046s/3,756.674s
697715
// (79.230%/79.540%) in runs 31945998653/31949756966. A 0.87 scale keeps
698716
// 9.379% headroom above the higher ratio. With direct outlier hints, it sits
699717
// one point above the 0.86 packing cliff.
700718
return (
701-
COMPACT_HYBRID_GROUP_SECONDS_HINTS.get(group.shard_name) ??
719+
readUnmeasuredCompactHint(group, COMPACT_HYBRID_GROUP_SECONDS_HINTS) ??
702720
Math.round(seconds * COMPACT_HYBRID_GROUP_SECONDS_SCALE)
703721
);
704722
}
@@ -732,7 +750,7 @@ function estimateCompactStripeSeconds(
732750
return estimateCompactGroupSeconds(group, runnerBackend);
733751
}
734752
const blacksmithSeconds =
735-
COMPACT_LARGE_GROUP_STRIPE_SECONDS_HINTS.get(group.shard_name) ??
753+
readUnmeasuredCompactHint(group, COMPACT_LARGE_GROUP_STRIPE_SECONDS_HINTS) ??
736754
estimateDefaultCompactGroupSeconds(group);
737755
return runnerBackend === "hybrid"
738756
? estimateHybridCompactGroupSeconds(group, blacksmithSeconds)

‎test/scripts/ci-node-test-plan.test.ts‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
createNodeTestShardBundles,
1111
createNodeTestShards,
1212
createVitestCacheWarmGroups,
13+
isExclusiveCompactShardName,
1314
resolvePolicyTestTargets,
1415
} from "../../scripts/lib/ci-node-test-plan.mts";
1516
import * as testTimings from "../../scripts/lib/ci-test-timings.mts";
@@ -297,10 +298,10 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
297298
);
298299

299300
it.each([
300-
{ profile: "blacksmith", addedSeconds: 61 },
301-
{ profile: "hybrid", addedSeconds: 53 },
301+
{ profile: "blacksmith", addedSeconds: 175 },
302+
{ profile: "hybrid", addedSeconds: 107 },
302303
])(
303-
"retains $profile stripe policy while unpinned groups inherit measured base weights",
304+
"lets committed $profile measurements outrank pinned hints while unmeasured groups keep them",
304305
({ profile, addedSeconds }) => {
305306
const timings = vi.spyOn(testTimings, "readCompactGroupTimings").mockReturnValue({});
306307
const options = {
@@ -456,15 +457,13 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
456457
// Spawn/signal-timing suites never mix with regular groups, and every
457458
// compact bin runs serially: overlapping Vitest runs flake timing-
458459
// sensitive tests on both runner classes.
459-
const exclusiveGroupRe =
460-
/^core-tooling(?:-\d+(?:-hosted-\d+)?|-isolated)$|^core-runtime-tui-pty$/u;
461460
for (const shard of [
462461
...pullRequestCompact,
463462
...githubPullRequestCompact,
464463
...hybridPullRequestCompact,
465464
]) {
466465
const exclusiveCount = shard.groups.filter((group) =>
467-
exclusiveGroupRe.test(group.shard_name),
466+
isExclusiveCompactShardName(group.shard_name),
468467
).length;
469468
if (exclusiveCount > 0) {
470469
expect(exclusiveCount).toBe(shard.groups.length);
@@ -473,14 +472,9 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
473472
}
474473
expect(
475474
pullRequestCompact.filter((shard) =>
476-
shard.groups.some((group) => exclusiveGroupRe.test(group.shard_name)),
475+
shard.groups.some((group) => isExclusiveCompactShardName(group.shard_name)),
477476
).length,
478477
).toBeGreaterThan(0);
479-
expect(
480-
compact.some((shard) =>
481-
shard.groups.some((group) => exclusiveGroupRe.test(group.shard_name)),
482-
),
483-
).toBe(false);
484478
const expectedEmbeddedAgentGroupNames = [
485479
"agentic-agents-embedded-base",
486480
"agentic-agents-embedded-incomplete-turn",
@@ -618,7 +612,7 @@ describe("scripts/lib/ci-node-test-plan.mts", () => {
618612
expect(smallJobs.length).toBeGreaterThan(0);
619613
expect(distJobs).toHaveLength(1);
620614
const regularSmallJobs = smallJobs.filter((shard) =>
621-
shard.groups.every((group) => !exclusiveGroupRe.test(group.shard_name)),
615+
shard.groups.every((group) => !isExclusiveCompactShardName(group.shard_name)),
622616
);
623617
const routed8VcpuCheckNames = [
624618
"checks-node-compact-small-2",

0 commit comments

Comments
 (0)