docs(paged): verify patch-series mirror invariant

Record the Phase 22 strict git-apply mirror check proving the LocalAI paged patch series reconstructs the canonical llama.cpp fork tree after patch 0055.

Assisted-by: Codex:gpt-5
This commit is contained in:
Ettore Di Giacinto
2026-07-01 03:22:43 +00:00
parent ff3f0620de
commit 6c165747a9
4 changed files with 125 additions and 0 deletions

View File

@@ -1441,3 +1441,29 @@ Decision:
snapshots.
- Do not use stale DGX `~/bench/combined_definitive.sh` without porting it to
`~/llama-phase6-source` and the owner-file lock discipline.
## Phase 22 Patch-Series Mirror Invariant
Phase 22 verified that the LocalAI on-disk paged patch series still reconstructs
the canonical llama.cpp fork tree after patch `0055`.
Method:
- Create a fresh worktree at Makefile pin
`0ed235ea2c17a19fc8238668653946721ed136fd`.
- Apply every `backend/cpp/llama-cpp-localai-paged/patches/paged/0*.patch` with
strict `git apply`, matching the LocalAI build path.
- Stage the result and compare `git write-tree` with the fork branch HEAD tree.
Result:
```text
base=0ed235ea2c17a19fc8238668653946721ed136fd
applied_tree=5bdbf8ea3d750fe6fa1f85175fd6357d36222edb
fork_tree=5bdbf8ea3d750fe6fa1f85175fd6357d36222edb
```
Decision:
- The patch series is drift-free against fork branch `localai-paged` at
`fb9402661 feat(server): trace speculative batch shapes`.

View File

@@ -315,6 +315,12 @@ Use this harness for future current-stack GB10 snapshots. Do not reuse
`~/bench/combined_definitive.sh` unless it is first ported away from stale
`~/llama-paged-dev` paths and old lock assumptions.
Phase 22 re-verified the patch-series mirror invariant after patch `0055`:
applying every LocalAI `patches/paged/0*.patch` with strict `git apply` on top of
Makefile pin `0ed235ea2c17a19fc8238668653946721ed136fd` produced tree
`5bdbf8ea3d750fe6fa1f85175fd6357d36222edb`, exactly matching fork branch
`localai-paged` HEAD `fb9402661 feat(server): trace speculative batch shapes`.
---
## 5. METHODOLOGY LESSONS (so you do not repeat the mistakes)

View File

@@ -55,6 +55,21 @@ for p in $(PAGED_PATCHES_DIR)/0*.patch; do git apply --verbose "$p" || exit 1; d
All variants (avx/avx2/avx512/cuda/…) clone + apply into their own build copy, so the series ships
everywhere without ever touching the stock `llama-cpp` source tree.
## Latest mirror check
Phase 22 re-verified the mirror invariant after adding patch `0055`:
```text
base=0ed235ea2c17a19fc8238668653946721ed136fd
applied_tree=5bdbf8ea3d750fe6fa1f85175fd6357d36222edb
fork_tree=5bdbf8ea3d750fe6fa1f85175fd6357d36222edb
```
The check used a fresh worktree at `LLAMA_VERSION`, applied every
`patches/paged/0*.patch` with strict `git apply`, staged the result, and compared
`git write-tree` to canonical fork branch `localai-paged` at
`fb9402661 feat(server): trace speculative batch shapes`.
## Status
- **0001 vendor manager — DONE.** Applies clean to the pin; builds into `libllama`.

View File

@@ -0,0 +1,78 @@
# Patch Series Mirror Invariant Phase 22 Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use
> superpowers:verification-before-completion before recording the phase result.
> Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** prove the LocalAI `patches/paged/` series still reconstructs the
canonical llama.cpp fork tree after adding patch `0055`.
**Architecture:** use the same strict `git apply` method as the LocalAI
Makefile. Apply every on-disk paged patch to a fresh worktree at
`LLAMA_VERSION`, then compare the resulting tree hash with the fork branch HEAD.
**Tech Stack:** Git worktrees, `git apply`, LocalAI paged patch stack,
llama.cpp fork branch `localai-paged`.
---
## Task 1: Apply Patch Series
- [x] **Step 1: Read the pinned base**
Source:
- `backend/cpp/llama-cpp-localai-paged/Makefile`
Result:
- `LLAMA_VERSION=0ed235ea2c17a19fc8238668653946721ed136fd`
- [x] **Step 2: Apply all patches with strict `git apply`**
Command shape:
```bash
git -C /home/mudler/_git/llama.cpp worktree add --detach \
/tmp/llama-paged-series-applycheck \
0ed235ea2c17a19fc8238668653946721ed136fd
for p in backend/cpp/llama-cpp-localai-paged/patches/paged/0*.patch; do
git -C /tmp/llama-paged-series-applycheck apply --verbose "$PWD/$p"
done
```
Result:
- every patch applied successfully with `git apply`.
## Task 2: Compare Tree Hash
- [x] **Step 1: Compare applied tree to fork HEAD**
Result:
```text
base=0ed235ea2c17a19fc8238668653946721ed136fd
applied_tree=5bdbf8ea3d750fe6fa1f85175fd6357d36222edb
fork_tree=5bdbf8ea3d750fe6fa1f85175fd6357d36222edb
```
Canonical fork:
- `/home/mudler/_git/llama.cpp`
- branch `localai-paged`
- HEAD `fb9402661 feat(server): trace speculative batch shapes`
## Decision
- [x] **Step 1: Mark mirror invariant green**
The LocalAI `patches/paged/` series is a byte-for-byte source mirror of the
canonical fork branch at `fb9402661`.
## Self-Review
- No source or benchmark behavior changed.
- The check used the Makefile's strict `git apply` method, not `git am`.
- The temporary worktree was removed after verification.