feat(ffi): prove dart-to-rust pipeline and arm64 determinism on device
This commit is contained in:
@@ -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());
|
||||
}
|
||||
Reference in New Issue
Block a user