@@ -118,34 +118,8 @@ jobs:
118118 });
119119 }
120120
121- // Helper: check whether an exact cache key exists.
122- const cacheExists = async (key) => {
123- const resp = await github.rest.actions.getActionsCacheList({
124- owner: context.repo.owner,
125- repo: context.repo.repo,
126- key,
127- });
128- return resp.data.actions_caches.some((c) => c.key === key);
129- };
130-
131- // Check cache and dispatch only uncached benchmark worker runs.
132- // Each worker produces both TBB=ON and TBB=OFF results, so we
133- // skip dispatch only when both cache entries are present.
121+ // Dispatch all benchmark worker runs.
134122 for (const spec of specs) {
135- const keyON = `timeSFMBAL-benchmark-v4-${spec.os_name}-${spec.arch}-tbbON-${spec.sha}`;
136- const keyOFF = `timeSFMBAL-benchmark-v4-${spec.os_name}-${spec.arch}-tbbOFF-${spec.sha}`;
137- const [hitON, hitOFF] = await Promise.all([
138- cacheExists(keyON),
139- cacheExists(keyOFF),
140- ]);
141- if (hitON && hitOFF) {
142- core.info(
143- `Cache hit for ${spec.role} ${spec.id} (both TBB variants), skipping dispatch.`
144- );
145- spec.conclusion = "skipped_cached";
146- continue;
147- }
148-
149123 spec.group_token = `${groupId}-${spec.role}-${spec.id}`;
150124 await github.rest.actions.createWorkflowDispatch({
151125 owner: context.repo.owner,
@@ -159,6 +133,7 @@ jobs:
159133 arch: spec.arch,
160134 checkout_ref: spec.checkout_ref,
161135 target_sha: spec.sha,
136+ orchestrator_run_id: String(context.runId),
162137 },
163138 });
164139 }
@@ -282,15 +257,15 @@ jobs:
282257 id : restore_head
283258 uses : actions/cache/restore@v4
284259 with :
285- path : benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.head_sha }}.json
286- key : timeSFMBAL-benchmark-v4-${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.head_sha }}
260+ path : benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.head_sha }}-${{ github.run_id }} .json
261+ key : timeSFMBAL-benchmark-v4-${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.head_sha }}-${{ github.run_id }}
287262
288263 - name : Restore base benchmark cache
289264 id : restore_base
290265 uses : actions/cache/restore@v4
291266 with :
292- path : benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.base_sha }}.json
293- key : timeSFMBAL-benchmark-v4-${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.base_sha }}
267+ path : benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.base_sha }}-${{ github.run_id }} .json
268+ key : timeSFMBAL-benchmark-v4-${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.base_sha }}-${{ github.run_id }}
294269
295270 - name : Stage collected files
296271 shell : bash
@@ -299,13 +274,13 @@ jobs:
299274 mkdir -p artifact
300275 echo "head cache-hit: ${{ steps.restore_head.outputs.cache-hit }}"
301276 echo "base cache-hit: ${{ steps.restore_base.outputs.cache-hit }}"
302- if [[ "${{ steps.restore_head.outputs.cache-hit }}" == "true" ]] && [[ -f "benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.head_sha }}.json" ]]; then
303- cp "benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.head_sha }}.json" "artifact/head-${{ matrix.id }}.json"
277+ if [[ "${{ steps.restore_head.outputs.cache-hit }}" == "true" ]] && [[ -f "benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.head_sha }}-${{ github.run_id }} .json" ]]; then
278+ cp "benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.head_sha }}-${{ github.run_id }} .json" "artifact/head-${{ matrix.id }}.json"
304279 else
305280 : > "artifact/head-miss-${{ matrix.id }}.txt"
306281 fi
307- if [[ "${{ steps.restore_base.outputs.cache-hit }}" == "true" ]] && [[ -f "benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.base_sha }}.json" ]]; then
308- cp "benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.base_sha }}.json" "artifact/base-${{ matrix.id }}.json"
282+ if [[ "${{ steps.restore_base.outputs.cache-hit }}" == "true" ]] && [[ -f "benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.base_sha }}-${{ github.run_id }} .json" ]]; then
283+ cp "benchmark-cache/${{ matrix.os_name }}-${{ matrix.arch }}-tbb${{ matrix.tbb }}-${{ needs.context.outputs.base_sha }}-${{ github.run_id }} .json" "artifact/base-${{ matrix.id }}.json"
309284 else
310285 : > "artifact/base-miss-${{ matrix.id }}.txt"
311286 fi
@@ -379,39 +354,18 @@ jobs:
379354 PY
380355 cat benchmark-comment.md >> "$GITHUB_STEP_SUMMARY"
381356
382- - name : Post or update PR comment
357+ - name : Post PR comment
383358 if : needs.context.outputs.should_comment == 'true'
384359 uses : actions/github-script@v7
385360 with :
386361 script : |
387362 const fs = require("fs");
388- const marker = "<!-- time-sfmbal-benchmark -->";
389363 const body = fs.readFileSync("benchmark-comment.md", "utf8");
390364 const issue_number = Number("${{ needs.context.outputs.pr_number }}");
391365
392- const comments = await github.paginate(github. rest.issues.listComments, {
366+ await github.rest.issues.createComment( {
393367 owner: context.repo.owner,
394368 repo: context.repo.repo,
395369 issue_number,
396- per_page: 100 ,
370+ body ,
397371 });
398-
399- const existing = comments.find(
400- (comment) => comment.user?.type === "Bot" && comment.body?.includes(marker)
401- );
402-
403- if (existing) {
404- await github.rest.issues.updateComment({
405- owner: context.repo.owner,
406- repo: context.repo.repo,
407- comment_id: existing.id,
408- body,
409- });
410- } else {
411- await github.rest.issues.createComment({
412- owner: context.repo.owner,
413- repo: context.repo.repo,
414- issue_number,
415- body,
416- });
417- }
0 commit comments