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:
@@ -64,9 +64,10 @@
|
||||
"player_facing": "North",
|
||||
"player_inventory": [],
|
||||
"player_stance": "Sprint",
|
||||
"rng_seed": 42,
|
||||
"scan_events": [],
|
||||
"tick": 8,
|
||||
"version": 9,
|
||||
"version": 10,
|
||||
"visible_tiles": [
|
||||
{
|
||||
"tile_kind": "Wall",
|
||||
|
||||
Reference in New Issue
Block a user