From 1d418beabf7fb052c1542c341b96bf55428cc97b Mon Sep 17 00:00:00 2001 From: ci-check Date: Sat, 24 Oct 2026 16:32:30 +0800 Subject: [PATCH 1/2] test: #4489 drive the WAL custom-cap assertion by convergence, not a fixed ingest count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The #3250 custom-cap case asserted the WAL sat under cap + one page after a fixed number of ingests. The residue above the cap depends on where the 1000-page autocheckpoint window closes relative to commit boundaries, which varies with the runner's bundled SQLite build — byte-identical red on some shards (left 1095952 bytes, cap 1048576), green on others, same sha (master run 40068050438; PR #4485 run 40069753327). Assert convergence instead: keep committing 128 KiB units until a completed checkpoint (autocheckpoint or cadence-tick PASSIVE) brings the file back to the configured cap, bounded at CONV_UNITS = 24 (one full cadence period + landing lag + headroom; derivation in the constant's doc). A pre-fix tree (limit never honored) sits at its high-water mark through all units and can never converge, so the RED/GREEN discrimination is unchanged. --- tests/issue3250-wal-checkpoint.test.ts | 57 +++++++++++++++++--------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/tests/issue3250-wal-checkpoint.test.ts b/tests/issue3250-wal-checkpoint.test.ts index 7559fc04cb..d9b0054437 100644 --- a/tests/issue3250-wal-checkpoint.test.ts +++ b/tests/issue3250-wal-checkpoint.test.ts @@ -122,16 +122,17 @@ const WAL_CAP = 8 * MiB; const CHECKPOINT_EVERY_N = 20; /** Truncation lands page-aligned; allow one page of measurement slack. */ const CAP_SLACK = 4 * KiB; -/** - * #4506: the custom-cap case observes the plateau BETWEEN resets — after the - * autocheckpoint truncates to the configured cap, subsequent commits keep - * appending frames until the next reset. #4390's row identity (64-hex column - * + idx_messages_identity entry per row) adds ~+250B of WAL frames per - * message row, so ~192 rows of post-reset writes now overshoot by ~12 pages - * (observed 1095952 vs 1048576). The truncate-at-checkpoint INVARIANT is - * intact; budget the inter-reset accumulation instead of pinning one page. - */ -const CUSTOM_CAP_SLACK = 64 * KiB; +/** #4489: convergence deadline for the custom-cap test, in 128 KiB ingest + * units. This scenario is a lone writer, so EVERY completed checkpoint + * truncates the file back to the configured cap (a 128 KiB unit commits far + * fewer pages than the 1 MiB cap holds on 4 KiB pages, so the post-truncation + * file rests exactly at the cap). Completed checkpoints arrive on two clocks: + * the built-in autocheckpoint (once >1000 pages accumulate since the last one + * — a 128 KiB unit commits ≥ 32 pages, so within ⌈1000/32⌉ = 32 units) and + * the cadence-tick PASSIVE (every CHECKPOINT_EVERY_N = 20 ingests); the + * cadence is the tighter clock, and the truncate observes at most one unit + * late (it lands inside the following commit). 20 + 1 + 3 headroom = 24. */ +const CONV_UNITS = 24; test("#3250: close() converges the WAL so a clean exit leaves nothing to replay", () => { const dir = tmpdir("bili-3250-close-"); @@ -290,17 +291,33 @@ test("#3250: a configured cap flows open() → journal_size_limit (custom limit // A 3 MiB burst overshoots the CUSTOM cap in-flight... ingest(store, "big", 3 * MiB, 120); assert.ok(walSize(dir) > customCap, "the burst must overshoot the custom cap in-flight"); - // ...and once the WAL crosses the autocheckpoint window (1000 pages), the - // writer's own completed checkpoint truncates back to the CONFIGURED cap, - // not the 8 MiB default: with the default the file would sit at the - // ~4.4 MiB high-water mark here, never touching 1 MiB. (A lone writer's - // cadence-tick PASSIVE can backfill without shrinking the file — its own - // tail read-lock blocks the truncate — so the autocheckpoint plateau is - // the observable proof the configured value reached the pragma.) - for (let i = 2; i <= 10; i++) ingest(store, `small${i}`, 128 * KiB, 8); + // ...and any COMPLETED checkpoint thereafter truncates back to the + // CONFIGURED cap, not the 8 MiB default: with the default the file + // would sit at the ~4.4 MiB high-water mark here, never touching 1 MiB. + // A trough resting AT the configured cap is the observable proof the + // value reached the pragma. (In a shared directory a foreign reader can + // pin the snapshot and stall the truncate — #3250's field mode — but + // this scenario is a lone writer, so every checkpoint completes.) + // + // #4489: WHERE the 1000-page autocheckpoint window closes relative to + // commit boundaries depends on the runner's bundled SQLite build (page + // packing differs across versions/OSes), so the residue above the cap + // after a FIXED ingest count is environment-dependent — asserting at a + // fixed point raced the grow/truncate sawtooth (byte-identical red on + // some runners, green on others, same sha). Assert CONVERGENCE instead: + // keep committing 128 KiB units until a completed checkpoint brings the + // file back under the cap; CONV_UNITS bounds how long that can take + // (derived above). A pre-fix tree (limit never honored) stays at its + // high-water mark through all units and can never converge — the + // RED/GREEN discrimination holds. + let converged = false; + for (let i = 2; i <= CONV_UNITS && !converged; i++) { + ingest(store, `conv${i}`, 128 * KiB, 8); + converged = walSize(dir) <= customCap + CAP_SLACK; + } assert.ok( - walSize(dir) <= customCap + CUSTOM_CAP_SLACK, - `WAL must be truncated to the configured cap at the autocheckpoint (left ${walSize(dir)} bytes, cap ${customCap})`, + converged, + `WAL must converge to the configured cap at a completed checkpoint (last ${walSize(dir)} bytes, cap ${customCap}, ${CONV_UNITS} units exhausted)`, ); assert.equal(store.getMessages("big").length, 120, "all burst rows must land"); // A clean exit converges to zero whatever the cap. From dfadc21b339bfa45c6ec03b2f13e723ce6bf0507 Mon Sep 17 00:00:00 2001 From: ci-check Date: Mon, 26 Oct 2026 15:22:50 +0800 Subject: [PATCH 2/2] fix(ci): sync lockfile recorded versions with acp-kernel 0.0.165 (#4599) master window commits 293ae6542/de5e03659 bumped kernel/package.json to 0.0.165 without regenerating the lockfiles; lock-sync re-resolution then rewrites the stale recorded versions (root 0.0.163, kernel 0.0.164) and fails. Pure recorded-version sync via npm install --package-lock-only; no dependency or semantic change. --- kernel/package-lock.json | 4 ++-- package-lock.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/package-lock.json b/kernel/package-lock.json index da011d94e1..4c5e2d79e9 100644 --- a/kernel/package-lock.json +++ b/kernel/package-lock.json @@ -1,12 +1,12 @@ { "name": "acp-kernel", - "version": "0.0.164", + "version": "0.0.165", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "acp-kernel", - "version": "0.0.164", + "version": "0.0.165", "license": "MIT", "devDependencies": { "@types/node": "^22.0.0", diff --git a/package-lock.json b/package-lock.json index 380212c96e..15a6e3f4e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ }, "kernel": { "name": "acp-kernel", - "version": "0.0.163", + "version": "0.0.165", "dev": true, "license": "MIT", "devDependencies": {