Skip to content

Test v18 WASM depth and recovery in Firefox and WebKit - #219

Merged
devin-ai-integration[bot] merged 16 commits into
mainfrom
feat/wasm-browser-depth
Nov 26, 2026
Merged

devin-ai-integration[bot] merged 16 commits into
mainfrom
feat/wasm-browser-depth

Conversation

@pyramation

@pyramation pyramation commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Run the v18 browser ESM/WASM build against libpg-query@18.1.5 in Firefox and macOS WebKit. Compare warmed depths in 100-level increments, publish the measurements in CI, and check that the candidate can still normalize at the baseline depth after replacing an overflowed WASM instance.

PL/pgSQL now throws SqlError for native PostgreSQL depth diagnostics without changing their text or remapping real OOMs. WASM memory and stack settings are unchanged.


libpg-query and parser opened this PR for Dan
Implemented in session Test libpg-query depth limits in Firefox and Safari
Review with Devin · Open in Devin Desktop


Summary by CodeRabbit

  • Bug Fixes
    • PL/pgSQL parsing now reports grammar-limit and memory-exhaustion errors as SQL errors in both synchronous and asynchronous parsing, with clearer handling of other errors.
  • Tests
    • Added browser-based validation for version 18 in Firefox and WebKit, covering deeply nested SQL and PL/pgSQL statements.
    • Tests compare parser depth limits against a baseline, check overflow diagnostics, and verify parser recovery after errors.
    • Browser tests now run in continuous integration.

@luxor-code-review

luxor-code-review Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Review complete. 🟠 1 high

💬 Inline comments (1)

  • 🟠 --with-deps breaks the macOS webkit matrix leg — ci.yml:145

This PR introduces a browser-based WASM depth-limit test harness for the v18 package, wired into CI. It adds Playwright-driven browser tests with a binary-search depth probe for both baseline and candidate parsers, SQL depth-case fixtures (plpgsql and SQL generators), and a GitHub Actions workflow that builds WASM artifacts and runs the browser matrix.

Files Change
versions/18/test/wasm-depth-cases.js Adds SQL/plpgsql fixture cases parameterized by nesting depth.
versions/18/test/wasm-depth.browser.test.js Adds a node:test Playwright harness bundling the WASM parser via esbuild, probing parse depth with a binary search and writing a step summary.
versions/18/package.json Adds test:browser script and devDependencies (playwright, esbuild-wasm, libpg-query baseline alias).
.github/workflows/ci.yml Adds a browser-depth CI job building WASM artifacts and running the browser matrix on ubuntu/macos.
pnpm-workspace.yaml Excludes libpg-query from the minimum-release-age policy to allow the baseline alias to install.

Reviewed commit: 64e418c

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@socket-security

socket-security Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedesbuild-wasm@​0.27.71001007585100
Addedplaywright@​1.61.11001001009980
Addedlibpg-query@​18.1.510010010092100

View full report

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The v18 PL/pgSQL wrappers classify depth-limit diagnostics as SqlError. Browser tests compare parsing depth and recovery between candidate and published builds. CI runs those tests on Firefox and WebKit.

Changes: v18 depth diagnostics and browser checks

Layer / File(s) Summary
PL/pgSQL depth-error classification
templates/full/index.ts, versions/18/src/index.ts, versions/18/test/plpgsql.test.js, versions/18/release-diff.allow.json
The template and v18 wrapper map stack-depth and memory-exhaustion messages to SqlError for synchronous and asynchronous PL/pgSQL parsing. Tests check the LOOP diagnostic, and allowlist records cover IF, BEGIN, and LOOP cases.
Browser depth and recovery checks
versions/18/test/wasm-depth-cases.js, versions/18/package.json, versions/18/test/wasm-depth.browser.test.js
The v18 package adds depth-case generators and browser tests that measure candidate and baseline parsing limits and check recovery. The package adds the browser-test script and its development dependencies.
Browser-test CI and workspace configuration
.github/workflows/ci.yml, pnpm-workspace.yaml
CI runs the tests on Firefox and WebKit. The workspace adds libpg-query to the minimum-release-age exclusion list and updates the first-party package count.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant BrowserTest
  participant Playwright
  participant ParserBuilds
  BrowserTest->>Playwright: Launch Firefox or WebKit
  BrowserTest->>ParserBuilds: Bundle baseline and candidate builds
  Playwright->>ParserBuilds: Load JavaScript and WASM assets
  BrowserTest->>Playwright: Probe parsing and normalization depths
  Playwright-->>BrowserTest: Return depth results and overflow diagnostics
Loading

Possibly related PRs

Merge Risk: Low · previous review 82a71 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Security architecture risk: Minimal · up to 82a71

Depth-limit failures keep their existing messages but now use a more specific error type. The browser checks are confined to CI. The reviewed changes did not establish a material increase in security or failure-containment risk.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The runtime change affects existing PL/pgSQL callers that branch on error type; it does not add an input route. The new browser execution runs on CI workers and consumes a WASM artifact rather than publishing one.

Trust Boundaries and Controls

  • observed — The new browser job installs against the frozen lockfile. At the synthetic browser origin, the harness serves only the test document, parser bundle, and WASM file, and aborts other paths at that origin.

Resilience and Maintainability Implications

  • observed — The base-to-head change leaves the WASM failure counter and cleanup guard intact: the wrapper frees pointers when the owning instance has not been invalidated, and the new diagnostic mapping does not change when an instance is replaced.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Test v18 WASM depth and recovery in Firefox and WebKit" matches the main change. The PR adds a browser WASM stack-depth test for Firefox and WebKit, checks parser recovery after overflow, a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Test v18 WASM depth and recovery in Firefox and WebKit" matches the main change. The PR adds a browser WASM stack-depth test for Firefox and WebKit, checks parser recovery after overflow, and adds CI jobs for these browsers. The title is specific and concise. It does not mention the PL/pgSQL error-mapping change to SqlError, which is a secondary functional change in the diff.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e08eb43 and 82a713e.

Files selected for processing: 2

  • versions/18/release-diff.allow.json
  • versions/18/test/wasm-depth.browser.test.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

luxor-code-review[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@devin-ai-integration
devin-ai-integration Bot merged commit b7e70e9 into main Nov 26, 2026
67 checks passed
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