[PR #5766] [MERGED] perf(wasm): skip payload text during WAT framing #7045

Closed
opened 2026-11-01 21:44:57 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5766
Author: @gensokyo-dev
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @gensokyo-dev

Base: main ← Head: perf/5760-wat-string-framing-20261021


📝 Commits (2)

  • 9776d78 perf(wasm): frame WAT without rescanning instruction and string payloads
  • 412c0fe test(perf): record equivalent shipped WASM framing tasks

📊 Changes

8 files changed (+944 additions, -22 deletions)

View changed files

📝 experiments/analysis-efficiency/README.md (+4 -0)
➕ experiments/analysis-efficiency/wasm-string-framing.json (+561 -0)
➕ experiments/analysis-efficiency/wasm-string-framing.md (+107 -0)
➕ experiments/analysis-efficiency/wasm-string-framing.mjs (+184 -0)
📝 src/wasm/WabtInterface.ts (+3 -3)
➕ src/wasm/WabtString.test.ts (+56 -0)
📝 src/wasm/WabtString.ts (+18 -10)
📝 src/wasm/WabtWat.ts (+11 -9)

📄 Description

Summary

Fixes #5760. Static WASM inspection spent time scanning every WAT instruction character and decoding quoted bytes solely to locate their ends. Share string framing at the WABT owner and search directly for structural delimiters. CLI/MCP continue through the same provider/application path; full WAT, original Evidence, names, partial/unknown signatures and defaults remain intact. No new tool or cache.

Evidence and validation

Measurements and reproduction include all 18 final public MCP tasks, separate parser samples, artifact/runtime hashes and negative results. SQLite/CSS whole-task median wall: 13.714 → 13.311 s / 12.409 → 12.112 s. Small tasks are unchanged. Memory does not improve; SQLite median peak rises, with overlapping ranges. Catalog/Evidence/answer fingerprints and transport token estimates are unchanged; actual model usage is unmeasured.

Executed on Linux x64, pinned Node 24.18.0/npm 11.16.0 and native WABT 1.0.42:

  • Nine source files: 76 tests passed, including escaping/truncation, comments, capacity, cancellation and cleanup.
  • Four compiled CLI/MCP/acceptance files: 14 tests passed.
  • Native WABT artifact verifier: 51 CLI/MCP cases passed; native interface verifier: nine cases passed.
  • npm run build:cached and npm run check: passed.
  • npm run docs:check and affected-file formatting: passed.

All 18 MCP tasks and 18 parser processes have verified payload-exit resource observations and cleanup with zero limit/OOM events under one CPU, 4-GiB hard/3-GiB early bounds. Final whole-scope counters remain unknown. Builds/checks used separate documented bounds. Raw recordings, replies and binaries stay outside Git. Published-head CI Static checks, Source tests, Build package and readiness passed. Codex reported no findings and Greptile scored 5/5. Remaining portable test shards and the Windows native build were running/queued at the authorized administrative merge; completion is not claimed. Merge verification record.

Contract and scope

Owner: src/wasm/; existing offline WABT inspection only. Public contracts/catalog, resource ceilings, package metadata and authority are unchanged. Existing effects are local-file reads, supervised WABT subprocesses and retained/exported Evidence; no WASM target execution or network acquisition occurs. A new maintainer scope decision is not applicable. No Windows/macOS runtime qualification or release is claimed.

Author readiness

Human owner: @gensokyo-dev

The following owner declarations are transcribed at the human owner's explicit standing instruction in this session.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5766 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `perf/5760-wat-string-framing-20261021` --- ### 📝 Commits (2) - [`9776d78`](https://github.com/morluto/rea/commit/9776d78f6c799cba8d8cf5c9b3139a86449eaebd) perf(wasm): frame WAT without rescanning instruction and string payloads - [`412c0fe`](https://github.com/morluto/rea/commit/412c0fec48bbc9a454858fd8fd0ea9993ea8f440) test(perf): record equivalent shipped WASM framing tasks ### 📊 Changes **8 files changed** (+944 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `experiments/analysis-efficiency/README.md` (+4 -0) ➕ `experiments/analysis-efficiency/wasm-string-framing.json` (+561 -0) ➕ `experiments/analysis-efficiency/wasm-string-framing.md` (+107 -0) ➕ `experiments/analysis-efficiency/wasm-string-framing.mjs` (+184 -0) 📝 `src/wasm/WabtInterface.ts` (+3 -3) ➕ `src/wasm/WabtString.test.ts` (+56 -0) 📝 `src/wasm/WabtString.ts` (+18 -10) 📝 `src/wasm/WabtWat.ts` (+11 -9) </details> ### 📄 Description ## Summary Fixes #5760. Static WASM inspection spent time scanning every WAT instruction character and decoding quoted bytes solely to locate their ends. Share string framing at the WABT owner and search directly for structural delimiters. CLI/MCP continue through the same provider/application path; full WAT, original Evidence, names, partial/unknown signatures and defaults remain intact. No new tool or cache. ## Evidence and validation [Measurements and reproduction](https://github.com/morluto/rea/blob/412c0fec48bbc9a454858fd8fd0ea9993ea8f440/experiments/analysis-efficiency/wasm-string-framing.md) include all 18 final public MCP tasks, separate parser samples, artifact/runtime hashes and negative results. SQLite/CSS whole-task median wall: **13.714 → 13.311 s / 12.409 → 12.112 s**. Small tasks are unchanged. Memory does not improve; SQLite median peak rises, with overlapping ranges. Catalog/Evidence/answer fingerprints and transport token estimates are unchanged; actual model usage is unmeasured. Executed on Linux x64, pinned Node 24.18.0/npm 11.16.0 and native WABT 1.0.42: - Nine source files: **76 tests passed**, including escaping/truncation, comments, capacity, cancellation and cleanup. - Four compiled CLI/MCP/acceptance files: **14 tests passed**. - Native WABT artifact verifier: **51 CLI/MCP cases passed**; native interface verifier: **nine cases passed**. - `npm run build:cached` and `npm run check`: **passed**. - `npm run docs:check` and affected-file formatting: **passed**. All 18 MCP tasks and 18 parser processes have verified payload-exit resource observations and cleanup with zero limit/OOM events under one CPU, 4-GiB hard/3-GiB early bounds. Final whole-scope counters remain unknown. Builds/checks used separate documented bounds. Raw recordings, replies and binaries stay outside Git. Published-head CI Static checks, Source tests, Build package and readiness passed. Codex reported no findings and Greptile scored 5/5. Remaining portable test shards and the Windows native build were running/queued at the authorized administrative merge; completion is not claimed. [Merge verification record](https://github.com/morluto/rea/pull/5766#issuecomment-6307749718). ## Contract and scope Owner: `src/wasm/`; existing offline WABT inspection only. Public contracts/catalog, resource ceilings, package metadata and authority are unchanged. Existing effects are local-file reads, supervised WABT subprocesses and retained/exported Evidence; no WASM target execution or network acquisition occurs. A new maintainer scope decision is not applicable. No Windows/macOS runtime qualification or release is claimed. ## Author readiness Human owner: @gensokyo-dev The following owner declarations are transcribed at the human owner's explicit standing instruction in this session. - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:44:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7045
No description provided.