J435: verify fast red on RUSTSEC-2026-0459 (libsqlite3-sys / SQLite) #473
Open
opened 2026-11-09 11:41:19 +00:00 by kayg
·
10 comments
No Branch/Tag specified
main
j470b-server-mesh-rejoin
mesh-compat-382
j444b-d381-key-wins-flood
j461b-macos-utun-reader-thread
j475b-remove-host-motion
fix-reconnect-new-link
j481-d380
dev
j479-mesh-soak
fix/j476-host-facts
j475-motion-pill-split
j470-mac-node-join
root-upgrade-d376
j474-review-merge
latency-targets-120hz
nightly-suite-shards
gotatun-pin-j469
macos-utun-reader-thread
fix-flood-echo-stall
wip/j416
motion-fast-ease-out
mesh-addhost-j259
takeover-close-terminals-d368
kbd-instant-followups
fix-trust-key-double-click
nightly-suite-partial-report
appwin-icons-j207
rusqlite-slice1
swipe-content-first-d374
mesh-mtu-381
addhost-instant-open
glass-contrast-d365-mock
glass-contrast-d365
signout-followups-442
fix-startup-toast-red
research-gotatun-matrix-j317
themes-sync-j304
fix-load-flakes
fix-nix-zig-patch
fix-compute01-browser-baseline
ratchet-size-baseline-419
predict-auto-d130
revoke-coverage-d367
nightly-suite-queue-timeout
nightly-browser-suite
fix-rustsec-2026-0459
fonts-ioskeley-obel
log-retention-d375
fix-kbd-no-anim-427
fix-dev-red-specs-2
takeover-proof-305-j205
wip/j410-server-pump
ui-consistency-d372
fix-osc52-clipboard
libghostty-vt-1.0
forget-retired-host-d369
j404-merge-426
fix-setup-lock-race
fix-touch-select-426
revoke-access-report-ui
fix-predictive-echo-specs
fix-selinux-agent-exec
wip/j395-checkpoint2
wip/j395
j391-review-scratch
ui-consistency-j195-deferred-rebased
fix-rustc-paths-421
decisions-wording-341
fix-install-suite-red
fix-dev-rtt-specs
fix-pending-removal-align
fix-privileged-skip
fix-install-suite-404
review-j368
mesh-dns-j254
revoke-access-report-d356b
revoke-privilege-round5
fix-removal-confirm
review-j360
gotatun-rotation-367
deps-refresh-340
review-j354
review-J351
review-j350
addhost-takeover-d359
revoke-report-items-347
revoke-end-sessions-d362
review-j348
size-mesh-ssh-346
size-trim-337
revoke-access-diff-d356
j259-pre-rebase-b06c5a6
j305-ended-at-start-spec
addhost-sudo-consent
fix-layout-real-specs-411
fix-shell-open-411
fix-console-hosts-373
fix-shell-exit
fuzz-host-name-353
fix-host-details-410
macos-filter-j197
research-gotatun-tricks
revoke-p3-j216l
stale-state-pill
revoke-followups-j216k
revoke-progress-j216e
backup/macos01-20261106/lume/j197
backup/macos01-20261106/lume/appwin-icons-j207-stash0
backup/macos01-20261106/claude/stash-0
backup/macos01-20261106/claude/stash-1
backup/macos01-20261106/claude/J80-macos-s1
backup/macos01-20261106/claude/J80
backup/macos01-20261106/claude/J80-slice1-20261102
backup/macos01-20261106/claude/J16b-appwin-on-dev
backup/macos01-20261106/claude/appwin-launch-idle-146
backup/macos01-20261106/claude/J80-s1-run
wip/j259
trust-285-p3c
runtime-lock-j216f
mesh-ssh-p3-j175
tun-proof-p3b
trust-285-p3
terminal-polish-j271
tun-proof-p3
ssh-install-flakes-j216i
fuzz-fixes-j264
trust-285-a
trust-285-b
restart-oversized-fixture-j198
backup/macos01-20261106/lume/appwin-icons-j207
restart-bound-j216h
up-preflight-p3-j198
backup/macos01-20261106/lume/j251
up-preflight-j198
wip/up-preflight-j198-j245-p2
wip/up-preflight-j198-j245-p1
agent-fsync-offloop-j196
wip/up-preflight-j198-j245
settings-offscreen-j231
wip/up-preflight-j198-j226-inspection
wip/j103f
themes-j206
wip/up-preflight-j198-j226
flakes-j216c
backup/macos01-20261106/claude/j197
flakes-j216b
backup/macos01-20261106/claude/j197-red
wip/up-preflight-j198-review
flakes-j216
backup/macos01-20261106/claude/appwin-icons-j207
engineering-j208b
appwin-mock-j209
toast-stack-j165
engineering-j208
decisions-d351
decisions-d350
decisions-d349
appearance-presets-mock-j129
decisions-d348
docs-audit-spec
doc-coverage-baseline-raise
decisions-d347
decisions-d346b
decisions-d346
j88h-profile
ui-consistency-j195-deferred
ui-consistency-j195
engineering-practices-j194
preferred-login-ui-j166
signin-pools-263-j174
macos-node-265-s1
decisions-d345
decisions-d344
proxy-cgroup-j164
verify-quick-fuzz-329
proxy-start-io-j168
timing-flakes-j163
up-263-s1
mcp-events-j147
verify-quick-fuzz-j158
proxy-p3-j159
agent-resource-j157-detect
wip/j103d-final
remote-cancel-hang-j155
proxy-traefik-281-j62d
j149-verify-quick
proxy-traefik-281-j62b
j150-drop-unnamed
wip/j79d-red-r4
wip/j103d-d332
rootless-toast-j142
wip/j103d-head
wip/j103d
j125c-mcp
macos-build-j136
backup/macos01-20261106/claude/j136
wip/j79d-red-cli
wip/j79d-red-server
j121-link-liveness
j118c-tracer-failures
wip/j79c-head
release-desktop-j131
j124c-signed-macos
wip/j79c-red-p3
wip/j79c-red-p23
wip/j79c-red-p22
merge-j128-check
perf-deferred-j128
sidebar-toggle-260
j127-shortcut-changed-dot
j125-mcp
j118-tracer-failures
j126-account-summary
settings-sections-mock-j92
j120-pinch-lock
sidebar-292
backup/macos01-20261106/claude/j120
taste-2026-11-03
row-actions-242-215
backup/macos01-20261106/claude/stash-0-untracked
backup/macos01-20261106/claude/J80-265-s1-run
backup/macos01-20261106/claude/J80-macos-s1-20261102
j112-canvas-commands
ui-no-overshoot-scroll
fix-recovery-restart
backup/macos01-20261106/claude/stash-1-untracked
taste-2026-11-02
size-baseline-ratchet
machine-cards-structure-j108
j109-boot-copy-mockups
fix-dev-red
wip/up-263-s1
j95b-settings-rows
proxy-traefik-281
j95-option-rows
docs-human-j91
docs-keys-palette
fix-flood-1013-270-j38d
mesh-ssh-s1
mesh-ssh-s0
addhost-d291-tunnel
test-stability-load
mesh-relay-220
repro-296
shim-thp-off-24
mesh-pins-258-v2
mesh-dns
signin-d311-merged
docs-pages
ui-size-283
fix-ui-batch-specs
wip/j12b-edge-update
gate-on-arm
fix-rename-sync-293
trust-285-j60b
fix-focus-ring-clip
integ-ui-1101
edge-update-v2
signin-d311
taste-2026-11-01
layout-per-tab-250
ui-approved-splitopt-224
ui-approved-splitopt-224-on-dev
icon-text-centre-282
ui-approved-189-212-216
research-reverse-proxy
transfer-budget-320
review-mesh-pins-258-r2
sidebar-pill-259
review-mesh-relay-220
wip/j12-edge-update-v2
nix-package
status-crash-loop-237
fix-dev-test-failures
fix-fixture-socket-path
wip/mesh-relay-220-pre-dev-advance-rebase
fix-canvas-side-clip
research-head-to-head
frosted-real-256
review-mesh-pins-258
wip/mesh-relay-220-pre-final-rebase
review-layout-per-tab-250-r2
broad-suite-triage
nix-devshell
review-status-crash-loop-237-r3
wip/nix-devshell-pre-p3
taste-frosted-real
wip/code-serve-demo-2026-10-30
wip/code-serve-glass-2026-10-30
wip/code-serve-clusters-2026-10-30
wip/code-merge-release94-dev-2026-10-30
wip/rproxy-delta-scratch-2026-10-30
wip/stale-note-257-staged-2026-10-30
wip/d241-size-staged-2026-10-30
review-broad-suite-207
wip/mesh-pins-258-pre-split
wip/mesh-relay-220-pre-rebase
mesh-measure-220
plan-211-update
review-edge-autoupdate-r3
perf24-reconnect
review-stale-note-r2
release-prod-live
d241-shell-marker
review-mesh-pins-server-258
review-revocation-r3
review-setup-token-r2
review-sync-journal-r3
wip/review-mesh-pins-258-prune-review-1995fee46
frosted-scroll-256
sync-journal-r3
revocation-per-account-wip
review-tokio-asyncfd-0386
review-sync-p3s
wip/stash-8by64-stash0-2026-10-30
mesh-drag-r2
setup-token-data-wip
release-9-4
auth-busy-1013
mesh-view-overlap
sync-p3s
review-auth-busy-wake
review-readd-r8-wip
mesh-drag-bounds
audit-auth-93
app-windows-stream-start
review-authority-cap-r3
app-windows-r7-measure
readd-minimal-r6
readd-minimal-r5
app-windows-r7-soak
readd-minimal-r4
app-windows-r7
app-windows-r6
readd-minimal-r3
readd-minimal-r2
readd-minimal
merge-release8-dev
review-busy-page-liveness-r2
review-busy-page-liveness
mesh-view-trim
review-authority-read-retry-r2
review-remove-uninstall-r2
release-retry-reattach
release-retry
review-remove-uninstall
review-authority-read-retry
app-windows-ship
mesh-autoswitch-p2
mesh-ssh
mesh-relay
mesh-macos-node
screen-and-control
session-labels
review-real-logins-r5
review-real-logins-r4
review-real-logins-r3
shim-memory-r2
review-real-logins-r2
shim-memory
shadow-addhost-instant
shadow-real-logins
shadow-same-session-flood
shadow-prod-perf-fix
hosts-from-server
app-windows-real
app-windows-transport
release-prod-6w
mesh-policy-verify
quiet-close-toast
dev-merge-r4
review-mesh-agent-transport
review-app-windows-transport
settings-roundtrip
review-release-pipeline-r4
mesh-agent-transport
ended-strip-fix
review-audit-ca-update-d244
settings-rows
phone-width
signout-clear
fix-restart-tests
dev-merge-rp
signer-hardening
review-audit-ca-update
terminal-fidelity
review-audit-ca-update-wip
mesh-integrate
review-mesh-agent-transport-515d3712
review-mesh-dataplane-feec1988
mesh-dataplane
signout
research-canvas-node
wip/review-renderer-cost
wip/review-terminal-fidelity
padlock-glyph
review-release-pipeline-2e95b689
phone-polish
sidebar-polish
inbox-generic
review-mesh-dataplane-378d4055
prod-batch
ui-inbox
ui-ca-unlock
ui-machine-sections
review-mesh-dataplane-a5f744fb
tls-session-prod
session-bounds-prod
fix-dead-session
session-bounds
tls-session
palette-polish
shortcuts-d222
research-appmeta
phone-gutter
ui-centre-button
wip/ui-centre-button
wip/tls-session
review-addhost-breakit
ui-platform
renderer-cost
remote-agents
mesh-api
ssh-bootstrap
prod-hotfix2
prod-fixes
review-remote-agents
review-mesh-dataplane
session-life
research-browser
review-mesh-api
research-capture
review-mesh-api-round3
review-mesh-api-round1
gate-stability
review-gate-stability
review-relay-direct
review-mesh-api-findings
proto-sessions
font-picker
proto-addhost
proto-windows
mesh-core
latency-gate
research-bsd
research-discovery
keytray-mods
mock-core
ui-tweaks
fix-motion-sel
fix-motion
integrate2
fix-robust
t-web
t-server
vt-ghostty
fix-snap-echo
t-web-auth
review-vt2
t-agent
lane-protocol
lane-shim
lane-auth
s1-base
s1-contracts
s1-workspace
No results found.
No labels
launch-qa
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
kayg/infraternal#473
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
scripts/verify fastfails its cargo-deny row on unmodified origin/dev (cedeb4d26) with RUSTSEC-2026-0459 (libsqlite3-sys, CVE-2026-119375). Every branch's gate is red on this row.Advisory. SQLite before 3.54.0 can return uninitialized page-cache memory when a process opens a database together with a sibling
-walfile whose page size differs from the database's. Local vector, needs the victim to open attacker-written files. Patched:libsqlite3-sys >= 0.39.0(SQLite 3.54.x, shipped with rusqlite 0.41).Plan (est. 1 h). 1. Exposure analysis. 2. Check whether a patch upgrade exists within sqlx 0.8. 3. If not, a time-limited deny.toml ignore. 4.
verify quick,verify faston compute01. Branchfix-rustsec-2026-0459from origin/devcedeb4d26. Job J435.Finding: no in-line upgrade exists (stop condition hit); interim ignore added.
Branch
fix-rustsec-2026-0459, base origin/devcedeb4d26.Evidence (crates.io API / upstream Cargo.toml, 2026-11-09):
libsqlite3-sys >= 0.39.0(bundles SQLite 3.54.x, from rusqlite 0.41).sqlx-sqliterequireslibsqlite3-sys ^0.30.1(Cargo.lock: 0.30.1).libsqlite3-sys >=0.30.1, <0.38.0. Excludes 0.39, so even a sqlx major bump does not fix it.sqlite=sqlx-sqlite/bundled.Exposure verdict: not exploitable in our use. Needs an attacker-written database plus a mismatched
-walsibling opened by us.open_databaseincrates/infraternal-server/src/runtime.rs:848, path<data>/infraternal.sqlite, directory created and forced private (0700) by the server.crates/infraternal/src/release_cli.rsopens the same file only after checking owner, private mode, regular file, one link.sqlite::memory:(tests/examples).-walthere already controls the server's data folder.Options for the owner (foundational: driver/engine, not decided here):
sqlx::migrate!and the 54 migrations' runner.sqlite-unbundledwith system SQLite >= 3.54 (needs buildtime_bindgen and per-target packaging; hurts the static musl builds).Interim:
deny.tomlignore for RUSTSEC-2026-0459 with reason and expiry 2026-12-09. Cargo.lock unchanged, so Nix vendoring and the migration runner are unchanged (no dependency moved; the 54-migration check is not affected and was not re-run beyond the gate's own tests). Gate runs: compute01 slot queue, log~/.cache/codex-scratch/j435/gate.log.J438 start: measuring sqlx vs rusqlite (measure only, no decision, no product change).
Base: origin/dev
6df0f5bd5(read-only worktree). No product branch; the harness is a scratch crate on compute01 under~/.cache/codex-scratch/j438/(outside the repo).Plan (est. ~4 h):
sqlx::migrate!sites,_sqlx_migrationscompatibility plan. (~30 min)First counts (production code, excluding tests/examples): 61 files; 362
query(, 42query_as(, 184query_scalar(, 57.begin(); 0 compile-time-checked macros (query!/query_as!/query_scalar!).sqlx::migrate!appears in 74 places, almost all in tests.Progress (J435). Branch
fix-rustsec-2026-0459pushed, head5acf28773(one commit, deny.toml only).cargo deny check advisories licenses bans sources→advisories ok, bans ok, licenses ok, sources ok(exit 0).verify quick+verify fastare queued behind 16 jobs in compute01's build-slot queue (started 12:41 CET, position 14 at last report). Log:~/.cache/codex-scratch/j435/gate.logon compute01. I'm polling in the foreground and will post the verbatim gate output when it runs.Close-out (J435). The deny.toml exception merged to dev as
ba79e6746(orchestrator). On the orchestrator's instruction I killed my queuedverify quick/verify fastwaiter (build-slot PID 1978858) before it ran, so noverify quickorverify fastoutput exists from this job. Evidence I do have:cargo deny check advisories licenses bans sourceson the branch →advisories ok, bans ok, licenses ok, sources ok; the orchestrator reports the compile check passed.Branch
fix-rustsec-2026-0459, head5acf28773. Exposure verdict: not exploitable in our use (see the earlier finding). Exception expires 2026-12-09.Open for the owner: the lasting fix is a database-driver decision, since no sqlx release accepts
libsqlite3-sys >= 0.39. J438 is measuring sqlx against rusqlite. VM worktree and scratch removed.J438 progress (no product change).
~/.cache/codex-scratch/j438/on code and on dev-02. It has cratesbench-sqlx(a: pool like today; a2: sqlx with 1 writer + 7 readers),bench-rusqlite(0.41: b spawn_blocking pool; c 1 writer thread + 7 reader threads) andbench-rusqlite-032. The last is the same code on rusqlite 0.32 / SQLite 3.46, the version sqlx bundles, as an engine-version control.6df0f5bd5: session slideauth/sessions.rs:72(a write on every request), host listremote_inventory.rs:170, layout resumecanvas_store.rs:66, layout apply (the 8-statementBEGIN IMMEDIATEtransaction incanvas_store.rs), and a mix of them. The DB has all 54 migrations and D170 rows: 50 users, 8k sessions, 1k hosts + certs, 200 terminals, 100k receipts._sqlx_migrations-compatible runner validated all 54 sqlx-written rows. A fresh DB migrated by it has a schema identical to sqlx's.perf-run.J438: sqlx vs rusqlite, measured on infraternal's own hot queries (measure only, no decision)
I changed no product code and merged nothing. No repository code changed, so the gate does not apply. Scratch:
code:~/.cache/codex-scratch/j438/; raw receipts are attached (j438-results.tar.gz).Short answer to "are sqlx and rusqlite both mature and in rust? what's the difference? which one is better performing and updated often?"
Owner table
The speed row is from the perf VM: median of 5 rotated runs, perf-run cpus 1–3, 0 steal. Spreads are in the detail table below.
main+ SQLite 3.54.1, the "wait for a release" path-j4, 3 runsbegin_withis not cancellation-safe, so we carry a spawn workaround (plugin-api/src/storage.rs). 8 pooled writers contend on SQLite's lock, which causes the busy-sleep tails abovedbmodule. Same tokio, same zig static build (D213). Pool and migration crates still sit on rusqlite 0.40, so we write our own (about 60 lines each, both working in the scratch crate)n.m. = not measured.
Finding that affects every option: SQLite 3.54.1 costs about 30 µs per transaction on this workload
/proc/self/io), so it is CPU inside the engine, not I/O.SQLITE_ENABLE_MEMORY_MANAGEMENT.auth/sessions.rs:72), so it is where the cost shows most. This is an observation for a later perf job, not a proposal.Receipts:
attr.jsonl,attr2.jsonl.2. Method
6df0f5bd5:UPDATE … RETURNING(auth/sessions.rs:72);remote_inventory.rs:170);canvas_store.rs:66);BEGIN IMMEDIATE, with the app writer mutex and the spawned BEGIN/COMMIT exactly as incanvas_store.rs;synchronous=NORMAL, with the same pragmas asopen_database.open_database: 8 connections,test_before_acquire(false). (a2) is sqlx with a 1-writer pool plus a 7-reader pool. It shows that the tail comes from the pool shape, but that the per-statement round trip remains:revisioncolumn instead of parsing it out of the document JSON.Full per-cell table, with min–max spread over the 5 runs:
table.mdin the attachment. A few rows:Syscalls per op:
The extra reads are sqlx's per-statement worker wake-ups.
1. Facts (primary sources, checked 2026-11-09)
Maintenance and security pickup
>=0.30.1, <0.38.0. PR #4502 raising the cap to<0.40merged tomain2026-11-08, unreleasedSources: crates.io versions/dependencies API for each crate; RUSTSEC-2026-0459; sqlite.org/changes;
libsqlite3-sys/sqlite3/sqlite3.hat each rusqlite tag. The repo moved from launchbadge/sqlx to transact-rs/sqlx.Architecture
ConnectionWorker, worker.rs @ v0.8.6) fed by aflumechannel. Every statement is one channel round trip and one wake-up, including each statement inside a transaction. The statement cache holds 100 by default.ConnectionisSend, notSync, and calls are plain synchronous FFI (lib.rs @ v0.41.1). Async callers needspawn_blockingor an owned thread. A whole transaction runs in one closure, so it is one hop.prepare_cachedholds 16 by default and can be set higher.Compile-time checked queries: sqlx has
query!/query_as!, with an offline.sqlxcache and imperfect SQLite nullability inference (e.g. #4322). rusqlite has none. infraternal uses none: 0 macro sites. Every query is the runtimesqlx::query(...)form, so we lose nothing here.Migration runner: sqlx
_sqlx_migrations(version, description, installed_on, success, checksum = SHA-384 of the file, execution_time; migrate.rs). The server doesn't callsqlx::migrate!at runtime.build_support/migrations.rsalready generates the 54-entry table at build time, with original SHA-384 checksums and compacted SQL, andauth/migration_compat.rsdoes the version-20→22 retag. rusqlite_migration 2.6.0 (Apache-2.0,PRAGMA user_version) and refinery 0.10 (MIT, its ownrefinery_schema_history) both still require rusqlite ≤ 0.40, and neither reads_sqlx_migrations.Licences (all AGPL-compatible): sqlx MIT OR Apache-2.0; rusqlite MIT; libsqlite3-sys MIT; rusqlite_migration Apache-2.0; refinery MIT; deadpool-sqlite MIT OR Apache-2.0; r2d2_sqlite MIT; tokio-rusqlite MIT; async-sqlite MIT; SQLite public domain.
Static musl: both use the same
libsqlite3-sysbundledbuild:ccwith pre-generated bindings and no bindgen. Ourzig cc(D213) builds both; measured below. rusqlite 0.41 needs SQLite ≥ 3.45.3 and MSRV 1.88/1.89, both fine on our 1.99.1.Async pool crates: only async-sqlite 0.7.0 supports rusqlite 0.41 today. deadpool-sqlite, r2d2_sqlite and tokio-rusqlite are on 0.40.
links = "sqlite3"forbids two libsqlite3-sys in one tree, so any of these would pin us to 0.40, which is still vulnerable. Variants (b) and (c) below use about 60 lines of our own code and no pool crate.3. Cost of replacing sqlx (origin/dev
6df0f5bd5)infraternal, 2 plugin-api, 1 release, 1 build_support)sqlx::query(/query_as(/query_scalar(/raw_sql(.execute/.fetch_*callsbegin,begin_with,begin_immediate)Transaction<…>signaturesSqlitePoolin signatures/fieldssqlx::Errorin error typesquery!and friends)sqlx::migrate!build_support/migrations.rsgenerates aMigratorliteralinfraternal-plugin-api(socket-host) exposessqlx::SqlitePoolandstorage::begin_immediate -> sqlx::Transactionto the mesh and release pluginsRunner replacement. Use our own runner, about 60 lines;
bench-rusqlite::migratein the scratch crate is a working version. Neither rusqlite_migration nor refinery fits:user_versionandrefinery_schema_historywould each need a one-time history conversion on production.The own runner keeps the existing
_sqlx_migrationstable exactly as it is:build_support/migrations.rs;ignore_missing=false, checksum validation;-- no-transaction).The version-20→22 retag in
auth/migration_compat.rsports as-is. Production databases need no conversion step.Measured:
sqlite_masteris identical to the sqlx-built schema.Receipts:
results/misc.jsonl(kindscompatandfresh).Risks:
async fnthat awaits statements one by one inside a transaction becomes one synchronous closure. A transaction that awaits non-DB work (network, crypto) between statements has to be split. That is a design review per site, not a search-and-replace.db::query(sql).bind().fetch_*()shim keeps them mechanical.Estimate:
A shim that keeps the
query().bind()shape but sends each statement over a channel would port faster, but it gives back most of the latency win shown below. The win comes from running a whole transaction in one closure.Cheaper alternatives, for comparison:
Receipts
~/.cache/codex-scratch/j438/:bench/(harness:common/common.rs,bench-sqlx,bench-sqlx-main,bench-rusqlite{,-032,-040},baseline),perf/(run scripts),results/results/{rep-1..5,misc,attr,attr2}.jsonl,table.md,attr2-table.md,sizes.txt.~/j438/:results/,pr-*/perf-run-*.{before,after}.txt(quiet checks),drive*.log. The binary SHA-256 values are insizes.txt, andbin2/bin3are listed inbinaries.sha256.~/.cache/codex-scratch/j438/logs/build-times.jsonl: cold build times. The fresh-zig-cache runs are the ones quoted;build-times-zigcached.jsonlholds the cached ones, which are not used.main; aarch64 timings; the realinfraternalbinary's size delta. The probes measure the database library's own addition, so the product delta can be smaller where sqlx shares dependencies.J449 start: D379 slice 1 (pool + migration runner, no query sites moved).
Branch
rusqlite-slice1, base origin/devbd551e549. VM worktree: dev-02~/worktrees/j449(gates go where the queue is shorter).Finding (blocks "rusqlite alongside sqlx" as briefed): Cargo cannot resolve sqlx 0.8.6 and rusqlite 0.41 in one graph. Both pull
libsqlite3-sys(^0.30.1vs^0.39), which declareslinks = "sqlite3", and only one package perlinksvalue may exist in a resolve. That covers optional and dev dependencies too, so a feature flag doesn't help. Receipt (dev-02,~/.cache/codex-scratch/j449/links-probe,cargo generate-lockfile):This also hits D379's later slices: every half-ported binary links both drivers.
Options:
sqlx-sqlite0.8.6 with only itslibsqlite3-sysrequirement raised to 0.39, as a[patch.crates-io]entry next to the existingvendor/russh. One SQLite (3.54.1) serves both drivers, so slices 1 to 3 build and ship incrementally. Side effects:~/.cache/codex-scratch/j449/patch-probe/run.log.excluded, own Cargo.lock) until sqlx is gone. Production stays untouched. It needs a second Nix vendoring lock, new verify rows for that crate, and a two-binary compat test (a sqlx example writes the DB, the rusqlite test reads it). Slices 2 and 3 still can't ship incrementally: the port becomes one big-bang switch.Recommendation: option 1, if the probe and the full server test suite pass on 3.54. It is less infrastructure and it is the only way D379's slice plan builds. The pool and runner code are the same either way, so I'm writing them now. I'll proceed with option 1 if the probe is clean and say so here. The orchestrator can redirect to option 2 before I push the packaging commit.
Plan (≈6 h):
crates/infraternal-db: writer thread with a bounded queue, transaction closures, N WAL readers, tokio async API, explicit pragmas, and cancellation and panic semantics (2 h)._sqlx_migrationsrunner fed by the same build_support generator: checksums, dirty, missing and mismatch refusal, plus the version-20→22 retag left to the server (1 h).J449 progress: option 1 taken, 4 commits pushed, head
e21f75dc0(branchrusqlite-slice1, basebd551e549).Probe for option 1, clean (dev-02,
~/.cache/codex-scratch/j449/patch-probe/run.log). sqlx-sqlite 0.8.6, unmodified apart from itslibsqlite3-sysrequirement, builds and runs on 0.39.1 in one binary with rusqlite 0.41:rusqlite=3.54.1 sqlx=3.54.1,exit=0. So I went ahead with option 1, as announced in 89039.Commits:
ae8705367build: vendor sqlx-sqlite 0.8.6 on libsqlite3-sys 0.39. The registry checksum matches our lock, andINFRATERNAL.mdrecords provenance.cargo deny check advisories licenses bans sources:advisories ok, bans ok, licenses ok, sources ok. It now warnsadvisory-not-detectedfor the RUSTSEC-2026-0459 ignore. I left deny.toml as D379 says, and the orchestrator decides whether to drop the ignore.5430a786ecrates/infraternal-db: a one-writer/N-reader pool plus the_sqlx_migrationsrunner, with 24 unit tests and a doctest.fefd36474The build script also emits the runner's migration list, plus theexamples/db_pool_benchport of J438's harness.e21f75dc0Compat tests in the server: today'sopen_database+Auth::new, checked against the runner.Results so far (dev-02, logs in
~/.cache/codex-scratch/j449/logs/):infraternal-db:test result: ok. 24 passed; 0 failedplus the doctest (run3.log).test result: ok. 4 passed; 0 failed; ... 582 filtered out(compat-green.log). This covers four things:sqlite_schema-identical to a sqlx-built one, row by row, and sqlx accepts it back;red-*.log). Each of these turned its test red: no cancel skip, no panic catch, unbounded queue, noquery_only, no read snapshot, no checksum pre-check, gap skipped. Re-checks of first-step-only and CREATE-text are in run 4.foreign_keyspragma stays green, because the bundled libsqlite3-sys compiles withSQLITE_DEFAULT_FOREIGN_KEYS=1. The pool sets the pragma anyway, so enforcement doesn't depend on that build flag.execute_batchsteps each statement only once, while sqlx runs each statement to completion. None of the 54 migrations has a top-level SELECT, so nothing differs today. The runner still usesBatchand steps every statement to its last row, to keep parity for future migrations.Next:
verify quick. It is queued.verify fast.J449 perf VM holds (announced before taking the lock). I'll run five separate
perf-runholds on backup01, each 10 minutes or less (target 20), one repetition per hold, queued behind the current holder. Hold 1 also builds the template (sqlx path + D170 seed) and runs startup and memory.db_pool_bench, x86_64 musl release, sha256c76bc1d4d330c0e5…. Built on dev-02 fromrusqlite-slice1; its non-test sources equal heade9a74ba0a.a-sqlx-pool: J438'sbench-sqlx, sqlx 0.8.6 on SQLite 3.46.0, i.e. origin/dev today.sqlx-pool: the same pool shape on this branch's SQLite 3.54.1.infraternal-db: the new pool on 3.54.1.~/j449/rep.sh. Results go to~/j449/results/rep-N.jsonl, and the perf-run state files to~/j449/pr-N/.J449 finding: the new pool's writer path stalls on the single-statement session slide; one extra perf hold of ≤5 min announced.
These are repetitions 1 and 2 on the perf VM. Rep 2 adds J438's own prototype (
c-split) in the same session. Files:~/j449/results/rep-{1,2}.jsonl.BEGIN IMMEDIATEtransaction in both pools, and there they are equal: 1 task p50 148 vs 146 µs, 64 tasks 2.5k vs 2.5k ops/s. Reads are equal too: host list p999 403 vs 412 µs. So the stall only hits single-statement writes, which my pool wraps inBEGIN IMMEDIATE … COMMIT.05074b46…. It runs as oneperf-runhold right after my reps 4–5. I'll fix the pool according to the result before the gate result is quoted.