Skip to content

fix: WASM build for memory_profile.cpp#22231

Merged
johnathan79717 merged 1 commit into
merge-train/barretenbergfrom
claudebox/fix-memory-profile-ci
Apr 1, 2026
Merged

fix: WASM build for memory_profile.cpp#22231
johnathan79717 merged 1 commit into
merge-train/barretenbergfrom
claudebox/fix-memory-profile-ci

Conversation

@AztecBot

@AztecBot AztecBot commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes WASM build failure introduced by #22145 (--memory_profile_out flag for Chonk memory profiling).

Two issues in memory_profile.cpp:

  1. Narrowing conversion: peak_rss_bytes() / (1024ULL * 1024ULL) produces unsigned long long which can't narrow to size_t (32-bit unsigned long on WASM) in an initializer list. Fixed with static_cast<size_t>(...).
  2. Undefined symbol: peak_rss_bytes() lives in the env module which is intentionally excluded from the WASM link target. Guarded the call with #ifndef __wasm__, returning 0 for RSS on WASM (memory profiling is only meaningful on native builds).

Test plan

  • ./bootstrap.sh ci — all 1761 tests pass, both WASM builds succeed

ClaudeBox log: https://claudebox.work/s/b5d31ce0b9e0fa7f?run=1

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Apr 1, 2026
@johnathan79717 johnathan79717 marked this pull request as ready for review April 1, 2026 16:04
@johnathan79717 johnathan79717 merged commit 11f3a9f into merge-train/barretenberg Apr 1, 2026
35 of 39 checks passed
@johnathan79717 johnathan79717 deleted the claudebox/fix-memory-profile-ci branch April 1, 2026 16:07
github-merge-queue Bot pushed a commit that referenced this pull request Apr 2, 2026
BEGIN_COMMIT_OVERRIDE
fix: verify accumulated pairing points in native ChonkVerifier (#22224)
chore: enable _GLIBCXX_DEBUG in debug build presets (#22218)
feat: add --memory_profile_out flag for Chonk memory profiling (#22145)
fix: disable max capacity test in debug + tiny gate separator
improvements (#22215)
fix: WASM build for memory_profile.cpp (#22231)
fix: translator audit fixes (#22242)
fix: remove constexpr from functions using std::vector for
_GLIBCXX_DEBUG compat (#22239)
fix: pippenger edge case (#22256)
fix: avoid dereferencing past-the-end vector iterators in serialize.hpp
(#22261)
chore: crypto primitives external audit response 0 (#22263)
feat: switch memory profiling from peak RSS to live heap usage (#22266)
fix: replace UB end-iterator dereference in serialize.hpp (#22262)
fix: catch exceptions in ChonkBatchVerifier::batch_check (#22270)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants