Skip to content

ci: gate small Used by rosters and retire the shared-helper debt - #3312

Merged
inureyes merged 2 commits into
lablup:mainfrom
Jaeyeong-CHOI:chore/3220-used-by-debt
Nov 26, 2026
Merged

inureyes merged 2 commits into
lablup:mainfrom
Jaeyeong-CHOI:chore/3220-used-by-debt

Conversation

@Jaeyeong-CHOI

Copy link
Copy Markdown
Contributor

Closes #3220

  1. Add rule-form annotations to the last three grandfathered helpers and empty UNANNOTATED_DEBT. On 251f08610, the new grep commands returned exactly the checker’s 79 caller files for slice_axis, 25 for silu, and 16 for stack_arrays.
  2. Set ENUMERATION_THRESHOLD to zero and repair the small rosters. The baseline report listed 40 omissions across 21 annotations, including Arcee and Nanochat for pipeline_hint. I checked all 601 function/file pairs in the report with git grep. An unnamed third caller of repeat_kv passed against the old checker and fails with this change. Removing the three new annotations also fails.
  3. Name the two utils::gelu_approx callers, src/models/gpt_neox.rs and src/vision/encoders/youtu_vl_merger.rs. The qualified grep returned exactly those paths. The crate root exports the separate FFI function.
  4. Document verify-cuda-runtime-dir and correct the prerequisite count. The Makefile count command in the issue printed 12.
  5. Keep enforcement on top-level public functions in utils.rs and layers.rs. The checker’s function and class definitions match the base. The Rust, workflow and Makefile edits are comments only.

Verification on macOS

make verify-used-by passed all 23 fixture cases. The final line from python3 scripts/ci/check_used_by.py --report | tail -1 was:

used-by: OK, 76 top-level pub fn in 2 shared files, 55 annotated, 601 caller-file references resolved, 2971 Rust files scanned.

cargo fmt --check, CPU-only cargo check (Rust 1.97.1), ShellCheck, Bash and Python syntax checks, and Ruff with the repository’s Python configuration passed. Ruff 0.17.6 with its own defaults still flags the same eight regex flag aliases as on the base. The full Rust suite, GPU execution and hosted CI were not verified.

Both branches start at 251f08610. In a trial merge after #3219, only docs/code-guidelines.md conflicted. Retaining the re-export rule and removing the small-roster exemption gave a passing combined checker and 32 passing fixture cases.

@inureyes inureyes added status:review Under review type:chore Maintenance tasks (build, CI, etc.) priority:low Low priority labels Nov 24, 2026
@inureyes inureyes self-assigned this Nov 24, 2026
@inureyes

Copy link
Copy Markdown
Member

Summary

The PR covers items 1 to 4 of #3220 and leaves item 5 out of scope, as the issue decided. No changes were needed. It is merge-ready as is, except for the expected docs/code-guidelines.md conflict with #3311, which is described below.

Reviewed (PR + issues)

Findings

  • Item 1: slice_axis, silu and stack_arrays carry rule-form annotations with a grep -rln one-liner. UNANNOTATED_DEBT is empty, and rule 1 in the guidelines is updated. On current main the checker re-runs each command and finds that it covers every resolved caller.
  • Item 2: ENUMERATION_THRESHOLD = 0. The --report summary line no longer has a "not gated" clause on the PR head, on main plus this PR, or on main plus both PRs. The new short-roster case fails when one caller of a three-caller helper is unnamed, and passes again once it is named. The former-debt case fails when the three new annotations are removed.
  • Item 3: the gelu_approx annotation names gpt_neox.rs and youtu_vl_merger.rs, and --report on main shows exactly those two callers. The grep is qualified (\butils::gelu_approx().
  • Item 4: CONTRIBUTING.md says twelve and nine and lists verify-cuda-runtime-dir. grep '^verify:' Makefile | tr ' ' '\n' | grep -c '^verify-' prints 12.
  • LOW, cosmetic, not changed: the reflowed comments in ci.yml and Makefile leave one long line inside an otherwise wrapped block.

Fixes

None.

Security review

The .github/workflows/ci.yml change is comment-only: two comment lines in the used-by job, and no non-comment line changed. The workflow still triggers on push to main and pull_request to main, with no pull_request_target and no workflow_run. Top-level permissions: contents: read and the job's contents: read are unchanged. Checkout keeps persist-credentials: false. The job references no secrets and interpolates no PR-controlled ${{ }} expressions.

Performance review

No runtime change. The checker's run time is unchanged at about 3.4 s.

Validation

  • PR head: python3 scripts/ci/check_used_by.py --report | tail -1 prints used-by: OK, 76 top-level pub fn in 2 shared files, 55 annotated, 601 caller-file references resolved, 2971 Rust files scanned. bash scripts/ci/check_used_by_test.sh passes all cases.
  • Main 36129ebb3 merged with this PR alone: the checker is OK with 625 references and 3093 files, and the test script passes.
  • Main with ci: resolve function values and reject opaque Used by re-exports #3311 (plus its hardening commit) squash-merged and then this PR: make verify-used-by passes (35 cases) with no "not gated" clause.
  • The Rust diff is /// doc lines only in utils.rs and layers.rs. cargo check -p mlxcel-core --features cuda --lib --tests passes on the combined tree, and cargo fmt --all -- --check is clean.
  • Merge note: once ci: resolve function values and reject opaque Used by re-exports #3311 is squash-merged, this PR conflicts only in docs/code-guidelines.md ("What it does not catch" list). Keep ci: resolve function values and reject opaque Used by re-exports #3311's re-export bullets, and drop both the "Functions with 12 or fewer callers" bullet and this PR's old "seen at the re-export only" bullet. The other files, including check_used_by.py and check_used_by_test.sh, merge cleanly, and the result passes.

# Conflicts:
#	docs/code-guidelines.md
@inureyes
inureyes merged commit 1c284f1 into lablup:main Nov 26, 2026
33 checks passed
@inureyes inureyes added status:done Completed and removed status:review Under review labels Nov 26, 2026
@inureyes inureyes added this to the 0.9 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:low Low priority status:done Completed type:chore Maintenance tasks (build, CI, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: Pay down Used by annotation debt and start gating small rosters

2 participants