Skip to content

SQLite: cap trigger recursion for WebAssembly stacks#781

Closed
brandonpayton wants to merge 1 commit into
gascity/kd-cfo/kd-c5i.7-fix-mmap-randexpr1-expression-depth-failures-under-kandefrom
gascity/kd-cfo/kd-c5i.8-reproduce-wave40-node-shard01-fk-stack-overflow-wedge
Closed

SQLite: cap trigger recursion for WebAssembly stacks#781
brandonpayton wants to merge 1 commit into
gascity/kd-cfo/kd-c5i.7-fix-mmap-randexpr1-expression-depth-failures-under-kandefrom
gascity/kd-cfo/kd-c5i.8-reproduce-wave40-node-shard01-fk-stack-overflow-wedge

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jun 27, 2026

Copy link
Copy Markdown
Member

What this does

#907 already landed the platform memory-management and syscall-path fixes that the old composite SQLite stack depended on. This PR does not copy those runtime changes.

The remaining change is deliberately small:

  • build both the shipped SQLite library and the official testfixture with a trigger recursion limit of 50;
  • keep the sqllimits1.test SQL-length filler comment-only so that test reaches the SQL-length limit instead of the lower expression-depth limit;
  • document both WebAssembly stack boundaries.

This PR is stacked on focused #780, which owns the compound-select, expression-depth, and JSON-depth limits. Its unique diff is one commit and five files.

Deliberately removed

I removed the old #769 ancestry, mmap/runtime work, broad harness changes, the no_mutex patches, and the 2 GiB maximum-memory override. Those changes do not belong in this package-focused slice.

ABI and package artifacts

There is no Kandelo ABI change. The SQLite compile flags change output bytes, so packages/registry/sqlite/build.toml moves from revision 3 to revision 4. No other package revisions change.

Validation

Run through scripts/dev-shell.sh:

  • rebuilt the shipped SQLite library and the official testfixture with the local zlib and Tcl dependencies;
  • verified all five upstream patches apply cleanly;
  • bash scripts/check-abi-version.sh;
  • Node official SQLite tests: e_fkey (941 tests), triggerC (120 tests), and sqllimits1 (3,117 tests);
  • Chromium official SQLite tests with a freshly rebuilt VFS: the same three suites and counts.

All focused runs passed. CI is running on the rewritten head.

Not run locally: the full Vitest suite, the full non-slow browser suite, libc/POSIX/Sortix conformance, the complete upstream SQLite suite, or ./run.sh browser. Performance was not measured, and this PR makes no performance claim.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

Phase B-1 matrix build status — pr-781-staging

ABI v39. 5 built, 0 failed, 5 total.

Package Arch Status Sha
sqlite wasm32 built 5a13e73a
sqlite wasm64 built d7ce2dd3
php wasm32 built 9fd390fa
lamp wasm32 built ca2226cc
wordpress wasm32 built 0eb6e1e7

Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.

@brandonpayton

Copy link
Copy Markdown
Member Author

Recording the current head before reconstruction: 152c9a2c00fe8ba0c39e239d720cf5f6f0af6f50. I’m restacking this on the focused #780 branch, without #769 ancestry. The branch will be updated with --force-with-lease.

@brandonpayton brandonpayton force-pushed the gascity/kd-cfo/kd-c5i.7-fix-mmap-randexpr1-expression-depth-failures-under-kande branch from 3828f36 to 4b04ff3 Compare July 13, 2026 19:11
@brandonpayton brandonpayton force-pushed the gascity/kd-cfo/kd-c5i.8-reproduce-wave40-node-shard01-fk-stack-overflow-wedge branch from 152c9a2 to 9e3fd3f Compare July 13, 2026 19:16
@brandonpayton brandonpayton changed the title sqlite: cap trigger recursion for wasm stack limits SQLite: cap trigger recursion for WebAssembly stacks Jul 13, 2026
@brandonpayton

Copy link
Copy Markdown
Member Author

Closing this focused source PR because its unique SQLite trigger-recursion limit work is now carried by #934 at exact green head 260d75d5adc31b327f5591229dbfbb287d395fd6. #934 keeps it as a separate purpose commit and passed the full staging and browser gates. This is not a claim that this branch was merged verbatim.

@brandonpayton brandonpayton deleted the gascity/kd-cfo/kd-c5i.8-reproduce-wave40-node-shard01-fk-stack-overflow-wedge branch July 14, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant