Compute the breeze's long-jump vector with jmath; run every harness on the Mac

The Mac mini no longer excludes options, chunk_generation,
world_border_render and mob_ai: their float maths now matches vanilla's
on Apple silicon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-13 03:12:59 +02:00
parent ab9109c787
commit 6aa875c6c2
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -6,7 +6,7 @@ use super::{
anim::{Poses, State},
keyframes::Animation,
};
use horizon_core::{geometry::Vec3, random::RandomSource};
use horizon_core::{geometry::Vec3, jmath, random::RandomSource};
use std::collections::HashMap;
// `variant3` is the pose, `variant` the pose the animations last saw,
@@ -96,9 +96,9 @@ fn jump_vector(m: &Mob, target: Vec3, max_velocity: f32, angle: i32) -> Option<V
let r = r2.sqrt();
let y = d.y;
let g = m.gravity();
let sin2 = f64::from(2.0 * angrad).sin();
let cos_sq = f64::from(angrad).cos().powf(2.0);
let (sin, cos) = (f64::from(angrad).sin(), f64::from(angrad).cos());
let sin2 = jmath::sin(f64::from(2.0 * angrad));
let cos_sq = jmath::pow(jmath::cos(f64::from(angrad)), 2.0);
let (sin, cos) = (jmath::sin(f64::from(angrad)), jmath::cos(f64::from(angrad)));
let v0sq = r2 * g / (r * sin2 - 2.0 * y * cos_sq);
if v0sq < 0.0 {
return None;
@@ -108,7 +108,7 @@ fn jump_vector(m: &Mob, target: Vec3, max_velocity: f32, angle: i32) -> Option<V
return None;
}
let (v0r, v0y) = (v0 * cos, v0 * sin);
Some(Vec3::new(v0r * xz.cos(), v0y, v0r * xz.sin()).scale(f64::from(0.95_f32)))
Some(Vec3::new(v0r * jmath::cos(xz), v0y, v0r * jmath::sin(xz)).scale(f64::from(0.95_f32)))
}
/// `LongJump.calculateOptimalJumpVector`: the allowed angles shuffled, the
/// first that reaches the target.
+1 -1
View File
@@ -32,7 +32,7 @@ Every runner on the machine shares `PARITY_MACHINE_JOBS` slots (default: half th
Harnesses can also run on the Mac mini and the ThinkPad (`tools/parity_hosts.json` describes them; its `default` list is empty, so pass `--hosts macmini,thinkpad` or set `PARITY_HOSTS`, after copying `shared-local/` to `~/code/horizon-parity/shared-local` on each host). The runner mirrors the worktree there with rsync (not `.git`, `.local`, `target` or ignored files) into `~/code/horizon-parity/remote/<host><path>`, whose `.local` links to the vanilla data in `~/code/horizon-parity/shared-local`, and starts `tools/parity.py --worker` over ssh. The worker builds the probes (about 80 s the first time) and runs what it is sent under the same tracer, admitting harnesses against its own free memory. One queue, longest first, feeds every machine, remote ones first: the Mac takes up to 14 harnesses, the desktop 3 and only those under 800 MB. Each pass comes back with the content hash of every file it depended on, so it is keyed on exactly what ran, and logs come back to `.local/parity-runner/logs/`; state, sharing and `gate.py` work as before. If a host can't be reached, or drops out, its harnesses run here.
Harnesses a host can't run are listed in the file: `local_only` (`save_roundtrip` runs the game on a virtual screen) and each host's `exclude`. On macOS, `options` and `chunk_generation` differ because Rust's float functions (`f64::powf` and the like) use the platform libm, which rounds differently from glibc; every other harness gave the same result on the Mac as on Linux. The ThinkPad helps too, gently: Linux, 2 harnesses at `nice 19`, since it hosts the Claude account pool; it finds ALSA through `~/code/horizon-parity/alsa-dev` like the desktop.
Harnesses a host can't run are listed in the file: `local_only` (`save_roundtrip` runs the game on a virtual screen) and each host's `exclude`. The Mac excludes nothing: vanilla's `Math.sin`, `pow`, `log` and the like don't round the same on an Apple silicon Mac as on Linux (HotSpot uses fdlibm there, Intel's stubs on x86-64), and Rust's float functions round like neither (they call the platform libm), so code that mirrors a vanilla `Math` call uses `horizon_core::jmath`, which computes what HotSpot computes on the host architecture. The ThinkPad helps too, gently: Linux, 2 harnesses at `nice 19`, since it hosts the Claude account pool; it finds ALSA through `~/code/horizon-parity/alsa-dev` like the desktop.
### Shards and Rust scopes