feat(bridge): add rng_seed to ObserverSnapshot for deterministic replay (#527)
Adds rng_seed: Option<u64> to ObserverSnapshot. The WRONG button (#507) captures inputs.jsonl and seed.txt for replay, but seed.txt was writing "unavailable" because the server did not include the RNG seed in ObserverSnapshot. Changes: - bridge/types.rs: PROTOCOL_VERSION 9→10, rng_seed field with serde(default, skip_serializing_if = "Option::is_none") for backward compatibility - perception/observer/mod.rs: inject Res<SimRng> into compute_observer_snapshot, populate rng_seed: Some(rng.seed()) each tick - All test files: add rng_seed: None to ObserverSnapshot constructors - tests/serialization.rs: bump protocol_version_constant assertion 9→10 - Regenerate msgpack fixtures and golden file for protocol v10 Completes the WRONG button capture loop: replays can now fully reproduce observed bugs with the exact RNG seed from the capture. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,7 +52,7 @@ pub fn compute_visibility_geometry(
|
||||
///
|
||||
/// System ordering: after compute_visibility_geometry + compute_nearby_interactions,
|
||||
/// before advance_tick.
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[allow(clippy::type_complexity, clippy::too_many_arguments)]
|
||||
pub fn compute_observer_snapshot(
|
||||
time: Res<SimulationTime>,
|
||||
geometry: Res<VisibilityGeometry>,
|
||||
|
||||
Reference in New Issue
Block a user