Does your code behave the same on ARM64?
Ounce-Core runs a program on three CPU engines and compares the output with real ARM64 hardware.
The problem
You ship a library built on x86. Will it give the same answer on ARM64? You may not own an ARM64 machine to find out.
Ounce-Core runs the program and diffs its output byte for byte against a reference recorded on real ARM64 hardware. When the two differ, it helps you find where they split. It is open source and written in Rust.
What it has done
- It found real bugs. In one week of running unmodified open-source programs (LZ4, xxHash, SQLite, Lua) against an Apple Silicon Mac, it found a prefetch instruction that corrupted registers, two floating-point instructions with the wrong sign, and many missing vector instructions. All were fixed, each with a test.
- It agrees with the hardware on real programs. LZ4, xxHash, SQLite 3.50.4, Lua 5.4.7 and a 5,964-line floating-point test give byte-identical output on Tier-3, Tier-4 and native. 18 programs also run as static Linux ARM64 programs and match a host build and qemu-user. The older corpus of 50/50 outside homebrew programs passes its pixel checks, on the inputs those checks cover.
- It is safe Rust. The runtime forbids
unsafecode, and the compiler enforces it. The two small crates that need it are kept apart, and CI checks the boundary.
Limit: this is a testing tool, not a fast emulator. It does not run arbitrary programs, instruction coverage is partial, and a match is evidence for the inputs tested, not proof. Read the limits.
Try it
In your browser. Step through ARM64 code one instruction at a time. Nothing to install.
On your machine. You need Rust 1.85 or newer. On Debian or Ubuntu, first run sudo apt-get install -y libasound2-dev libudev-dev.
git clone https://github.com/hffgzktbcc-blip/ounce-core.git && cd ounce-core
cargo build --release
cargo run --release -- run tests/fixtures/nro/hello/hello.nro fixture
The last command runs a small test program and prints result=0x00000EEE. To check your own program against a host build, see Add a program.
Help out. Have an ARM64 machine? Run the test suite and report the result. Otherwise pick a no-code task or a good first issue. More on the contribute page.
More
- Results and status
- Research paper and Beyond the first frame
- For library maintainers
- Details: subsystems, proof method, commands, roadmap
- Reproduce the results
- Press kit