feat: add correctness-gated benchmark harness and a second interpreter

Add a manifest-driven benchmark binary that verifies each fixture against
the independent reference and the GPU before timing it, reports per-stage
CPU and GPU durations with medians and quartiles, and writes metadata,
raw JSON and a markdown report. Extend the Metal backend with a profiled
execution path that reads command-buffer GPU start and end times.

Add a structurally independent second interpreter for the demo subset in
the semantic-review suite. It imports neither the decoder, ISA nor
reference and re-derives the encodings from the RDNA 2 field layout. A
differential test compares both interpreters across all three fixtures on
boundary-dense and pseudorandom inputs.

Signed-off-by: Ranveer Soni <git@ranveersoni.me>
This commit is contained in:
Ranveer Soni committed 2026-11-22 14:20:32 +05:30
1 parent 42fb3f67ad
commit 90e984dc77
15 files changed
+1378 -4

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
set -eu
cd "$(dirname "$0")/.."
# Timing runs must be on an idle machine with validation off.
export MTL_DEBUG_LAYER=${MTL_DEBUG_LAYER:-0}
export MTL_SHADER_VALIDATION=${MTL_SHADER_VALIDATION:-0}
export CARGO_BUILD_JOBS=${CARGO_BUILD_JOBS:-4}
cargo build --locked --release -p xenora-benchmarks
exec ./target/release/xenora-bench "$@"
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
set -eu
cd "$(dirname "$0")/.."
# Source mutation campaign for the critical Phase 01 modules.
# R2 owns execution and survivor triage; this script only reproduces the run.
# Tests run for the mutated package only (cargo-mutants default), so this stays
# CPU-only and never dispatches GPU work.
out=${1:-artifacts/mutation/campaign-$(date +%Y%m%d-%H%M%S)}
mkdir -p "$out"
export CARGO_BUILD_JOBS=${CARGO_BUILD_JOBS:-2}
cargo mutants --workspace \
--file 'crates/decoder/src/**' \
--file 'crates/shader/src/**' \
--file 'crates/ref/src/**' \
--jobs 2 \
--timeout 60 \
--output "$out"