{"id":20009788,"url":"https://github.com/plsyssec/simd-decoding","last_synced_at":"2026-06-10T00:30:59.261Z","repository":{"id":50226058,"uuid":"518610228","full_name":"PLSysSec/simd-decoding","owner":"PLSysSec","description":"Collection of scripts necessary for comparative analysis of sandboxed decoding with SIMD128","archived":false,"fork":false,"pushed_at":"2023-11-29T02:18:51.000Z","size":9884,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T14:37:35.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PLSysSec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-27T21:00:29.000Z","updated_at":"2022-09-19T23:46:15.000Z","dependencies_parsed_at":"2025-01-12T14:32:52.840Z","dependency_job_id":"3ffdc096-5997-4ee6-bb58-6edb1e866449","html_url":"https://github.com/PLSysSec/simd-decoding","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2Fsimd-decoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2Fsimd-decoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2Fsimd-decoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLSysSec%2Fsimd-decoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PLSysSec","download_url":"https://codeload.github.com/PLSysSec/simd-decoding/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241447522,"owners_count":19964314,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T07:17:05.295Z","updated_at":"2026-06-10T00:30:59.249Z","avatar_url":"https://github.com/PLSysSec.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simd-decoding\n\n## Overview ##\nThis repository contains files necessary for testing a simple image decoding operation using `libpng` with SIMD instructions when compiled to WebAssembly. Note that this build uses wasi-sdk version 14.0, WASM-Micro-Runtime (WAMR), and WebAssmebly Binary Toolkit (WABT). Additionally, note that `libz` must be installed for `libpng` to build. \nThe `build.sh` script provides a method for building the `libpng` library with and without SIMD instructions and with a native or WASM target. For the WebAssembly target, `zlib` must be built to WASM before building the `libpng` library. This is dones by using:\u003cbr /\u003e\n\n```shell\nexport PATH=${WASI_SDK_PATH}/bin:$PATH\nexport PATH=${WASI_SDK_PATH}/bin/ranlib:$PATH\ncd ${ZLIB_PATH}\nCC=${WASI_SDK_PATH}/bin/clang ./configure --prefix=${WASI_SDK_PATH}/share/wasi-sysroot\nmake \u0026\u0026 make install\n```\n\n### WAMR and wasm2c ###\n\nThe `wamr_decode.sh` script compiles a `decode.c` file to WebAssembly. Then, using WAMR's AOT compiler, an `.aot` module is generated to be executed with WAMR's iwasm VM Core (This script should only be used when working with the WASM target). The 'full_test.sh' script performs a test of execution speed for the built libpng library. \n\n```\ndecode.c -\u003e decode.wasm -\u003e decode.aot\n```\n\nThe `wasm2c_decode.sh` script compiles a `decode.c` file to WebAssembly and then utilizes the `wasm2c` compiler provided by the [wasm2c_sandbox_compiler](https://github.com/wrv/wasm2c_sandbox_compiler/tree/simdeverywhere). This generates C code which can be compiled to native code with `gcc` and the `main.c` file. *This step is currently non-functional.* \n\n```\ndecode.c -\u003e decode.wasm -\u003e decode.c -\u003e native code\n```\n\n## Benchmark Environment Setup ##\n\nTo setup the benchmarking environment, we first disable CPU frequency scaling and set the system to performance mode (using `cpufrequtils`):\n\n```shell\necho GOVERNOR=\"performance\" \u003e\u003e /etc/default/cpufrequtils\nsudo systemctl disable ondemand\n```\n\nTo set CPU isolation and shielding, we run\n\n```shell\nsudo nano /etc/default/grub\n```\n\nand add `isolcpus=1` to `GRUB_CMDLINE_LINUX_DEFAULT`. Then, to set CPU shielding, \n\n```shell\nsudo cset shield -c 1 -k on\n```\n\n## Testing ##\n\nThere are four tests that can be run, depending on whether SIMD instructions are enabled or disabled and whether we are building to a native or WASM target. Each test can be run as follows:\n\n### Native Target with SSE Instructions ###\n\n```shell\nbash build.sh -s\ntaskset -c 1 bash full_test.sh -s\n```\n\n### Native Target without SSE Instructions ###\n\n```shell\nbash build.sh\ntaskset -c 1 bash full_test.sh\n```\n\n### WASM Target with SIMD128 Instructions ###\n\n```shell\nbash build.sh -s -w\nbash wamr_decode.sh -s\ntaskset -c 1 bash full_test.sh -s -w\n```\n\n### WASM Target without SIMD128 Instructions ###\n\n```shell\nbash build.sh -w\nbash wamr_decode.sh \ntaskset -c 1 bash full_test.sh -w\n```\n\n## Comparative Analysis ##\n\nIndividual statistical analysis is run for each case in the `full_test.sh` script. A comparative analysis among all cases can be run proceeding all individual tests using\n\n```shell\npython3 comp_analysis.py\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplsyssec%2Fsimd-decoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplsyssec%2Fsimd-decoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplsyssec%2Fsimd-decoding/lists"}