Files
xenia-rs/audit-runs/stage0-quantum-sweep/sweep.sh
MechaCat02 ef93a4fa14 handoff: VSync/event-wedge fixes + iterate 2.A–2.BC research notes
Source changes (dormant parity infra, retained from iterate 2.AI/2.AO):
- xenia-kernel/exports.rs: nt_create_event manual_reset polarity +
  related event wiring
- xenia-gpu/mmio_region.rs: D1MODE_VBLANK_VLINE_STATUS hardcode parity

Also lands the audit-runs/ analysis notes (.md/.txt/.json digests) for the
iterate 2.x VSync/0x10e8/0x1004 wedge investigation. Raw trace dumps
(.jsonl/.gz/.csv/.stdout) and agent worktrees (.claude/) are gitignored as
regenerable local artifacts — see memory + HANDOFF for the running findings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 07:19:08 +02:00

52 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# Stage 0 — cycle-quantum preemption sweep
#
# Runs xenia-rs-stage0 in OrderMode::ScanQuantum at quanta
# [10, 50, 200, 1000, 5000, 10000] x 3 cold boots, computes the
# det-fields MD5 over each JSONL output, and records the matched-prefix
# vs the archived canary cold baseline.
#
# Outputs:
# /tmp/stage0/ours-q${ticks}-r${run}.jsonl — raw events
# /tmp/stage0/digest-q${ticks}-r${run}.json — det-fields MD5
# audit-runs/stage0-quantum-sweep/diff-q${ticks}.txt — diff_events.py output
set -euo pipefail
REPO="/home/fabi/RE - Project Sylpheed"
ISO="$REPO/Project Sylpheed - Arc of Deception (USA, Europe) (En,Ja).iso"
BIN="$REPO/xenia-rs/target/release/xenia-rs-stage0"
DET="$REPO/xenia-rs/audit-runs/stage0-quantum-sweep/det_digest.py"
DIFF="$REPO/xenia-rs/tools/diff-events/diff_events.py"
CANARY_BASELINE="$REPO/xenia-rs/audit-runs/phase-c22-rtl-enter-leave-control-flow/canary-cold-trunc.jsonl"
SWEEP_DIR="$REPO/xenia-rs/audit-runs/stage0-quantum-sweep"
mkdir -p /tmp/stage0
RESULTS="$SWEEP_DIR/sweep-results.tsv"
echo -e "ticks\trun\ttotal_events\tdet_fields_md5" > "$RESULTS"
for q in 10 50 200 1000 5000 10000; do
for run in 1 2 3; do
out="/tmp/stage0/ours-q${q}-r${run}.jsonl"
log="/tmp/stage0/ours-q${q}-r${run}.log"
digest_file="/tmp/stage0/digest-q${q}-r${run}.json"
XENIA_CACHE_WIPE=1 XENIA_SCHED_ORDER=quantum XENIA_SCHED_QUANTUM=$q \
"$BIN" exec --phase-a-event-log "$out" -n 50000000 --quiet "$ISO" \
> "$log" 2>&1
python3 "$DET" "$out" > "$digest_file"
events=$(python3 -c "import json; print(json.load(open('$digest_file'))['total_events'])")
digest=$(python3 -c "import json; print(json.load(open('$digest_file'))['det_fields_md5'])")
echo -e "${q}\t${run}\t${events}\t${digest}" >> "$RESULTS"
echo "ticks=${q} run=${run} events=${events} digest=${digest}"
done
# Diff run-1 vs canary baseline
diff_out="$SWEEP_DIR/diff-q${q}.txt"
python3 "$DIFF" \
--canary "$CANARY_BASELINE" \
--ours "/tmp/stage0/ours-q${q}-r1.jsonl" \
--tid-map 6=1,7=2,4=11,12=7,14=9,15=10 \
> "$diff_out" 2>&1 || true
done
cat "$RESULTS"