Skip to content

chore: refresh imported plugin sources from upstream 0.17.0-131 (#45)#50

Merged
0yi0 merged 17 commits into
mainfrom
45-reimport-refresh
Jun 26, 2026
Merged

chore: refresh imported plugin sources from upstream 0.17.0-131 (#45)#50
0yi0 merged 17 commits into
mainfrom
45-reimport-refresh

Conversation

@0yi0

@0yi0 0yi0 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

PR summary

Refresh re-import of the C++ plugin sources/tests/CI-utils from WasmEdge core, pinned to 0.17.0-131-g3e752187 (3e752187). Brings the 17-commit delta that landed in the imported paths since the original import (PR #44, base d67087e). Follow-up to #45 (the migration-window re-import procedure); same recipe as #44, replayed onto the current main.

Implementation design

  • Temp clone of upstream pinned at 3e752187git filter-repo over the feat: import plugin sources, tests, and CI utils from WasmEdge core #44 path list (plugins, test/plugins, thirdparty/wasi_crypto, utils/docker, utils/ffmpeg, utils/opencvmini, utils/wasi-crypto, utils/wasi-nn, utils/wasi-test, utils/build_libpiper.sh) → 640 filtered commits, 0 merges.
  • git rebase --onto main --root --empty=drop --committer-date-is-author-date: the 623 commits already on main (from feat: import plugin sources, tests, and CI utils from WasmEdge core #44) drop as already-applied/empty; the 17 new commits replay onto main. Original authors, dates, messages, and DCO sign-offs preserved; committer rewritten (rebase semantics).
  • Linear, no merge commit.

Design decisions

Commit slicing

17 upstream commits, no authored commits — this PR is exactly the filtered delta (git log main..HEAD).

Test plan

Non-goals / afterwards


🤖 Generated by Claude Opus 4.8 (1M context) with Claude Code

parthdagia05 and others added 17 commits June 11, 2026 21:42
Implement Ecdsa::PublicKey::verify() using EVP_PKEY_public_check. Part of #2669.

Signed-off-by: Parth Dagia <parth.24bcs10414@sst.scaler.com>
GCC's -Wshadow=local errors because the z_stream unique_ptr locals in
the init/copy host functions share the HostZStream/DestZStream names
with the SyncRun lambda parameters. Rename the locals to NewZStream;
the lambda parameter naming stays consistent across the file.

Assisted-by: GitHub Copilot CLI (Claude Fable 5)
Signed-off-by: hydai <z54981220@gmail.com>
The histogram-printing loops reuse i inside the polling loop that
already declares it, which errors under GCC's -Wshadow=local and
Clang's -Wshadow. Rename the inner loop variables to j.

Assisted-by: GitHub Copilot CLI (Claude Fable 5)
Signed-off-by: hydai <z54981220@gmail.com>
… target

The opencvmini test target pulls the OpenCV include path in through
the plugin's INCLUDE_DIRECTORIES property as a regular include, so
Clang's -Wshadow-field errors on parameters shadowing members
inherited from cv::Mat inside OpenCV's own mat.inl.hpp. Reuse the
wasmedge_suppress_shadow_warnings helper on the test target, matching
how the other third-party dependencies are handled.

Assisted-by: GitHub Copilot CLI (Claude Fable 5)
Signed-off-by: hydai <z54981220@gmail.com>
Signed-off-by: hydai <z54981220@gmail.com>
…ion (#4940)

Additionally, remove unused functions from tts/tts_core.h exports.

Signed-off-by: Pranjal Kole <pranjal.kole7@gmail.com>
…tion

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
…rtualization

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
…fix devirtualization

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
…lization

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
…5008)

* fix(plugin/wasi-logging): validate full string extent in Log::body

getPointer<char *> only checks sizeof(char) == 1 byte, but CxtLen and
MsgLen bytes are then consumed via string_view comparisons and logger
calls. Passing CxtPtr + CxtLen or MsgPtr + MsgLen past the linear
memory boundary crashes the host process through the guard page.

Replace both with getStringView(ptr, len) which calls
checkAccessBound(offset, len) over the full extent before returning.

Signed-off-by: Yashika <ssyashika1311@gmail.com>

* test(plugin/wasi-logging): add OOB regression tests for Log::body

Verify that CxtPtr + CxtLen and MsgPtr + MsgLen extending past the
linear memory boundary return HostFuncError instead of crashing the
host process through the guard page.

Signed-off-by: Yashika <ssyashika1311@gmail.com>

* test(plugin/wasi-logging): add WAT reproducer for OOB crash in Log::body

Signed-off-by: Yashika <ssyashika1311@gmail.com>

* test(plugin/wasi-logging): remove unused WAT reproducer file

The poc_oob_log.wat file was not referenced by the test suite and was
flagged as unrelated in review. The OOB behavior is already covered by
the C++ regression tests in wasi_logging.cpp.

Signed-off-by: Yashika <ssyashika1311@gmail.com>

---------

Signed-off-by: Yashika <ssyashika1311@gmail.com>
…tualization

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
The previous EXPECT_* checks will allow a dereference on calling
getHostFunc(), which may lead segfaults instead of a failing cleanly.

Call sites with no guard at all are hardened the same way, inserting the
ASSERT_NE/ASSERT_TRUE pair before getHostFunc() across the FFmpeg test
files the earlier pass missed.

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
…perate

Two comments labelled the lookup as wasm_bpf_map_fd_by_name while the export
actually fetched is wasm_bpf_map_operate, a copy-paste leftover that misleads
when navigating the test.

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
…dings

Replacing the concrete dynamic_cast host-function lookups with getHostFunc()
dropped the only check that each export was wired to the correct, same-signature
host function: a call that copies bytes into memory or returns a scalar still
reports ErrNo::Success when mis-bound. Read the written output back or pin a
distinguishing value so every export binding stays observable.

wasmedge_ffmpeg name and scalar readbacks:
- avPixfmt: av_color_range_name (pc), av_color_transfer_name (smpte170m),
  av_color_space_name / av_color_primaries_name (bt709), av_pix_format_name
  (yuv420p).
- avCodec: avcodec_get_name (h264) and avcodec_get_long_name.
- avSampleFmt: av_get_sample_fmt_name (u8).
- avInputFormat: name (mov,mp4,...) and long_name (QuickTime / MOV).
- avfilter: avfilter_name (abuffer), description, pad_get_name.
- avDictionary: av_dict_get_key_value copies KEY/VALUE; read both back.
- avError: av_strerror ran with no arguments; pass the real buffer and assert.
- av_log_get_flags ran with a stray argument; call the setter with an empty
  result span and the getter with none, then assert the flag.
- utils: initEmptyFrame asserts the av_frame_alloc run() result.

wasmedge_ffmpeg version, configuration/license, and codec-kind sweep:
- version exports (avutil, avcodec, avformat, avfilter, swresample, swscale):
  assert the major-version byte (>> 16) is nonzero, so a swap with a
  configuration/license length getter no longer passes.
- configuration/license copiers (all six modules): read back the buffer and
  require the configure-flag marker "--" to be present for configuration and
  absent for license, distinguishing the pair on both sides.
- avformatContext duration: replace the tautological check with the sample
  asset's exact duration.
- avcodec find_decoder_by_name / find_encoder_by_name: confirm the returned
  codec kind via av_codec_is_decoder / av_codec_is_encoder.

wasmedge_process:
- GetStdErr compares the StdErr buffer instead of the empty StdOut.
- GetExitCode seeds a nonzero Env.ExitCode and asserts it.

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
… duration

initFormatCtx opens the sample with avformat_open_input only, so
AVFormatContext::duration stays AV_NOPTS_VALUE until avformat_find_stream_info
runs. The prior EXPECT_EQ(..., 2000000) assumed a probed container duration and
failed on every ffmpeg CI job; assert the value the getter actually returns.

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
…dings observable

After dropping the concrete dynamic_cast lookups, several exports were only
checked for success or a non-negative result, so a same-signature binding swap
would pass undetected. Pin distinguishing values verified against ffmpeg 7.1:

- avPixfmt log2_chromaw/h: use YUV422P (1/0) so a width<->height swap fails.
- avSampleFmt bytes_per_sample: guest sample format 1 (U8) is exactly 1 byte.
- avutil log_set_level: call with an empty result span, assert run() succeeds,
  and use a non-default level so the getter proves the setter executed.
- avutil channel-layout helpers: assert nb_channels and the default mono layout,
  which differ between the two exports.
- avutil av_gettime vs av_gettime_relative: separate the wall-clock epoch from
  the smaller monotonic clock.
- swscale isSupportedInput/Output: PAL8 is input-only, distinguishing the pair.
- avStream duration/start_time/nb_frames/disposition: assert the sample's exact
  per-stream values.

Assisted-by: Claude (Anthropic)
Signed-off-by: hydai <z54981220@gmail.com>
@github-actions

Copy link
Copy Markdown

Super-linter summary

Language Validation result
GITLEAKS Pass ✅
GIT_COMMITLINT Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@0yi0 0yi0 marked this pull request as ready for review June 26, 2026 08:13
@0yi0 0yi0 merged commit 38d7801 into main Jun 26, 2026
3 checks passed
@0yi0 0yi0 deleted the 45-reimport-refresh branch June 26, 2026 09:23
0yi0 added a commit that referenced this pull request Jun 26, 2026
Upstream deprecated the wasmedge_llmc plugin (WasmEdge/WasmEdge#4964).
Rather than migrate it into cpp-plugins, remove it: drop the residual
plugins/wasmedge_llmc and test/plugins/wasmedge_llmc directories and the
add_subdirectory stanzas in plugins/CMakeLists.txt and
test/plugins/CMakeLists.txt. libpiper (wasi_nn) is unrelated and kept.

Rebased onto main after the refresh re-import (#50), whose upstream
deprecation commit had already emptied the plugin to stub CMakeLists.

Closes #36

Signed-off-by: Yi Huang <yi@secondstate.io>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

5 participants