Experiment 257: reject native autocommit envelope - #275
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hypothesis
A homogeneous coalesced
MultiExecuteRequestcan preserve every member as anindependent SQLite autocommit while replacing per-member Dart/native execution
orchestration with one private native interpreter call. Acceptance required at
least a 10% public insert-burst improvement in both process orders, with
sequential and mixed-SQL controls neutral.
Approach
The archived prototype packed a homogeneous parameter matrix once, reused one
cached statement and writer mutex in C, stopped on the first error, snapshotted
that error in Dart, and resumed the suffix through the scalar path. It added no
public API. The exact implementation and focused harness are preserved at
archive/exp-257(d502717); the final PR reverts all runtime changes andretains only the experiment sources, transferable lesson, and one coalescing
correctness guard.
Results
Lower is better; delta is candidate relative to baseline.
The primary insert gate missed the predeclared 10% bar in the reverse order.
The no-payload diagnostic regressed consistently: whole-group parameter/result
materialization costs more than the removed call boundaries while N independent
SQLite commits remain. Sequential (-1.7%) and mixed-SQL (+4.1%) controls stayed
in the small host-noise band.
Safety review also found reopen blockers around
sqlite3_reset()commit errors,dirty-union delivery timing, packed large-BLOB peak memory,
SQLITE_STATICbinding lifetime, ABI layout, and main-isolate diagnostic blocking.
Outcome
Rejected. Keep exp 180's scalar per-member worker loop. Reopen only with a
bounded native-ready transport that avoids group repacking, reproduces at least
10% on public 100/200-member bursts in both orders, holds small bursts neutral,
and carries BLOB RSS plus diagnostic-latency guards. The final diff is
publication/test-only and contains no runtime behavior change.
Test plan
test/write_coalescing_test.dart: 6/6dart run build_runner build --delete-conflicting-outputsdart analyze --fatal-infosdart test -j 1: 355/355dart run benchmark/finalize_experiment.dart --experiment=experiments/257-native-autocommit-envelope.mddart run benchmark/check_experiment_dispositions.dartgit diff --check