feat(forkdiff): fork-diff page on GitHub Pages + CI gate that a rebase must update it - #11
Merged
Merged
Conversation
…staying true This repository is a fork of ml-explore/mlx-c carrying the C entry points Layr-Labs' Swift inference stack needs from its forked MLX core. Nothing recorded which upstream commit the fork sits on or what it adds; the answer lived in PR descriptions and a history a rebase rewrites. Adopt protolambda/forkdiff the way op-geth does for go-ethereum: a `fork.yaml` at the root names the upstream base commit and groups every changed file into a described section — core pin, allocator observability and footprint policy, array buffer metadata and constant-cache identity, mutable-input Metal kernels and the 0.32.2 SDPA signature, cross-thread default streams — with CI config globally ignored. `forkdiff-pages.yml` renders it on every push to main and deploys the HTML to GitHub Pages (https://layr-labs.github.io/mlx-c/) once a repo admin has enabled Pages; until then it keeps the page as an artifact and exits with a notice. A fork-diff page is only useful while it is true, so `scripts/ check_forkdiff.py` runs on every PR (`forkdiff-check.yml`) and fails when base.hash is not `merge-base(HEAD, upstream/main)` — which is exactly what a rebase onto newer upstream changes — or when a changed file is not described by any section, or a section names files the fork no longer changes. The same check runs before publishing, so a stale page is never served. Base: upstream main at 2026-04-23 (fba4470, bindings for MLX 0.31.2); the fork diff against it is 10 files plus this tooling. 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: the core pin toLayr-Labs/mlx; allocator observability and footprint policy (mlx_get_num_resources/mlx_get_resource_limit,mlx_get_memory_snapshot,mlx_get_allocation_footprint_policy+ bound helpers); array buffer metadata and the constant-cache identity; mutable-input Metal kernels and the MLX 0.32.2 SDPA signature; cross-thread default streams; fork tooling. CI config is globally ignored..github/workflows/forkdiff-pages.ymlrenders it on every push tomainand deploys to GitHub Pages → https://layr-labs.github.io/mlx-c/.One-time admin step. GitHub Pages must be enabled by a repo admin (Settings → Pages → Source: GitHub Actions); the workflow token cannot do that. Until then the deploy workflow still builds the page, keeps it as the
forkdiff-pagerun artifact, and exits with a notice rather than failing.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.FORKDIFF.mddocuments the day-to-day (what to do when the gate lists files; how to bumpbase.hashafter a rebase); the README links the page. The script is the same one used across the Layr-Labs MLX forks.Base
Upstream
mainat 2026-04-23,fba4470b89073180056c9ea46c443051375f7399("regenerate bindings for MLX 0.31.2"). The fork diff against it is 10 files (+240/−3), all described; with this tooling, 16.Verification
python3 scripts/check_forkdiff.py --upstream-ref upstream/main→changed files 16 described 16, exit 0.go run github.com/protolambda/forkdiff@v0.1.1: all six sections present, nothing unmatched.🤖 Generated with Claude Code