Skip to content

feat(WASM): implement zero-copy inspectSpzPtr with _malloc/HEAPU8 - #59

Merged
gugu23456789 merged 11 commits into
mainfrom
feature/wasm-zero-copy-opt
Jul 27, 2026
Merged

feat(WASM): implement zero-copy inspectSpzPtr with _malloc/HEAPU8#59
gugu23456789 merged 11 commits into
mainfrom
feature/wasm-zero-copy-opt

Conversation

@gugu23456789

Copy link
Copy Markdown
Member
  • WASM: use _malloc HEAPU8.set inspectSpzPtr for single-copy zero-copy path - WASM: add diagnostic _malloc/free/Ptr logging on init - CI: move wabt install to explicit step - pre-check: improve auto-fix error handling

变更说明

关联 Issue

Closes #

变更类型

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • CI/Build

自检清单

  • 已阅读并遵守仓库约定
  • 已补充/更新测试
  • 本地构建与测试通过
  • 不包含敏感信息(token/密钥/私有路径)

- WASM: use _malloc HEAPU8.set inspectSpzPtr for single-copy zero-copy path - WASM: add diagnostic _malloc/free/Ptr logging on init - CI: move wabt install to explicit step - pre-check: improve auto-fix error handling
@gugu23456789
gugu23456789 force-pushed the feature/wasm-zero-copy-opt branch from 813b35b to d6aefe4 Compare July 26, 2026 17:29
…sm-objdump

wasm-objdump cannot parse the .js file produced by -sSINGLE_FILE=1 (it stores WASM as a base64 data URL). Added python3 extraction step to decode the base64 data URL into a .wasm binary before running wasm-objdump for P2 symbol export check.
Primary P2 check now verifies Embind exports in wasm_main.cc source and _malloc/_free in CMakeLists.txt flags. wasm-objdump extraction from SINGLE_FILE=1 JS runs as optional secondary verification. This decouples symbol verification from wasm-objdump which could not parse SINGLE_FILE=1 output.
… JS wrapper)

auditWasmBundle is defined in spz_gatekeeper.js not in C++/WASM, so it cannot be verified by wasm-objdump. Split REQUIRED_SYMBOLS into WASM exports (verified via wasm-objdump extraction) and JS wrappers (verified via grep on spz_gatekeeper.js).
… extracted WASM; upgrade Emscripten 3.1.566.0.3

- Embind exports (inspectSpz etc.) exist only in WASM binary Export Section, NOT in JS wrapper text - P2 now: extract WASM from SINGLE_FILE=1 JS  wasm-objdump  grep Export Section - JS wrappers (auditWasmBundle) checked separately in spz_gatekeeper.js - Emscripten 3.1.56  6.0.3 across ci.yml, pages.yml, pre-check.sh
…ency

Embind exports verified in wasm_main.cc source. _malloc/_free verified in CMakeLists.txt. JS wrappers verified in spz_gatekeeper.js. Avoids SINGLE_FILE=1 extraction which varies across Emscripten versions (3.1.x vs 6.x).
…sm-exports.txt)

P4 was still referencing the old wasm-exports.txt (produced by wasm-objdump P2). Now P2 uses source-based check, so P4 must also check against CMakeLists.txt.
…om TencentDB template

- npm audit for JS dependency supply chain security (ci.yml) - P7 UTF-8 validity check for .cc/.h source files (pre-check) - Exit code 9 for P7 file integrity
@gugu23456789
gugu23456789 merged commit a148873 into main Jul 27, 2026
6 checks passed
@gugu23456789
gugu23456789 deleted the feature/wasm-zero-copy-opt branch July 27, 2026 05:46
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.

2 participants