[GH-ISSUE #5760] [Perf] Frame WAT without rescanning instruction and string payloads #3503

Closed
opened 2026-10-31 00:41:14 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @gensokyo-dev on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5760

Current limitation and use case

Static inspect_wasm_artifact must frame WABT's complete WAT before returning the existing interface/summary. WabtWat walks every character inside quoted payloads; the interface tokenizer calls watString merely to obtain an end position, allocating and decoding bytes it discards. This is separate from delivery paging and debug-label ambiguity (#5417).

Observed evidence

Source d0067ba34a39, Linux x64, pinned Node 24.18.0 and native WABT 1.0.42. Fresh public npm @vscode/tree-sitter-wasm@0.3.1 components produce 13,599,679-byte CSS WAT and 2,932,854-byte runtime WAT. One guarded parser probe takes 194/161 ms (including writing parsed results). A CPU sample attributes 256 ms across both to WAT framing and 30 ms to interface tokenization. These are phase observations, not public-workflow speedup claims. Data forms are already excluded from typed-interface input.

Desired outcome and approach

Share a format-aware quoted-string boundary operation at the WABT owner; use native substring search while preserving escaped-quote/backslash parity. Decode bytes only where names or custom payloads are actually interpreted. Preserve exact retained WAT, names, interface facts, unknown signatures, Evidence and public defaults; no cache or new tool.

Scope and verification

Existing offline WASM inspection only; no target execution/mutation or new provider. Compare unchanged public CLI/MCP tasks and independent native WebAssembly import/export facts on small and shipped components. Include cold/warm phases, output/context parity, wall/CPU/process-family memory and cleanup under serial one-CPU/4-GiB guards. Add malformed/truncated/escape boundary checks. Benefit and broader coverage remain unverified pending experiments.

Originally created by @gensokyo-dev on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5760 ### Current limitation and use case Static `inspect_wasm_artifact` must frame WABT's complete WAT before returning the existing interface/summary. `WabtWat` walks every character inside quoted payloads; the interface tokenizer calls `watString` merely to obtain an end position, allocating and decoding bytes it discards. This is separate from delivery paging and debug-label ambiguity (#5417). ### Observed evidence Source `d0067ba34a39`, Linux x64, pinned Node 24.18.0 and native WABT 1.0.42. Fresh public npm `@vscode/tree-sitter-wasm@0.3.1` components produce 13,599,679-byte CSS WAT and 2,932,854-byte runtime WAT. One guarded parser probe takes 194/161 ms (including writing parsed results). A CPU sample attributes 256 ms across both to WAT framing and 30 ms to interface tokenization. These are phase observations, not public-workflow speedup claims. Data forms are already excluded from typed-interface input. ### Desired outcome and approach Share a format-aware quoted-string boundary operation at the WABT owner; use native substring search while preserving escaped-quote/backslash parity. Decode bytes only where names or custom payloads are actually interpreted. Preserve exact retained WAT, names, interface facts, unknown signatures, Evidence and public defaults; no cache or new tool. ### Scope and verification Existing offline WASM inspection only; no target execution/mutation or new provider. Compare unchanged public CLI/MCP tasks and independent native WebAssembly import/export facts on small and shipped components. Include cold/warm phases, output/context parity, wall/CPU/process-family memory and cleanup under serial one-CPU/4-GiB guards. Add malformed/truncated/escape boundary checks. Benefit and broader coverage remain unverified pending experiments.
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#3503
No description provided.