Skip to content

sync-lemonade-fork: follow Lemonade releases, not main - #303

Merged
bong-water-water-bong merged 3 commits into
mainfrom
1bit/lemonade-follow-releases
Oct 6, 2026
Merged

bong-water-water-bong merged 3 commits into
mainfrom
1bit/lemonade-follow-releases

Conversation

@bong-water-water-bong

@bong-water-water-bong bong-water-water-bong commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

What

The daily Lemonade fork sync, fixed twice over.

1. It follows Lemonade releases, not main — the sync now merges upstream's latest release tag (never a pre-release, never main), so each weekly engine release builds on that week's Lemonade release.

2. It no longer needs the token's Workflows permission. The sync never needed upstream's workflow files — it disables every workflow in the fork immediately after the merge, so mirroring them buys nothing. But GitHub refuses a push that creates or updates .github/workflows unless the token carries the workflow scope, and that refusal is why every sync from 2026-09-26 to 2026-10-05 failed, stalling the fork at upstream 6deeb05.

Both paths now keep the fork's own .github:

  • clean merge — merge --no-commit --no-ff, restore the fork's .github over the result, commit
  • conflict hand-off — the sync/<tag> branch is built from upstream's release with the fork's .github kept

So HRX_BUMP_TOKEN needs Contents, Pull requests and Actions read/write only — no Workflows permission, no workflow scope, no token change required from the owner. The workflow header now says so.

Verified

  • Scratch-repo simulation of both paths (fork with a local commit + its own workflow; upstream adding a new workflow, changing an existing one, and changing other files):
    • clean merge → .github is the fork's only, 0 upstream workflow files leaked, upstream's code still merged, onebit preserved, and a real merge commit (2 parents) is produced
    • conflict path → .github is the fork's only, 0 leaked, fork-only workflow kept
  • yaml.safe_load parses the workflow; all 4 run: blocks pass bash -n.
  • The existing selftest dispatch input proves the token's write access (branch push, PR open/close, workflow disable) and leaves the fork unchanged — that is the right way to confirm after this lands.

Open question for the maintainer — RFC?

CONTRIBUTING.md asks for an accepted RFC for "anything touching security: authentication, network exposure, secrets, workflows' permissions." This change touches a workflow's permission requirement, but it removes a privilege rather than grants one, and it is fixing a job that has failed daily for ten days. I read that as a bug fix, which the same section says a PR is enough for. Flagging it so you can decide — if you want an RFC, say so and I will open one.

Notes

  • No-op until upstream ships the next release: gh release view resolves v2026.40.0 (29b21e7), which the fork already contains.
  • Held: the release is on hold indefinitely; nothing merges until you call it.

@context7

context7 Bot commented Oct 3, 2026

Copy link
Copy Markdown

Docs7 for 1bit-monster/engine

Result Status Action
Deployment ➖ Not used —
Content review ➖ Did not run. This site has no agent runs available this month. Wait for the monthly reset or check your Docs7 plan. —

Commit 5d70a66

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit a3e7102)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Workflow Sync Logic

The workflow now fetches the latest release tag instead of main, which is a correct change for following releases. However, the logic for handling conflicts and creating the sync/<tag> branch could be improved to ensure that the fork's .github directory is consistently preserved in all cases, especially when the merge aborts and a new branch is created.

  branch="sync/${tag}"
  if git ls-remote --exit-code origin "refs/heads/$branch" > /dev/null; then
    echo "$branch already exists"; exit 0
  fi
  # Same reason as above: hand the release over on a branch that carries the
  # fork's .github, so the push needs contents write only.
  git checkout -q -b "$branch" "$up"
  keep_fork_github
  git commit -q -m "Sync upstream ${UPSTREAM} ${tag} (conflicts; the fork's .github is kept)"
  git push -q origin "${branch}:refs/heads/${branch}"
  gh pr create --repo "$FORK" --base main --head "$branch" \
    --title "Sync upstream ${UPSTREAM} ${tag} (conflicts)" \
    --body "Upstream release ${tag} (\`${up:0:12}\`) does not merge cleanly into the fork. Conflicting files:

${conflicts}

Resolve so that the onebit backend stays registered, then merge."
Workflow Cleanup

The workflow cleanup step now includes idempotent handling for workflows that are already disabled or managed by GitHub. This is a good improvement to prevent failures during sync, but it's important to verify that this logic doesn't inadvertently leave workflows in an inconsistent state if the API behavior changes.

# Idempotent on purpose. A workflow that is already disabled, or that GitHub manages
# (dynamic workflows), answers HTTP 422 to a disable request. Under `set -e` that aborted
# the whole sync job -- and because the self-test just re-enabled and re-disabled a
# workflow, the very next run saw it still listed as active and died here. Report and
# continue; never fail the sync over a cleanup step.
skipped=0
for id in $(gh api "repos/${FORK}/actions/workflows" --paginate --jq '.workflows[] | select(.state=="active") | .id'); do
  if gh api -X PUT "repos/${FORK}/actions/workflows/${id}/disable" > /dev/null 2>&1; then
    echo "disabled workflow ${id}"
  else
    echo "workflow ${id} left as-is (already disabled, or GitHub-managed)"
    skipped=$((skipped+1))
  fi
done
echo "workflow cleanup complete; ${skipped} left as-is"

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 2395714

@bong-water-water-bong
bong-water-water-bong force-pushed the 1bit/lemonade-follow-releases branch from 2395714 to ac42b4b Compare October 5, 2026 21:27
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit ac42b4b

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The HRX_BUMP_TOKEN question is settled, and this PR's cleanup step had a real bug

