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:
@@ -37,6 +37,7 @@ fn fixture_snapshot(tick: u64, entities: Vec<VisibleEntity>) -> ObserverSnapshot
|
||||
dialogue_response: None,
|
||||
blocked_entities: vec![],
|
||||
scan_events: vec![],
|
||||
rng_seed: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,6 +209,7 @@ fn generate_msgpack_fixtures() {
|
||||
dialogue_response: None,
|
||||
blocked_entities: vec![],
|
||||
scan_events: vec![],
|
||||
rng_seed: None,
|
||||
};
|
||||
write_fixture(
|
||||
"snapshot_v2_full",
|
||||
|
||||
Reference in New Issue
Block a user