Skip to content

Commit d46afa7

Browse files
committed
ci: 分片数跟着工作量走,而不是跟着「是否全量」
linux 分片在 1h30m17s 被取消——正好是 job 上限。没有任何东西坏掉: 一片里排了 grpc-codegen(3563s)与 grpc-module(1701s),装不下。 分片数原本是二元的(全量 linux 3 片,否则 1 片),那等于断言「非全量 就是小活」。并不是:改一个被广泛消费的描述符会选中所有消费者——本次 改 compat.openssl.lua 就选中了四个成员。 tests/member-timings.tsv 早就记着每个成员的实测耗时,plan_shards.lua 也早就按它做 LPT 装箱。所以扇出数就从同一张表来:把本次成员的 linux 耗时求和,每 ~45 分钟一片,上限 3(再多会被 runner 并发与每片固定开销 吃掉,见上方既有测量)。macOS 保持 1 片——它并发就是 1,多分只会串行。 同时把 grpc-codegen 的实测值补进表里(linux 3563 / macos 1715 / windows 31)。新成员此前没有条目,按中位数估算,正是它被低估的原因。 本机核验:四成员求和 5313s → 2 片,LPT 切成 shard 0: grpc-codegen (59min) shard 1: grpc-module asio-ssl openssl (29min)
1 parent 191cc4a commit d46afa7

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

.github/workflows/validate.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,40 @@ jobs:
404404
"$1" "$2" "$3" "$4" "$5" "$6" "$i" "$7"
405405
done
406406
}
407-
if [ "$full" = 1 ]; then ln=3; mn=1; wn=2; else ln=1; mn=1; wn=1; fi
407+
# Shard count follows the WORK, not the full/partial flag.
408+
#
409+
# It used to be binary — full run: linux 3, anything else: linux 1 —
410+
# which reads "a partial run is small". It is not: touching a widely
411+
# consumed descriptor selects every member that consumes it. This
412+
# PR's `pkgs/c/compat.openssl.lua` selected four (grpc-codegen,
413+
# grpc-module, asio-ssl, openssl), one shard got all of them, and
414+
# linux was cancelled at exactly 1h30m — the job cap — with
415+
# grpc-codegen (3563s) and grpc-module (1701s) back to back. Nothing
416+
# was broken; the plan just could not fit.
417+
#
418+
# tests/member-timings.tsv already holds the measured cost of every
419+
# member, and plan_shards.lua already packs by it (LPT). So size the
420+
# fan-out from the same table: sum this run's members and give linux
421+
# a shard per ~45 minutes of work, capped at 3 (above that, runner
422+
# concurrency and the per-shard setup eat the gain — see the
423+
# measurement in the comment above). macOS stays at 1: its
424+
# concurrency is 1, so extra shards there run back to back.
425+
if [ "$full" = 1 ]; then
426+
ln=3; mn=1; wn=2
427+
else
428+
secs=$(lua5.4 -e '
429+
local want = {}
430+
for m in (os.getenv("MEMBERS") or ""):gmatch("%S+") do want[m] = true end
431+
local total = 0
432+
for line in io.lines("tests/member-timings.tsv") do
433+
local p, m, s = line:match("^(%S+)\t(%S+)\t(%d+)$")
434+
if p == "linux" and m and want[m] then total = total + tonumber(s) end
435+
end
436+
print(total)')
437+
ln=$(( secs / 2700 + 1 )); [ "$ln" -gt 3 ] && ln=3
438+
mn=1; wn=1
439+
echo "linux work: ${secs}s (measured) -> $ln shard(s)"
440+
fi
408441
{
409442
printf '{"include":['
410443
emit linux ubuntu-latest linux-x86_64 tar.gz bin/mcpp registry/bin/xlings "$ln"

tests/member-timings.tsv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ linux godot-cpp 573
2828
linux godot-cpp-module 549
2929
linux godot-cpp-module-v10 392
3030
linux godot-cpp-v10 504
31+
linux grpc-codegen 3563
3132
linux grpc-module 1701
3233
linux gui-stack 81
3334
linux imgui 6
@@ -89,6 +90,7 @@ macos godot-cpp 333
8990
macos godot-cpp-module 256
9091
macos godot-cpp-module-v10 215
9192
macos godot-cpp-v10 230
93+
macos grpc-codegen 1715
9294
macos grpc-module 880
9395
macos gui-stack 1
9496
macos imgui 4
@@ -152,6 +154,7 @@ windows godot-cpp 742
152154
windows godot-cpp-module 636
153155
windows godot-cpp-module-v10 684
154156
windows godot-cpp-v10 566
157+
windows grpc-codegen 31
155158
windows grpc-module 1
156159
windows gui-stack 1
157160
windows imgui 6

0 commit comments

Comments
 (0)