I dispatched this workflow's own selftest input (run 37376579837) — the verification that was previously starved at steps=0. It answers the token question outright:

PASS pull requests: opened and closed 1bit-MONSTER/lemonade#13
PASS contents:      deleted sync-selftest/37376579837
PASS actions:       enabled and disabled workflow 365581765
SELFTEST PASSED: the token can do everything the sync needs

HRX_BUMP_TOKEN already has the workflow scope. The PASS actions line is the direct proof — it enabled and disabled a workflow. So no token scope change was ever required, and the .github-preservation this PR adds is belt-and-braces rather than load-bearing. That is the item the plan called an owner action, and it needs nothing from anyone.

But the same run exposed a second bug, in this PR

The run then failed at Keep the fork's workflows disabled:

set -euo pipefail
for id in $(gh api "repos/${FORK}/actions/workflows" --paginate --jq '.workflows[] | select(.state=="active") | .id'); do
  gh api -X PUT "repos/${FORK}/actions/workflows/${id}/disable" > /dev/null
done
...
gh: Unable to disable this workflow. (HTTP 422)
##[error]Process completed with exit code 1.

A workflow that is already disabled — or that GitHub manages — answers HTTP 422 to a disable request. Under set -euo pipefail that single 422 aborts the entire sync job, so a cleanup step was failing the whole run.

Worse, it fires reliably right after a self-test: the self-test re-enables and re-disables a workflow, and the next run still sees it listed as active, so the disable 422s. Every workflow on the fork is disabled_manually right now, which is consistent with exactly that race.

Fixed in f2bb215: the disable is now attempted per workflow, a skip is reported rather than fatal, and the count of skipped workflows is printed. Cleanup should never fail a sync.

I have not re-dispatched to verify, deliberately: the self-test opens and closes a PR on the fork, and the non-selftest path would push to it. The guard is a plain conditional and its failure mode is fully diagnosed from this log, so I would rather state that plainly than claim a verification I did not run. The next natural sync exercises it.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit f2bb215

bong-water-water-bong and others added 3 commits October 5, 2026 18:45
The fork now merges upstream's latest release tag (never a pre-release),
so each weekly engine release carries that week's Lemonade release.
The header names the Workflows permission the token lacks: every daily
sync since 2026-09-26 was refused for touching upstream's workflows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… workflow scope

The daily sync never needed upstream's workflow files: the fork disables every
workflow it has right after the merge, so mirroring them buys nothing — and
GitHub refuses a push that creates or updates .github/workflows unless the token
carries the `workflow` scope. That refusal is why every sync from 2026-09-26 to
2026-10-05 failed, and it is what stalled the fork at upstream 6deeb05.

Both paths now put the fork's own .github back over the merge result: the clean
merge (merge --no-commit, restore .github, commit) and the conflict hand-off (the
sync/<tag> branch is built from upstream's release with the fork's .github kept).
A scratch-repo check confirmed each path keeps the fork's workflows, drops
upstream's new ones, merges upstream's code, and still produces a real merge commit.

HRX_BUMP_TOKEN therefore needs Contents, Pull requests and Actions read/write only —
no Workflows permission (classic token: no `workflow` scope).
The step ran under `set -euo pipefail` and treated a failed disable as fatal.
A workflow that is already disabled, or that GitHub manages (dynamic
workflows), answers HTTP 422 -- so the step aborted the entire sync job.
It fired on every run immediately after the self-test, because the self-test
re-enables and re-disables a workflow and the next run still saw it listed
active. Report the skip and continue instead of failing the sync over cleanup.

Evidence: run 37376579837 -- SELFTEST PASSED, then
"gh: Unable to disable this workflow. (HTTP 422)" and exit code 1.
@bong-water-water-bong
bong-water-water-bong force-pushed the 1bit/lemonade-follow-releases branch from f2bb215 to a3e7102 Compare October 5, 2026 21:45
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit a3e7102

@bong-water-water-bong
bong-water-water-bong merged commit 1f87079 into main Oct 6, 2026
7 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/lemonade-follow-releases branch October 6, 2026 03:42
bong-water-water-bong added a commit that referenced this pull request Nov 11, 2026
…ng on HRX, so the loader no longer holds a second copy in GTT (fixes #856) (#2147)

* bump llama.cpp to 209091986: the model weights stay in the file mapping on HRX, so the loader no longer holds a second copy in GTT (fixes #856)

Pin 1703bfeaa -> 209091986: llama.cpp #303 (engine #1962) and #304 (engine #856). #304 keeps the model in the loader's file mapping on HRX: an HRX0_Mapped host buffer with no device allocation, from which HRX makes its device copies. Qwen3-4B Q4_K_M peak GTT 5,665.3 -> 3,225.3 MiB on a short prompt; text identical; KLD 0; steady-state speed unchanged.

What remains after a long prompt (prefill reads q4_k/q6_k in the stored layout, so HRX keeps a device copy in each layout: 6,311.8 -> 6,055.8 MiB) is documented in docs/hrx.md and tracked in #2137.

tools/hrx_gtt_split.py counts an HRX0_Mapped buffer as host memory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs/hrx.md: the device-copy count rises while GTT falls under #304, so the opt-out is not the smaller footprint (review on llama.cpp#304)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* bump llama.cpp to 204493d40: #304 as merged

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
bong-water-water-bong added a commit that referenced this pull request Nov 11, 2026
…en (engine #1962) (#2157)

The f16-range section still listed the draft head's logits step as open. It has
been on main since the pin moved to 204493d40 (llama.cpp #303, engine #2147).
The paragraph now says what the two faults were, what was measured, and where
the unmeasured remainder is tracked (#2127, #2150).

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Fable 5.2 <[email protected]>
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