feat(forkdiff): fork-diff page on GitHub Pages + CI gate that a rebase must update it - #24
Merged
Conversation
…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>
Gajesh2007
approved these changes
Sep 14, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Fork-diff page (op-geth style, via protolambda/forkdiff).
fork.yamlat the root names the upstream commit this fork sits on and groups every file the fork changes into a described section:Layr-Labs/mlx/Layr-Labs/mlx-cand bumped through MLX 0.32.0/0.32.2;Package.swiftexposingCmlxas a public product and wiring the JACCL distributed backend; Xcode project + regeneration scripts.Source/Cmlx/mlx-generated/**, called out honestly as regenerated, not hand-written).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),mutableInputson custom Metal kernels, FFT/IO API drift..github/**andfork.yamlare globally ignored..github/workflows/forkdiff-pages.ymlrenders it on every push tomainand deploys to GitHub Pages → https://layr-labs.github.io/mlx-swift/.Enforcement gate.
scripts/check_forkdiff.pyruns on every PR (forkdiff-check.yml) and fails when:base.hash≠git merge-base HEAD upstream/main, or not an ancestor of upstreammaingit diff base.hash..HEADmatches no section glob / global ignoreIt also renders the page, so a
fork.yamlforkdiff rejects can't merge; the deploy workflow runs the same check first, so a stale page is never published.FORKDIFF.mddocuments the day-to-day and the rebase procedure; the README links the page.Base
Upstream
mainat 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-pageartifact, and exits with a notice rather than failing.Verification
python3 scripts/check_forkdiff.py --upstream-ref upstream/main→changed files 179 described 179, exit 0.go run github.com/protolambda/forkdiff@v0.1.1renders 2.9 MB with every section present and nothing unmatched.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