Skip to content

Reusable smoke workflow: let a caller choose the runner - #161

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/reusable-smoke-runner-input
Aug 23, 2026
Merged

Reusable smoke workflow: let a caller choose the runner#161
Jammy2211 merged 1 commit into
mainfrom
feature/reusable-smoke-runner-input

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Enables autolens_workspace_test#271 (phase 2 of the jax-compile-stall epic). Ledger: PyAutoMind/draft/bug/ci/jax_vmap_jit_compile_stall.md.

Why

smoke-tests.yml hardcoded python .github/scripts/run_smoke.py. So the only way to run a different workspace script under the same ceremony — chain checkout at the matching branch, python setup, install epilogue, cache dirs, profile validation — was to copy that ceremony into a second workflow.

run_smoke.py's own docstring records what that costs:

This file used to carry a copy, and the copy had already drifted (its load_env_config hardcoded the smoke profile path, so the PR gate was structurally unable to read the release profile — the seed incident's failure mode 4/7). One resolver means the PR gate and the release runner cannot disagree about what a script's environment is.

The same argument applies one level up: one ceremony, so a diagnostic sweep and the PR gate cannot disagree about what environment a script runs in.

What changed

Three optional workflow_call inputs, all defaulting to today's behaviour exactly:

Input Default Effect
runner .github/scripts/run_smoke.py Workspace-relative script to execute
runner-args "" Extra arguments, word-split
script-timeout "" Exported as BUILD_SCRIPT_TIMEOUT, only when non-empty

Every existing caller is byte-identical in behaviour: none of them pass these, so runner resolves to the same path, runner-args expands to nothing, and BUILD_SCRIPT_TIMEOUT stays unset.

That last point is deliberate rather than incidental. Setting BUILD_SCRIPT_TIMEOUT unconditionally would have handed run_smoke.py an empty string to int() on every default run, and would also have stated a process-wide cap where today there is none — which risks overriding a profile's per-script overrides value that build_util.timeout_for is supposed to resolve. Hence the if [ -n "$SCRIPT_TIMEOUT" ] guard.

All three reach the run step through env: rather than ${{ }} interpolation inside run:. Callers will supply them from workflow_dispatch, and splicing dispatch input text straight into a shell body is a script-injection surface.

The caller this unblocks

autolens_workspace_test#271 has to establish whether 21 SLOW-marked JAX entries are genuinely slow or are the #245 XLA compile stall mislabelled. A slow script has a tight timing distribution; a stalling one is bimodal. Telling them apart needs the same script run N times under the real cap — which is a different runner, not a different workflow.

The workspace side is a small retime.yml with workflow_dispatch that uses: this workflow and passes runner: .github/scripts/retime.py. Those PRs follow once this merges; they cannot pass a runner input that does not exist yet, so this one goes first.

Verification

The change is inert on every current caller by construction — the defaults reproduce the previous invocation exactly. YAML parses and the input set is chain, python-versions, runner, runner-args, script-timeout, slack-channel-id. Real exercise comes from the first workspace retime.yml dispatch, and from every existing workspace's next smoke run continuing to behave as before.


Generated by Claude Code

The reusable workflow hardcoded 'python .github/scripts/run_smoke.py', so the
only way to run a different workspace script under the same ceremony was to
copy the ceremony -- chain checkout at the matching branch, python setup,
install epilogue, cache dirs, profile validation -- into a second workflow.
run_smoke.py's own docstring records what that costs: the last duplicated copy
of the env resolver drifted until the PR gate could not read the release
profile.

Three optional inputs, all defaulting to today's behaviour exactly:

- runner: workspace-relative script to execute, default
  .github/scripts/run_smoke.py;
- runner-args: extra arguments, word-split;
- script-timeout: exported as BUILD_SCRIPT_TIMEOUT only when non-empty, so the
  default path still leaves it unset and the runner's own default and any
  profile override apply unchanged.

All three reach the run step through env rather than being interpolated into
the script body, since a caller supplies them from workflow_dispatch.

Prompted by autolens_workspace_test#271, which needs to run a re-timing harness
over the SLOW/NEEDS_FIX JAX entries N times under the real caps.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015qk7hoavMnFyPtW4toYn8K
@Jammy2211
Jammy2211 merged commit 215a342 into main Aug 23, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/reusable-smoke-runner-input branch August 25, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant