fix(wasix): preserve core error recovery and limit SJLJ code growth - #229
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
f0rr0
force-pushed
the
f0rr0/fix-wasix-core-error-recovery
branch
from
October 1, 2026 08:50
c12f800 to
429fac6
Compare
This branch was successfully deployed
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.
Summary
A PL/pgSQL error after
COPYcan close the connection or trap in__wasm_setjmp_testinstead of returning its SQLSTATE. The WASIX libcsigsetjmpwrapper places the exception handler in a frame that has already returned when PostgreSQL callssiglongjmp.sigsetjmpinto compiler-visiblesetjmpat single-user core call sites, extending the existing side-module fix.P0001, statement rollback, and connection reuse.Fixes #227.
Includes the CI prerequisite fixes from #228: public Rust README documentation, source-only qualification, selected source uploads, and explicit WASIX consumer artifact dependencies. Merge #228 first to keep this PR focused on the five runtime/regression files.
Artifact size
Compared with the same correctness fix using the default partial-link inline budget:
The correctness fix alone grows WASM from 12,125,389 to 13,014,266 bytes. Analysis traced most of that growth to local loads and stores generated while lowering SjLj catch-state PHIs. The inline budget mitigates this compiler behavior; it does not fix LLVM's spill-placement algorithm.
Query performance tradeoff
Warm Linux x86-64 AOT SDK measurements, with identical SQL results and verified embedded runtime hashes:
These are medians of batch-average call costs, including SDK handling and row decoding, from six processes per build in repeated ABBA order on one pinned CPU. They are not individual-request latency percentiles. JSON processing shows a consistent cost; the other measurements do not establish a general speedup. This is an explicit size/performance tradeoff. TCP, concurrent throughput, cold start, and p95/p99 were not measured.
Release Intent
fix:.Verification
oliphaunt-pgwire-server:format-check,:lint,:test(26 tests), and:test-integration(12 tests).liboliphaunt-wasix:runtime-aotdependency chain passed: source inputs, compiler output, strict portable packaging, and Linux x86-64 AOT packaging/verification.liboliphaunt-wasix:smokepassed all seven PostgreSQL regression tests against the rebuilt runtime.The runtime size, performance, and local behavior measurements above used the exact tracked diff on base
32ce7b29510b74333e799601b69a71fd28122e80. Windows/macOS/ARM/browser qualification, the full extension lifecycle matrix, and the full TrailBase suite remain unverified locally. The host-recovery paths remain in place.The updated head
429fac6c92671eeabb94367454a170c79ac4e285includes current main and #228 through a linear history. Local release-intent and release-metadata checks pass; owner checks and full fresh CI qualification are still in progress. The runtime patches and COPY/error-recovery regression are unchanged. Earlier runtime measurements do not qualify the updated producer inputs.