Repository navigation
fix(wasm): normalize deep nesting on a fresh instance - #214
Conversation
… case that now parses
…the full WASM stack
…e dropped instance
…ths that overflow V8 on macOS
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review complete. No issues found — approved ✅. This change introduces a single new test file exercising WASM recovery behavior for the pg_query parser in the PostgreSQL 18 version build. The test parses a sample SQL statement, simulates a WASM module reset, re-parses, and asserts results are consistent across the reset boundary.
Reviewed commit: ffc70bd |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…nd raise the normalize limits
Summary
Stacked on #213; retarget to
mainonce that merges.normalizeSyncstops at about 770 chained terms (SELECT 1+1+…) on a fresh WASM instance and reaches about 1,640 only once V8 has warmed the instance up (1,000 WASM↔JS crossings,--wasm-wrapper-tiering-budget). Since 18.2.x replaces the instance after an overflow, a caller that hits one too-deep query drops back to 770, where 18.1.5 kept its warm (but corrupt) instance and still normalized 1,640.The fix is in the C fork, constructive-io/libpg_query#21: normalize no longer has a
PG_TRYblock, and with it a WASM → JS → WASM round trip, on every level of an expression. This PR pins that commit. A fresh instance now normalizes 4,000 chained terms. No memory or stack setting changes.The test commit is pushed first and fails on the current pin: it normalizes 3,000 chained terms right after an overflow, three times in a row.
Implemented in session Audit WASM memory history and verify full-stack depth
Review with Devin · Open in Devin Desktop
Summary by CodeRabbit