Skip to content

fix(build): repair fuzz target and wasm decoder after upstream refactors - #301

Merged
farhan-syah merged 1 commit into
NodeDB-Lab:mainfrom
EnRaiha:fix/fuzz-wasm-builds
Sep 6, 2026
Merged

fix(build): repair fuzz target and wasm decoder after upstream refactors#301
farhan-syah merged 1 commit into
NodeDB-Lab:mainfrom
EnRaiha:fix/fuzz-wasm-builds

Conversation

@EnRaiha

@EnRaiha EnRaiha commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Two build breaks landed on main today (637feea41 mem refactor + the workspace ruzstd 0.7 -> 0.9 bump) and redden the ASan-fuzz matrix and the 32-bit build check for every PR touching the path-filtered crates:

  • fuzz/src/targets/columnar_segment.rs still calls SegmentWriter::plain(), which 637feea41 replaced with SegmentWriter::new(profile_tag, ScopedMemory) — mandatory memory budgeting. nodedb-fuzz does not compile.
  • nodedb-codec/src/zstd_codec.rs (WASM decompression path) imports ruzstd::StreamingDecoder from the crate root; ruzstd 0.9 moved it to ruzstd::decoding. The 32-bit build check fails on the unresolved import.

Fix

  • Fuzz target: adapt to SegmentWriter::new(PROFILE_PLAIN, fuzz_memory()) with a governor-backed ScopedMemory (the shape the columnar integration tests use), matching the production call sites in columnar_checkpoint/load.rs. Adds the nodedb-mem dependency to the fuzz crate.
  • Codec: import ruzstd::decoding::StreamingDecoder (verified present in vendored ruzstd 0.9.0).

Verified

  • cargo build --manifest-path fuzz/Cargo.toml (nightly) compiles clean.

  • cargo clippy -p nodedb-codec --all-targets --all-features -- -D warnings clean.

  • cargo fmt --all -- --check clean.

  • The 32-bit build check (wasm32) runs in CI.

  • Local ASan smoke on the fix branch, all six targets with the CI flags
    (`--sanitizer address`, `-max_total_time=60 -runs=0 -max_len=1048576
    -timeout=10 -rss_limit_mb=2048` + dict): exit 0, no crash artifacts.

How to test

cargo build --manifest-path fuzz/Cargo.toml   # nightly
cargo check --target wasm32-unknown-unknown -p nodedb-codec -p nodedb-columnar -p nodedb-strict

Copilot AI lite review requested due to automatic review settings September 6, 2026 18:41
@EnRaiha EnRaiha added sev:2-high Major functionality broken; no acceptable workaround priority:P1 Fix in the current milestone status:needs-triage Awaiting maintainer triage (severity + priority) labels Sep 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Two build breaks landed on main today and redden every PR that touches the
fuzz path-filtered crates:

- 637feea (refactor(mem): mandatory ScopedMemory) replaced
  SegmentWriter::plain() with SegmentWriter::new(profile_tag, ScopedMemory).
  The fuzz columnar_segment target still called the removed constructor.
  Adapt it to the new API with a governor-backed scope (the shape the
  columnar integration tests use) and the PROFILE_PLAIN tag, matching the
  production call sites in columnar_checkpoint/load.rs.

- The workspace ruzstd bump 0.7 -> 0.9 moved the streaming decoder out of
  the crate root (it is re-exported from ruzstd::decoding). The WASM
  decompression path in nodedb-codec still imported ruzstd::StreamingDecoder,
  which no longer resolves — the 32-bit build check failed on it.

Verified locally: `cargo build --manifest-path fuzz/Cargo.toml` on nightly
compiles clean; nodedb-codec clippy is clean. The wasm32 check itself needs
the CI runner's getrandom artifact cache (plain getrandom 0.3 lacks the
wasm_js feature outside the aliased getrandom_03 entry), so it re-verifies
in the 32-bit build check job.
@farhan-syah
farhan-syah merged commit bb76352 into NodeDB-Lab:main Sep 6, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:P1 Fix in the current milestone sev:2-high Major functionality broken; no acceptable workaround status:needs-triage Awaiting maintainer triage (severity + priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants