Skip to content

feat(forkdiff): fork-diff page on GitHub Pages + CI gate that a rebase must update it - #24

Merged
ethenotethan merged 1 commit into
mainfrom
feat/forkdiff
Sep 14, 2026
Merged

feat(forkdiff): fork-diff page on GitHub Pages + CI gate that a rebase must update it#24
ethenotethan merged 1 commit into
mainfrom
feat/forkdiff

Conversation

@ethenotethan

Copy link
Copy Markdown

What

Fork-diff page (op-geth style, via protolambda/forkdiff). fork.yaml at the root names the upstream commit this fork sits on and groups every file the fork changes into a described section:

  • Vendored core: submodule pins repointed at Layr-Labs/mlx / Layr-Labs/mlx-c and bumped through MLX 0.32.0/0.32.2; Package.swift exposing Cmlx as a public product and wiring the JACCL distributed backend; Xcode project + regeneration scripts.
  • C headers mirrored from the pinned forks; regenerated JIT Metal sources (Source/Cmlx/mlx-generated/**, called out honestly as regenerated, not hand-written).
  • Swift runtime surface: memory accounting + AllocationFootprint, process-global default streams (MLX 0.32 thread-local encoder fix), EvalProbe + eval-lock ordering, Gemma 4 expert-QMM diagnostics, quantized constant reuse (ConstantArrayCastCache), mutableInputs on custom Metal kernels, FFT/IO API drift.
  • Tests; fork tooling. .github/** and fork.yaml are globally ignored.

.github/workflows/forkdiff-pages.yml renders it on every push to main and deploys to GitHub Pages → https://layr-labs.github.io/mlx-swift/.

Enforcement gate. scripts/check_forkdiff.py runs on every PR (forkdiff-check.yml) and fails when:

Drift Check
rebase onto newer upstream base.hashgit merge-base HEAD upstream/main, or not an ancestor of upstream main
new fork change nobody described a path in git diff base.hash..HEAD matches no section glob / global ignore
section describing code the fork no longer carries a glob matches nothing

It also renders the page, so a fork.yaml forkdiff rejects can't merge; the deploy workflow runs the same check first, so a stale page is never published. FORKDIFF.md documents the day-to-day and the rebase procedure; the README links the page.

Base

Upstream main at 2026-06-17, e23ae6b2cf96737bbd31a34ed304123162f8c409 (= git merge-base origin/main upstream/main). Fork diff against it: 179 files (173 pre-existing + this PR's 6), all described.

One-time admin step

GitHub Pages must be enabled by a repo admin (Settings → Pages → Source: GitHub Actions); the workflow token can't do it. Until then the deploy workflow builds the page, keeps it as the forkdiff-page artifact, and exits with a notice rather than failing.

Verification

  • python3 scripts/check_forkdiff.py --upstream-ref upstream/mainchanged files 179 described 179, exit 0.
  • go run github.com/protolambda/forkdiff@v0.1.1 renders 2.9 MB with every section present and nothing unmatched.
  • This PR exercises the CI path itself: Fork Diff Check fetches upstream, runs the gate, renders the page as an artifact.
  • The gate script and workflows are shared verbatim with the other Layr-Labs MLX forks (mlx, mlx-c, mlx-swift-lm) and with the harness repo, where the script has a pytest suite including an end-to-end rebase.

🤖 Generated with Claude Code

…staying true

Layr-Labs/mlx-swift is a fork of ml-explore/mlx-swift; nothing recorded
what it changes or which upstream commit it sits on. Adopt
protolambda/forkdiff the way op-geth does: `fork.yaml` names the upstream
base (e23ae6b, 2026-06-17) and groups all 173 changed files into described
sections — submodule pins and package wiring (JACCL, public Cmlx product),
C headers mirrored from the pinned Layr-Labs forks, regenerated JIT Metal
sources, and the hand-written Swift surface (memory accounting and
allocation footprint, process-global default streams, EvalProbe and
eval-lock ordering, Gemma 4 expert-QMM diagnostics, quantized constant
reuse, mutable inputs on custom Metal kernels) plus tests.

`forkdiff-pages.yml` renders and deploys the page to GitHub Pages on every
push to main (skipping the deploy with a notice until an admin enables
Pages). `scripts/check_forkdiff.py` runs on every PR and fails when
base.hash is not merge-base(HEAD, upstream/main) — what a rebase changes —
or when a changed file is undescribed, or a section names files the fork
no longer changes. FORKDIFF.md documents the day-to-day.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ethenotethan
ethenotethan merged commit 42c9613 into main Sep 14, 2026
6 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.

2 participants