Skip to content

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

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

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: the core pin to Layr-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.yml renders it on every push to main and 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-page run artifact, and exits with a notice rather than failing.

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. FORKDIFF.md documents the day-to-day (what to do when the gate lists files; how to bump base.hash after a rebase); the README links the page. The script is the same one used across the Layr-Labs MLX forks.

Base

Upstream main at 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/mainchanged files 16 described 16, exit 0.
  • Page rendered locally with go run github.com/protolambda/forkdiff@v0.1.1: all six sections present, nothing unmatched.
  • This PR exercises the CI path itself: the Fork Diff Check job fetches upstream, runs the gate, and renders the page as an artifact.

🤖 Generated with Claude Code

…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>
@ethenotethan
ethenotethan merged commit 0606967 into main Sep 14, 2026
4 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