| Artifact ID: | 56a83de026a6b0d1a9fc5d5251fc58393c48823922b1f277c778ce034f605b75 |
|---|---|
| Page Name: | Home |
| Date: | 2026-12-02 21:54:16 |
| Original User: | dmestas |
| Mimetype: | text/x-markdown |
lumosql-nf
LumoSQL maintains its changes to SQLite as a recipe of rules, applied by Not-forking to each upstream release. This repository keeps that recipe and its output in ordinary Fossil branches, to test one idea: merge a fork against the ruled upstream, never against raw upstream.
A three-way merge carries edits already made. A rule also applies to upstream text written later. When the merge's base and its incoming side both already have the rules applied, the merge only has to carry the hand edits no rule explains. Not-forking stays the engine that does the work; Fossil stores the result and merges against it.
Branches
| Branch | What it holds |
|---|---|
| trunk | LumoSQL's not-fork.d/sqlite3 recipe (MIT, see LICENCE-LumoSQL-MIT.txt), the scripts in tools/ and their output in results/ |
| vendor | SQLite releases as published, one check-in each, tagged sqlite-X.Y.Z |
| vendor-ruled | The same releases with the recipe applied by not-fork 0.8, tagged ruled-X.Y.Z, nf-upstream (the vendor check-in) and nf-recipe (the trunk check-in) |
| fork, fork-plain | Ruled 3.43.0 plus three demo hand edits. fork merges each later release from vendor-ruled; fork-plain merges it from vendor, the classic vendor-branch way |
| fork-adv, fork-adv-plain | The same pair with three hand edits placed next to lines the recipe changes: beside a renamed comment in src/pager.c, inside a block vdbe-changes.mod adds to src/vdbe.c, and in the source list in main.mk that the rename rules rewrite |
The hand edits are labelled as demo edits. They are not LumoSQL's.
Results
Every merge was compared file by file with the correct tree for that release: the ruled release plus the hand edits. The merge check-in's comment records what was found, and the branch was then set to the correct tree.
| Release | fork | fork-plain | fork-adv | fork-adv-plain |
|---|---|---|---|---|
| 3.45.0 | clean | clean | clean | clean |
| 3.50.0 | 1 conflict (README.md, at a hand edit) | 6 conflicts, src/pager.c silently wrong | clean | 5 conflicts, src/pager.c silently wrong |
| 3.51.0 | clean | 1 conflict (src/pragma.c) | clean | 1 conflict (src/pragma.c) |
| 3.53.2 | clean | clean | clean | clean |
| 3.53.4 | clean | clean | clean | clean |
The classic-merge conflicts map onto the recipe. Makefile.in and main.mk come from the switch at 3.48 between makefile.mod and makefile-autosetup.mod. src/func.c, src/vdbe.c and src/pragma.c are fragment_patch changes. tool/mksqlite3h.tcl is a sed rule.
The silent error is the one that matters. SQLite 3.50.0 added a comment naming wal.c at src/pager.c:1850, which backend-rename.mod:109 rewrites to lumo_wal.c. The classic merge has no edit to carry there, so the file merges cleanly and comes out wrong.
The adversarial edits caused no conflicts. A hand edit beside a rule-touched line conflicts only when upstream changes that same spot, as with any three-way merge.
Tests
All of these are in tools/, and their output is in results/.
verify.sh(reproducibility). For eachvendor-ruledcheck-in, it confirms thatnf-upstreamnames the rightvendorcheck-in, that the vendor tree is exactly SQLite's tagged release, and that rerunningnot-forkwith the recipe as ofnf-recipegives exactly the stored tree. All six releases pass. On an earlier build of this repository it caught three test files the build script had left at their 3.51.0 content: Fossil's mtime check missed a same-size file replaced within the same second. The repository was rebuilt with the script fixed.buildtest.sh(build and test). It builds a check-in with LumoSQL's build variables and runs SQLite'sveryquicksuite. Bothforkandfork-advat 3.53.4 pass: 0 errors in 330,335 tests, the same as pristine 3.53.4. This is the plain SQLite backend, with LumoSQL's optional extensions off.rulecheck.pl(rule liveness). It counts everysedrule's matches in each release, selecting files and applying rules the way Not-forking'sSed.pmdoes. It reports a rule that stops matching as MOVED when an identical rule matched in another file, and as DEAD otherwise.
Findings for the recipe
source_id.mod:7is dead from 3.50.0, and harmless. It patched themksqlite3h.tclcall inMakefile.intwice up to 3.45.0. From 3.48 that call lives inmain.mk, so the rule matches nothing. The argument it added,$(LUMO_SOURCES), is never read bymksqlite3h.tcl, and the backend id still reachesSQLITE_SOURCE_IDthroughBACKEND_ID. The rule can probably go.- Six
backend-rename.modrules forMakefile.inwent quiet at 3.50.0 because the source list moved tomain.mk, where identical rules took over. - Not-forking's
Sed.pmrunss///gwithout counting matches, so neither case produced a warning. - With
reposset to a plain local path inupstream.conf, the secondnot-forkrun fails with "Inconsistent cache". Afile://URL works.
Limits
- One upstream. LumoSQL's LMDB and Berkeley DB backends, and its combinations of versions, are not covered.
- Six releases, and two sets of three hand edits.
vendor-ruledis made by the Perlnot-fork. Nothing here is built into Fossil.
Rebuilding
SQLITE_REPO=sqlite.fossil LUMOSQL=lumosql tools/build.sh base lumosql-nf.fossil
tools/build.sh fork lumosql-nf.fossil fork demo
tools/build.sh fork lumosql-nf.fossil fork-adv adversarial
SQLITE_REPO=sqlite.fossil tools/verify.sh lumosql-nf.fossil
Credits
The recipe and the Not-forking tool are by Dan Shearer and the LumoSQL authors. SQLite is in the public domain.