cranelift-auditor

Audit Cranelift compiler code to find bugs and miscompilations with reproducible test cases.

18.6k|1.8k|Updated Aug 29, 2017
One-click install
npx skills add https://github.com/bytecodealliance/wasmtime --skill cranelift-auditor-bytecodealliance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cranelift-auditor
Source: https://github.com/bytecodealliance/wasmtime/tree/main/.agents/skills/cranelift-auditor
Command: npx skills add https://github.com/bytecodealliance/wasmtime --skill cranelift-auditor-bytecodealliance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Finding new, undiscovered bugs in the Cranelift compiler is difficult because miscompilations and logic errors can hide in optimization passes, lowering rules, and backend-specific ABI code, yet they can lead to sandbox escapes in Wasmtime. This Skill guides a systematic audit of the Cranelift codebase to surface real, demonstrable bugs. ## Core Features & Use Cases - Structured Bug Hunting: Defines what counts as a bug (incorrect optimizations, incorrect lowering rules, backend ABI bugs, logic errors) and excludes known or already-fixed issues. - Reproducible Bug Reports: Requires every finding to include a *.clif test case executed with clif-util, including differential execution against the Cranelift interpreter and cross-architecture testing via QEMU userspace emulation. - Organized Audit Output: Produces numbered report folders (reports/NNN-description) with human-readable report.md files plus intermediate findings in reports/findings/, preserving results from previous audits. - Use Case: A security researcher auditing Wasmtime before a release uses this Skill to methodically review Cranelift optimization passes, confirm a miscompilation with a clif test on x86 and aarch64 via QEMU, and file a complete bug report. ## Quick Start Audit the Cranelift codebase for new miscompilation bugs and write reproducible clif test cases for any findings into the reports folder.

Frequently Asked Questions about cranelift-auditor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Cranelift for miscompilation bugs?

Review Cranelift's optimization passes, lowering rules, and backend ABI code for logic errors, then confirm each suspected bug with a *.clif test case run through clif-util. Differential execution against the built-in Cranelift interpreter demonstrates the incorrect behavior.

How do I write a reproducible Cranelift bug report?

A valid report needs a clear explanation referencing the buggy code plus a *.clif test case executed with clif-util that demonstrates the bug. Place the report and artifacts in a numbered folder like reports/001-description with a report.md file.

Can I test Cranelift backends for other CPU architectures?

Yes, on Linux you can use QEMU userspace emulation to run tests for non-native architectures. Compile clif-util with Cargo's --target flag for the target architecture, then execute it with qemu-$arch.

What kinds of bugs count in a Cranelift audit?

Qualifying bugs include incorrect optimizations, incorrect lowering rules, backend-specific ABI bugs, and other logic errors present in the current code. Known issues, already-fixed bugs, and previously reported findings are excluded.

Should I fix the bugs I find during the audit?

No, the audit role is finding bugs, not fixing them. You may recommend how a bug could be fixed, but the primary deliverable is a verified bug report with a reproducible test case.