Skip to content

bump-ds4: merge upstream into 1bit/main instead of rebasing - #435

Merged
bong-water-water-bong merged 1 commit into
mainfrom
1bit/bump-ds4-merge
Oct 16, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
1bit/bump-ds4-merge

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

tools/check_pins.py accepts a submodule pin only when the new commit contains the old one, and a rebase rewrites the commits we carry, so every PR bump-ds4.yml opened pinned a rewritten commit and failed the Submodule pins only move forward step.

#429 is exactly that: a7f2e1eaf36c -> 5b013dc1bb75 reads as diverged (merge base 0aaea5a238fb, ahead 10, behind 1), which is why it needs the pin rollback label. The Lemonade fork passes the same step because sync-lemonade-fork.yml merges an upstream release into the fork instead of rebasing.

This changes bump-ds4.yml to do the same: merge upstream into 1bit/main and push the merge commit, which keeps the old pin an ancestor of the new one.

  • git clone the fork (--filter=blob:none, like the Lemonade sync), git switch 1bit/main, and keep the guard that 1bit/main is the engine's pin (... is not the engine's pin ...; reconcile them by hand).
  • git merge --no-commit --no-ff <upstream>. A conflict stops the run with the conflicting files in the error, aborts the merge and pushes nothing; no auto-resolution.
  • Before pushing, the merged tree must still carry ds4_onebp.inc, docs/1BP.md and gguf-tools/*1bp*, and ds4.c must still include ds4_onebp.inc (the same kind of post-merge check sync-lemonade-fork.yml does for the onebit backend). The merge must also contain the old pin (git merge-base --is-ancestor), the property the engine's own check enforces.
  • Plain git push of the merge commit to 1bit/main; no --force-with-lease, no rewritten pin. The old tip is still tagged ds4-main-<sha12>.
  • The generated bump PR now lists "our commits still on 1bit/main" with git log --no-merges.
  • tools/check_pins.py and its pin rollback bypass are untouched.

docs/dwarfstar.md and .gitmodules now say merge, not rebase.

#429 still needs its one-time fix by hand (the owner is doing it): the fork's 1bit/main has to be moved to 5b013dc1bb75, and #429 merged with the pin rollback label. After that, 1bit/main is the pin, the next upstream move goes through the merge path above, and no further label is needed. Until then the pin (a7f2e1eaf36c, and 1bit/main) still conflicts on Makefile in this path too, so the run stops for a hand merge exactly like the rebase did - the difference is that what comes out of a hand merge is a pin that contains the old one.

Validation:

$ actionlint .github/workflows/bump-ds4.yml          # no output, rc=0
$ python3 -c "import yaml; yaml.safe_load(open('.github/workflows/bump-ds4.yml'))"   # OK
$ python3 tools/copyright.py --check                                                # OK
$ python3 tests/check_pins_test.py                                                  # 3 tests, OK

Dry run of the fork step against a scratch clone of 1bit-MONSTER/ds4 (all pushes stubbed, no writes to the fork): the step's shell was extracted from the workflow and run with only gh api merge-upstream and the two git push lines stubbed.

  • clean: 1bit/main 5b013dc1bb75, upstream = a commit on top of fc80bd69 -> merge commit whose parents are 5b013dc and the upstream tip, git merge-base --is-ancestor 5b013dc HEAD OK, patches lists 1BP v5 packages only, rc=0.
  • conflict: upstream changes the ds4.o prerequisite line -> ::error::antirez/ds4 <sha> does not merge cleanly into 1bit/main (Makefile); merge it by hand, rc=1, merge aborted, no outputs, nothing pushed.
  • conflict, the real backlog: 1bit/main a7f2e1e, upstream fc80bd69 -> same error with (Makefile).
  • carried files: with ds4_onebp.inc removed after the merge, or its include stripped from ds4.c -> ::error::ds4_onebp.inc is gone after the merge / ::error::ds4.c no longer includes ds4_onebp.inc, rc=1.
  • pin guard kept: 1bit/main 5b013dc with the engine pin at a7f2e1e -> the existing "not the engine's pin" error, rc=1.
  • step 1 (unchanged) against the real API: pin 5b013dc1bb75 -> changed=false (no-op) while upstream main is fc80bd69; pin a7f2e1eaf36c -> changed=true.

Not run: a live scheduled run of the workflow, and the Strix Halo checks the generated bump PR asks for (GitHub's runners have no GPU).

🤖 Generated with Claude Code

tools/check_pins.py accepts a submodule pin only when the new commit contains the old
one, and a rebase rewrites the commits we carry, so every PR this workflow opened pinned
a rewritten commit and failed the "Submodule pins only move forward" step: #429 pins
5b013dc1bb75, which compare() reads as "diverged" (merge base 0aaea5a238fb), and needs
the "pin rollback" label. The Lemonade fork passes the same step because
sync-lemonade-fork.yml merges an upstream release into the fork instead of rebasing.

- Merge upstream into 1bit/main and push the merge commit, so the old tip stays an
  ancestor of the new one: the pin check is satisfied and no pin is rewritten. The push
  is a fast-forward, no force-with-lease.
- Keep the guards: 1bit/main must be the engine's pin; the merged tree must still carry
  ds4_onebp.inc, docs/1BP.md, gguf-tools/*1bp* and the ds4.c include of ds4_onebp.inc;
  and the merge must contain the old pin (git merge-base --is-ancestor, the property the
  engine's check enforces) before anything is pushed.
- A conflict stops the run with the conflicting files in the error, aborts the merge and
  pushes nothing. No auto-resolution.
- tools/check_pins.py is untouched, and so is the "pin rollback" bypass.

docs/dwarfstar.md and .gitmodules describe the merge.

Co-authored-by: agent <agent@local>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

429 - Partially compliant

Compliant requirements:

  • Move third_party/ds4 from commit a7f2e1eaf36c to 5b013dc1bb75
  • Ensure the new commit contains the old one so tools/check_pins.py passes
  • Tag the old tip as ds4-main-<sha12> to keep pinned commits reachable
  • Open a PR to move the submodule to the new commit
  • Ensure 1BP packages, docs/1BP.md, and gguf-tools/1bp files are preserved after merge
  • Ensure ds4.c still includes ds4_onebp.inc after merge
  • Run tests on Strix Halo to verify correctness

Non-compliant requirements:

  • Rebase our commits onto upstream and force-push (this was changed to merge instead)

Requires further human verification:

  • Verification that the merge correctly preserves all required files and functionality
  • Confirmation that tests on Strix Halo pass as described in the PR description
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Merge Conflict Handling

The workflow now uses git merge --no-commit --no-ff to merge upstream into 1bit/main. If a merge conflict occurs, it aborts the merge and fails the workflow. This is good for preventing auto-resolution, but the error message only lists the conflicting files without providing a clear path for how to resolve them. This could make it harder for a human to resolve conflicts if they occur.

if ! git merge -q --no-commit --no-ff "$UPSTREAM"; then
  conflicts=$(git diff --name-only --diff-filter=U | paste -sd, -)
  git merge --abort
  echo "::error::antirez/ds4 ${UPSTREAM:0:12} does not merge cleanly into 1bit/main (${conflicts}); merge it by hand"
  exit 1
fi
Post-Merge Validation

The workflow validates that required files (ds4_onebp.inc, docs/1BP.md, and gguf-tools/*1bp*) exist after the merge, and that ds4.c still includes ds4_onebp.inc. This is important for ensuring that the 1BP functionality is preserved. However, the validation for gguf-tools/*1bp* uses compgen -G which might not be robust against edge cases or different shell configurations.

for f in ds4_onebp.inc docs/1BP.md; do
  [ -f "$f" ] || { echo "::error::$f is gone after the merge"; git merge --abort; exit 1; }
done
compgen -G 'gguf-tools/*1bp*' > /dev/null || { echo "::error::the 1BP tools are gone after the merge"; git merge --abort; exit 1; }
grep -q 'ds4_onebp.inc' ds4.c || { echo "::error::ds4.c no longer includes ds4_onebp.inc"; git merge --abort; exit 1; }

@bong-water-water-bong
bong-water-water-bong merged commit e70c9fd into main Oct 16, 2026
8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/bump-ds4-merge branch October 16, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant