feat(ffi): prove dart-to-rust pipeline and arm64 determinism on device

This commit is contained in:
2026-10-24 22:27:48 +02:00
parent 214ab7aac7
commit e371c72a35
11 changed files with 276 additions and 114 deletions
+27
View File
@@ -0,0 +1,27 @@
//! Prints the reference state hash for the cross-target determinism probe.
//! Usage: `cargo run -p sim --example selftest -- [seed]`
use std::env;
use sim::fixed::from_int;
use sim::state::{Command, Sim};
fn main() {
let seed: u64 = env::args()
.nth(1)
.and_then(|a| a.parse().ok())
.unwrap_or(42);
let mut sim = Sim::default_match(seed);
sim.submit(Command::Fire {
angle_mdeg: 45_000,
power: from_int(1),
weapon: 1,
})
.expect("scripted command must be valid");
for _ in 0..300 {
sim.tick();
}
println!("seed={seed} sim_version={} hash={}", sim::SIM_VERSION, sim.state_hash());
}