Skip to content

ci: docs-only main commits don't block a swap; bench an earlier main run; tests pass on Windows - #1119

Merged
zaneni6 merged 7 commits into
mainfrom
chore/ci-followups
Nov 23, 2026
Merged

zaneni6 merged 7 commits into
mainfrom
chore/ci-followups

Conversation

@zaneni6

@zaneni6 zaneni6 commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three follow-ups found while running the swap flow for real (#1094, #1114).

1. Documentation-only commits on main no longer make a swap stale

devkit_swap.py main_moved (used by fetch and verify) counted any commit on main touching flm-dev-kit/FLM_DLL/, flm-dev-kit/FLM_Xclbin/, src/lib/ or src/xclbins/ since the tested run's base, even one that only changed Markdown. #1103 only edited two .md files under FLM_DLL/, and #1114 had to merge main and re-run full CI before it could swap.

  • A commit now counts only if it changes a file under those paths that is not documentation. Anything under src/lib/ or src/xclbins/ always counts.
  • devkit_swap.py keeps its own copy of changes.py's NON_CODE pattern rather than importing it: devkit_swap.py is swap CI, changes.py is not, so a PR could otherwise widen the docs list to hide source commits on main from verify. A test keeps the two copies identical.
  • The file list per commit is read from trees only (git diff-tree), so verify's blob:none clone still downloads no binary.

2. A devkit-bench.yml dispatch on main can bench an earlier push run

find-build only accepted a Build and Test run of the dispatched commit itself, so on a moving main the window was tiny (a dispatch with the previous push run was refused).

  • Only for a dispatch on refs/heads/main with build-run: the run may also be this repository's Build and Test push run on main whose head is an ancestor of the dispatched commit (same repository and workflow, completed success or failure, with dev-kit builds).
  • Everything about the bench then follows that run's commit: the plan's head_sha, the report, the model selection (catalog, engines.json, kernel_assignment.json read at that commit; the plan fails if they cannot be read), and the engines.json the overlay uses (a new step checks out flm-dev-kit/FLM_DLL at that commit).
  • Other branches, and dispatches without build-run, still need the exact commit.

3. The CI unit tests pass on Windows

Tests only, no production change: an rmtree that clears read-only .git objects (test_devkit_check, also inherited by Catalog), a skip when a symlink cannot be created, as_posix() path comparisons, and explicit UTF-8 in test_devkit_rtp_lock (it failed under a cp1252 locale).

Testing

  • Full suite on Windows: 439 tests OK, 2 skipped (no symlink privilege; they run on Linux CI), with and without UTF-8 mode.
  • New tests: MainMoved (docs-only, code, binaries, .md under src/, merge commits, the error cases), the NON_CODE copy matching changes.py, and find-build / plan for an ancestor push run on main, its refusals (other branch, non-ancestor, pull_request, dispatch, fork, other workflow, cancelled, no dev-kit builds) and the run's maps.
  • devkit_check.py and check_internal_refs.py pass.

🤖 Generated with Claude Code

zaneni6 and others added 6 commits November 23, 2026 09:21
main_moved (fetch and verify) counted every commit on main since a run's
base that touched flm-dev-kit/FLM_DLL/, flm-dev-kit/FLM_Xclbin/, src/lib/ or
src/xclbins/, so a pull request that only edited Markdown under FLM_DLL
forced every open dev-kit pull request to merge main and run CI again
before it could swap.

A commit now counts only when it changes a file there that changes.py's
is_non_code does not call non-code (so the two agree); anything under
src/lib/ and src/xclbins/ always counts. The files are read from the
trees (diff-tree), so verify's blob:none clone still fetches nothing. The
unknown-base and not-an-ancestor errors are unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
A dispatch of devkit-bench.yml with build-run only accepted the Build and
Test run of the dispatched commit itself. main moves often, so naming the
previous push run on main was refused ("run is not this repository's
Build and Test run for this commit").

find-build now takes --ref (github.ref) and, for a dispatch on
refs/heads/main only, also accepts a build-run that is this repository's
Build and Test push run on main whose head is the dispatched commit or an
ancestor of it (git merge-base --is-ancestor in the resolve job's checkout,
which already fetches the full history). The plan, the head-sha output and
so the report name the run's commit, whose packages and dev-kit builds are
benched. Other branches still need the exact commit, a run found without
build-run still must be of the exact commit, and the run must still have
completed with success or failure and hold the dev-kit artifacts.

Co-Authored-By: Claude <noreply@anthropic.com>
The suite runs on Linux in CI; on Windows six tests failed and one more
failed under a non-UTF-8 locale:

- test_devkit_check (Synthetic and its subclass Catalog): tearDown could not
  delete git's read-only object files; use an rmtree that clears the
  read-only bit and retries (onexc on Python 3.12+, onerror before), as
  test_devkit_swap already does.
- test_devkit_xclbin_compare test_unreadable_files_are_rows: skip when a
  symbolic link cannot be created (Windows without the privilege).
- test_devkit_assemble_xclbins test_assemble: compare relative paths as
  POSIX paths.
- test_devkit_rtp_lock: read and write the fixtures and the lock as UTF-8
  (the lock's header has a non-ASCII character; devkit_rtp_lock.py itself
  already uses UTF-8).

Test-only: no production behaviour changes.

Co-Authored-By: Claude <noreply@anthropic.com>
A dispatch on main may bench an earlier push run, but the plan still
selected models from the dispatched commit's catalog and dev-kit maps,
and the bench job overlaid the engines its engines.json names. An engine
or model added or renamed on main in between would ask the overlay for a
library the run never built, or bench a model its packages do not hold.

resolve.py plan now always reads the catalog, engines.json and
kernel_assignment.json of the benched commit (the plan's head_sha) on a
dispatch, and fails rather than fall back to another commit's when it
cannot read them (the resolve checkout has the whole history). The bench
job checks out flm-dev-kit/FLM_DLL at that commit on a dispatch and
passes its engines.json to devkit-overlay-package, which gains an
optional engines input.

Co-Authored-By: Claude <noreply@anthropic.com>
verify runs the pull request's code, and changes.py is not in
SWAP_CI_PATHS (a new model family edits it and comes with its swap). With
main_moved calling changes.is_non_code, a pull request could widen
NON_CODE and make verify ignore source commits on main, accepting a stale
swap. devkit_swap.py, which is in SWAP_CI_PATHS, now holds a copy of the
pattern, and a test pins it equal to changes.py's.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

…artifact

The bench job checked out flm-dev-kit/FLM_DLL at
needs.resolve.outputs.head-sha to read the benched commit's engines.json.
Code scanning flags a checkout of a computed commit followed by cached
steps in a workflow the default branch also runs (schedule) as cache
poisoning: 8 high alerts and 1 medium on this pull request.

resolve already has a full-history checkout: it now reads that
engines.json with git show (data only, after checking the sha and that
the file parses) and uploads it as devkit-bench-engines; the bench job
downloads it. No bench job checks out a computed commit any more.

Co-Authored-By: Claude <noreply@anthropic.com>
@zaneni6
zaneni6 marked this pull request as ready for review November 23, 2026 23:51
@zaneni6
zaneni6 merged commit 6a88a20 into main Nov 23, 2026
84 checks passed
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