-
Notifications
You must be signed in to change notification settings - Fork 3
ci: run codegen to a fixed point, with a bound, instead of once #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thedavidmeister
wants to merge
4
commits into
main
Choose a base branch
from
2026-08-16-issue-81
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d053f18
ci: run codegen to a fixed point, with a bound, instead of once
claude 035a13f
test: drop an inert index reset, and name the root in the not-a-repo …
thedavidmeister b5a880e
ci: resolve the loop binary from the action's own checkout, and cover…
thedavidmeister 3dfac9d
test: a pass that only deletes a file is a change
thedavidmeister File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: codegen-fixed-point | ||
| description: >- | ||
| Runs a repo's regeneration pipeline until its working tree stops changing, under a bound, so a generation cycle that never settles reports itself instead of arriving at the currency check wearing the same face as artifacts someone simply forgot to regenerate. Generated Solidity is an input to its own generation — a pointer table is imported by the contract whose codehash that same table records — so one pass applies the generation function rather than reaching its fixed point, and a tree one pass behind, a tree several passes behind, and a pipeline that will never converge are three states a single pass cannot tell apart. The bound is what makes the third reportable at all: an unbounded loop on an oscillating pipeline is a hung job, which is the same non-diagnosis as the single pass, paid for in runner minutes. The tree is observed as a git tree object written through a scratch index, so .gitignore applies for free (out/, cache/ and dependencies/ are rewritten every pass and committed by nobody), untracked output still counts as a change, comparison is by content rather than path, and the repo's own index is left unstaged for whatever currency check follows. A repo already at its fixed point costs exactly one pass — the same pipeline cost it paid with no loop around it. | ||
| inputs: | ||
| run: | ||
| description: >- | ||
| The regeneration pipeline, as a shell script run by bash from the repo root once per pass. Every command it needs must be self-contained, including any `nix develop` wrapping: this runs outside every devshell, which is what lets one pipeline pick a different shell per command. A pass that exits non-zero stops the loop and reports itself rather than burning the bound, because a broken pipeline is not a non-converging one. | ||
| required: true | ||
| max-passes: | ||
| description: >- | ||
| Passes allowed before the repo is declared non-converging. One pass propagates one level of the generated-source dependency chain, so this bounds that nesting depth rather than counting retries; raising it is only ever correct for a repo whose generated sources genuinely nest deeper. Required rather than defaulted on purpose: the caller already publishes a default to ITS callers, and a second default here would be a second number to keep in step with the documentation naming it. | ||
| required: true | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Regenerate committed artifacts to a fixed point | ||
| shell: bash | ||
| env: | ||
| # Via env, not interpolated into the script text: the pipeline is | ||
| # multi-line caller input and pasting it into the shell would make any | ||
| # caller of the reusable workflow an author of this script. | ||
| RAINIX_CODEGEN_RUN: ${{ inputs.run }} | ||
| RAINIX_CODEGEN_MAX_PASSES: ${{ inputs.max-passes }} | ||
| run: | | ||
| set -euo pipefail | ||
| # Single source of truth: the Rust rainix-static binary (its unit tests | ||
| # run inside the nix build). The path: flake ref runs it from this | ||
| # composite's own checkout, so the check version always matches the | ||
| # action version regardless of any RAINIX_SHA the caller pins. That is | ||
| # load-bearing here rather than merely tidy: a `github:…/$RAINIX_SHA` | ||
| # ref would resolve to a flake that predates this subcommand, so the | ||
| # step would fail with "unknown subcommand" from the moment it merged | ||
| # until a follow-up bumped the pin. | ||
| nix run "path:$(cd "$GITHUB_ACTION_PATH/../../.." && pwd)#rainix-static" -- \ | ||
| codegen-fixed-point \ | ||
| --max-passes "$RAINIX_CODEGEN_MAX_PASSES" \ | ||
| --run "$RAINIX_CODEGEN_RUN" |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Correct the
sol-shellstatement../script/build.shruns directly in.github/workflows/rainix-copy-artifacts.yamllines 90-91. It can select its own shell. The phrase “Always runs through rainix'ssol-shell” is incorrect.Proposed documentation fix
📝 Committable suggestion
🤖 Prompt for AI Agents