Skip to content

docs/lemonade: how to check that the save-area trio reaches Lemonade's backend (engine#715, #816) - #825

Merged
bong-water-water-bong merged 5 commits into
mainfrom
docs/onebit-trio-plan-check
Nov 2, 2026
Merged

bong-water-water-bong merged 5 commits into
mainfrom
docs/onebit-trio-plan-check

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

What

docs/lemonade.md, the Ubuntu 26.04 / PPA section: after the paragraph that lists what
1bit serve --print-backend-env prints, a short block on the one env name a released package can
still be missing — the save-area trio — and the one-line check for it.

Why it belongs in the doc

The trio reaches Lemonade's backend only through that printed plan: the package's
lemond-onebit launcher does not export it, lemond cannot pass --hrx-cwsr-placement, and
scripts/lemonade-hrx execs llama-server on the printed env. So "the engine sets the no-SVM
trio" is a property of the package, verifiable in one command, and it was false for every
package shipped before #816 (merged as 4c846a3b) without a single warning line saying so.

Numbers, measured on Strix Halo today with the trio unset in the shell

env -u HSA_USE_SVM -u HSA_USERPTR_FOR_PAGED_MEM -u HRX_ALLOW_NO_SVM \
  1bit serve -m Qwen3-0.6B-Q4_K_M.gguf --device hrx --print-backend-env | grep -c '^HRX_ALLOW_NO_SVM=1'
