ci: 3 workflow を単一 ci.yml に統合、並列化とキャッシュで高速化 - #20
Merged
Conversation
required check を集約 job gate に一本化し、build → test 並列 fan-out の 対称な骨格に揃える。速度の主対策: - C# sample gate: Transpiler を一度だけ build して DLL 直接実行 (dotnet run の MSBuild 評価 ~5s/回を排除)、サンプルを pool で並列化 - web verify: LUB_VERIFY_SHARD で suite を 4 分割し matrix 並列、 A5 の固定 6s sleep を screenshot poll (上限 2 倍維持) に置換 - web golden を verify と並列の独立 job に分離 - cache: ccache (native/emcc)、tcs assets (content key)、haxe5、playwright - changes job: docs のみ → lint だけ、web/haxe-wasm のみ → native skip マージ後に branch protection の required check を gate へ付け替える。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
初回 run の実測反映: - C# pool 一括 6m16s の主因とみられる並列 dotnet build (csproj) の MSBuild/NuGet 取り合いを避け、transpile (pool) → csproj build (直列) → capture (pool) の 3 相に分割。相ごとの所要時間をログに出す - A5 シャードは cs エントリ (~9.5s) と haxe (~7s) の重み付き累積で分割し、 4 → 6 シャードに増やす Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
warm run の実測で capture pool (4 並列) が 234s、旧直列は ~1s/件 (30s 級)。 llvmpipe は 1 プロセスでコア数分の render thread を立てるため、多重化すると 16 thread/4 core のスラッシングで 30 倍級に劣化する。pool 幅 1 で実行する。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
capture 合計 ~250s は lavapipe の実レンダリングで、並列化では縮まない (llvmpipe がプロセスごとにコア数分の render thread を立て CPU 飽和)。 仕事量を減らす: - --skip-golden (CI) は golden cmp を行わず capture は crash smoke なので 240 frame → 30 frame に短縮。golden 比較する pre-push 経路は 240 を維持 - dotnet 相 (Transpiler prebuild / transpile / csproj build) は native binary に依存しないため C build と並行に実行し、capture の前で join - verify シャードを 6 → 8 に増やす Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
standalone シャードの settle 待ちに使っていた waitForPlayerReady は listener を張る前に playerReady が発火済みだと 60s timeout を丸ごと待つ (シャード 8 実測: 起動から最初の A5 まで 95s)。canvas に絵が出るまでの pixel poll (上限 30s) に置き換える。verify は 10 分割に増やし、web-build の wasm build (warm 81s) 診断用に ccache 統計を出力する。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
setup-emsdk action は毎 run ランダムな temp パスに展開するため、コンパイラ パスが変わって emcc の ccache が全ミスしていた (実測 hit 0.4%)。~/emsdk に 固定して actions/cache し、CCACHE_COMPILERCHECK=content を併用する。 web チェーンの律速に浮上した web-golden は LUB_GOLDEN_SHARD で 2 分割する。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
連続スライスだと 16_box2d (frame 120) と 18_coin_pusher (frame 240) が 隣接インデックスで同じ側に寄り、shard 間が 96s/149s に偏っていた。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
- golden: round-robin でも 18_coin_pusher と 26_renderer3d が同じ shard に 落ちて 96s/152s に偏っていた。概算コスト表 + greedy で 74/74 に均す - C# transpile は dotnet プロセス起動のレイテンシ支配なので pool 幅を コア数の 2 倍にする Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
C build と並行する区間では CPU が飽和しており、pool 幅を広げても 取り合いになるだけだった (実測 66s → 108s)。既定の nproc に戻す。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v
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.
構成
PR のマージ gate と master deploy を 1 つの
ci.ymlに統合し、全 platform を同じ骨格に揃える:gateのみ。test job の増減やシャード数変更で branch protection を触らずに済む.github/actions/setup-haxe5に一本化速度(通常 PR、warm cache で全体 ~5.5分。従来 ~18-27分)
ボトルネックは workflow 構造ではなくスクリプト内の直列性と無効化されていた cache だった:
dotnet runの MSBuild 評価 ~5秒/回を排し、Transpiler を一度 build して DLL 直接実行(LUB_TCS_DLL)LUB_VERIFY_SHARDで 10 分割(shard 1 = 編集/C# セッション系、2..n = A5 を cs 重み付きで分担)LUB_GOLDEN_SHARDで 2 分割(概算コスト greedy で均す)haxe-wasm / tcs を触る PR は再生成(docker ~8分等)が乗るためこの目標の対象外。
マージ後の作業(人間)
branch protection の required check を旧 3 job(native-gate / build-test / verify)から
gateに付け替える。🤖 Generated with Claude Code
https://claude.ai/code/session_016WGX3e2vn3kWMnPbvTvF5v