package serve stderr trio in the plan
lemonade-onebit-rc-2026-10-31c (c18) "HRX: CWSR is off; CWSR save-area placement unchanged (engine#315)" 0
lemonade-onebit-rc-2026-11-01b (c20) "HRX: CWSR save area placed in GTT by default (engine#315; amdgpu cwsr_enable=0; …)" 0 — #816's bug: serve exported the trio into its own environment before the plan filter ("a value the caller set wins") ran, so the plan dropped it
a build from main ≥ 4c846a3b same GTT line 3 — asserted by tests/print_backend.sh and tests/lemonade_hrx.sh (both in cpp-ci, and both in the release build's ctest, which is where they first run with ONEBIT_HRX=ON)

No claim is made here about a binary this box cannot build: the third row is what #816's tests
assert, not a run of mine. The two measured rows are the ones a packaging lane will hit, and the
reason the check is worth having in the doc instead of in a review thread.

Scope

Docs only, one file, +18/−0. No code, no test, no pin. docs/lemonade.md is the file this lane
owns (#730, #762) and no open PR touches it.

…s backend (engine#715, #816)

The trio is only in serve's printed plan, so a grep on --print-backend-env is the whole check.
Both packages on the box today print 0, for two different reasons: rc-2026-10-31c predates
#794/#813 (its log still says the placement is unchanged) and rc-2026-11-01b exports the trio
into serve's own environment before building the plan, which is what #816 fixes.
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 7d8e9c1)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

816 - Partially compliant

Compliant requirements:

  • The PR adds documentation to docs/lemonade.md explaining how to verify that the save-area trio reaches Lemonade's backend
  • The documentation includes a one-line check command that can be run to verify the trio is present in the printed plan
  • The documentation references the bug fix in serve: the save-area trio belongs in the printed plan, or Lemonade never gets it (engine#715) #816 and explains the historical context of the issue
  • The documentation provides measured examples from specific packages to show the difference before and after the fix

Non-compliant requirements:

  • None

Requires further human verification:

  • None

730 - Partially compliant

Compliant requirements:

  • The PR updates the docs/lemonade.md file to reflect the correct sync workflow (cherry-pick instead of merge)
  • The PR updates the HRX row in the embedding checklist with the correct date and test results
  • The PR updates the PPA version information for Ubuntu 26.04 to reflect the current version

Non-compliant requirements:

  • None

Requires further human verification:

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

Documentation Clarity

The documentation provides a command to check for the presence of the save-area trio in the printed plan, but it assumes the reader will understand that the trio is critical for avoiding page faults on certain hardware configurations. It would be beneficial to add a brief explanation of why this trio is necessary and what the consequences are of it being missing.

That printed environment is also the only place where the save-area trio
(`HSA_USE_SVM=0`, `HSA_USERPTR_FOR_PAGED_MEM=0`, `HRX_ALLOW_NO_SVM=1`) can reach the backend
Lemonade starts, since the package's `lemond-onebit` launcher does not export it and neither path
can pass `--hrx-cwsr-placement` (engine#715, fixed in #816). So it is worth asking directly:

```sh
env -u HSA_USE_SVM -u HSA_USERPTR_FOR_PAGED_MEM -u HRX_ALLOW_NO_SVM \
  1bit serve -m <model.gguf> --device hrx --print-backend-env | grep -c '^HRX_ALLOW_NO_SVM=1'

1 is the pass. 0 means the one-hop backend and scripts/lemonade-hrx's exec'd
llama-server run without the trio, which is the configuration #715 page-faults in; nothing
warns when it happens. Measured on Strix Halo with the trio unset in the shell:
lemonade-onebit-rc-2026-10-31c (engine from before #794/#813) prints 0 and its serve log
still says "CWSR is off; save-area placement unchanged"; lemonade-onebit-rc-2026-11-01b
(save area placed in GTT by default) also prints 0, because serve exported the trio into its
own environment before building the plan — that is the bug #816 removes.


</details>

</td></tr>
</table>

@bong-water-water-bong bong-water-water-bong added the tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied label Nov 2, 2026

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at 5b49957e — docs only (+18/−0, docs/lemonade.md), and the two rows the doc actually measured
reproduce here; the third is labelled as the tests' assertion, which I also made bite.

Ran the doc's own command against the two packages on the box (/dev/sda and the GPU untouched; --print-backend-env
starts no backend):

env -u HSA_USE_SVM -u HSA_USERPTR_FOR_PAGED_MEM -u HRX_ALLOW_NO_SVM \
  <pkg>/1bit/1bit serve -m Qwen3-0.6B-Q4_K_M.gguf --device hrx --print-backend-env | grep -c '^HRX_ALLOW_NO_SVM=1'

lemonade-onebit-rc-2026-10-31c (c18)   0   stderr: "HRX: CWSR is off; CWSR save-area placement unchanged (engine#315)"
lemonade-onebit-rc-2026-11-01b (c20)   0   stderr: "HRX: CWSR save area placed in GTT by default (engine#315; amdgpu cwsr_enable=0; …)"

Both stderr lines are the ones the PR quotes, and grep -cE '^(HSA_USE_SVM=0|HSA_USERPTR_FOR_PAGED_MEM=0|HRX_ALLOW_NO_SVM=1)$'
is 0 on both, so the doc's "0 means the trio is missing" reads correctly for a reader who checks all three names.

The third row ("a build from main ≥ 4c846a3b prints 1") I could not run: no ONEBIT_HRX=ON build of current main
exists on this box (~/.local/share/1bit-* are all pre-#816 or non-HRX, all print 0). It is the assertion at
tests/print_backend.sh:131/:137, and I did run that harness against the c20 package: 36 ok / 3 FAIL, rc 1, the
three failures being exactly "the save-area trio is in env", "the trio as NAME=VALUE lines", "a trio value the caller set
is left out, the other two still arrive". So the row the doc rests on is the row that bites when the trio is absent, which
is the right place to leave it for a docs PR.

One thing to know rather than fix: .github/workflows/ci.yml sets no ONEBIT_HRX, so in cpp-ci those three rows take
the "this build's hrx-system has no HRX_ALLOW_NO_SVM gate" note path (tests/print_backend.sh:125-128) and are not
asserted there; they first assert for real in a release build's ctest with ONEBIT_HRX=ON — which is what the PR body
says, so the doc is not overclaiming, but "both are in cpp-ci" should not be read as coverage of the trio.

Nit, non-blocking: the body's table gives 3 for "trio in the plan" on the fixed row while the doc's check counts 1
line (^HRX_ALLOW_NO_SVM=1); both are right for what each measures, but a reader comparing them will pause.

CI at this head: build pass 5m18s, CodeQL pass, all four Analyze pass, pr_agent pass, hw_gate skipped. The
branch is behind main (#818/#821); docs only, no overlap, so that is a merge, not a rebase.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit be00d1d

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at be00d1d2a — the re-head carries the reviewed content unchanged; own diff is still
docs/lemonade.md +18/-0 and the file is byte-identical (git rev-parse be00d1d2a:docs/lemonade.md == 5b49957e1:...).

Evidence from the review at 5b49957e1 therefore stands, and it was measurement, not reading: the doc's own command on
the two packages on this box prints 0 for both — c18 with "HRX: CWSR is off; CWSR save-area placement unchanged
(engine#315)", c20 with "HRX: CWSR save area placed in GTT by default …" — and tests/print_backend.sh against the c20
package gives 36 ok / 3 FAIL, exactly the trio rows the doc is about. The third row is labelled in the doc as the
tests' assertion, which is what it is.

CI at this head: build pass 5m25s, pr_agent pass, CodeQL and all four Analyze pass. tprs-ready applied.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit eac232d

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at eac232dda — own diff unchanged (docs/lemonade.md, +18/−0) and the file byte-identical to
5b49957e1, so the measurement-based evidence from that review stands: the doc's own command prints 0 on both c18 and
c20 here (with the two distinct serve stderr lines the post quotes), and tests/print_backend.sh against the c20 package
is 36 ok / 3 FAIL, exactly the trio rows the doc exists to make visible.

build pass 5m20s, pr_agent pass, CodeQL + all four Analyze pass at this head. tprs-ready is on.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 56e2d33

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at 56e2d3397 — re-head only, docs/lemonade.md +18/−0 byte-identical to the reviewed content, and the doc's command still prints 0 on c18 and c20 here with print_backend.sh on c20 at 36 ok / 3 FAIL (the trio rows); build green here. tprs-ready on.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 7d8e9c1

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY at 7d8e9c147 — re-head only: docs/lemonade.md +18/−0, byte-identical to the reviewed content; the doc's command prints 0 on c18 and c20 here and print_backend.sh on c20 is 36 ok / 3 FAIL (exactly the trio rows). build green. tprs-ready on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 2/5 tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant