Repository navigation
Deterministic saves, replay apply, and macOS greybox golden - #381
Conversation
Health replay events write CHealth, autosave stores the replay log, and the ECS blob records the sim tick. A greybox fight reload hashes like the source when the ground log is unchanged. The greybox golden now runs on macOS. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
PlayerInventory.credits has no owning component, so save_game no longer copies CAmmo into it. The fight reload test checks tick, motor mode, attack phase, lock, cover, and the enemy after restore. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71e0ffc5b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if checkpoint.edits.is_empty() && checkpoint.demolition == self.ground.demolition_log() { | ||
| return Ok(Vec::new()); |
There was a problem hiding this comment.
Rebuild terrain when restoring an empty checkpoint
When a pristine checkpoint is loaded into the already-running Greybox after place_sphere or another edit that does not change the demolition log, this condition is true even though self.ground.edits is nonempty. Returning here skips restore_dug and sync_dirty, so the loaded game retains the newer voxel edits, meshes, and collision bodies instead of restoring the saved terrain; only skip rebuilding after also confirming the current edit log is empty/equivalent. .github/copilot-instructions.mdL32-L32
Useful? React with 👍 / 👎.
| .then_with(|| left.1.event_type.cmp(&right.1.event_type)) | ||
| .then_with(|| left.1.data.cmp(&right.1.data)) | ||
| }); | ||
| rows.into_iter().map(|(_, event)| event).collect() |
There was a problem hiding this comment.
Preserve per-entity replay targets
When more than one entity owns a CReplayState, this conversion discards the entity ID after sorting, so the saved metadata cannot associate events with their original actors. start_replay then returns one flattened CReplayState, and apply_replay_event writes every due health event to whichever entity carries that state, causing multi-actor replays to produce incorrect health state; persist a target identifier and remap it during restoration instead of dropping it here. .github/copilot-instructions.mdL40-L40
Useful? React with 👍 / 👎.
Description
Saves and replays round-trip the sim state. Head
71e0ffc5.#283 checkpoint fields
Each field is on
Checkpointinaravath_runtime/src/save.rsand is written into the save meta bysave_checkpoint.Greybox::checkpointfills them andGreybox::restoreputs them back.Checkpoint.enemies: Vec<SavedEnemy>(enemiesmeta)restored_fight_hashes_like_the_sourceasserts one enemy at 17 health afterrestore, thenstate_hashmatches the sourceCheckpoint.motor_mode(motormeta)MotorMode::Rollafterrestoreattack_time,attack_swinging,attack_hit(attackmeta)0.12, swinging, and hit landed afterrestoreCheckpoint.lock: Option<usize>(lockmeta)Some(0)afterrestoreCheckpoint.tick(tickmeta andWorldState.tick)40afterrestoreCheckpoint.cover_broken(covermeta)cover_brokenafterrestoreThe test is
sim::tests::restored_fight_hashes_like_the_sourceinaravath_runtime/src/sim.rs. It saves, loads, restores into a freshGreybox, checks those fields, and requiresgameplay_hashandstate_hashto match the source.greybox_checkpoint_replay_is_stable_and_writteninaravath_runtime/tests/checkpoint_replay.rschecks the same fields on the loaded checkpoint (motor Roll, swinging attack, lockSome(0), one enemy,cover_broken, tick 30).Inventory credits
PlayerInventory.creditsis not its own state. The struct inpersistence/aw-save/src/lib.rsis the example inventory slot onSaveBundleV2. No ECS component, resource, or greybox field stores a credit balance.CAmmo.roundsis ammunition. Questrewards.currencyis a reward figure, not a wallet.EchoCurrencylives inastraweave-weavingand is not this field.save_gamewritescredits: 0, which is what the greybox and veil saves already write. The earlier ammo sum was a stand-in and is removed.persistence_manager_save_has_creditslocks that zero.Already fixed on main
22741c427f63b5a3d7d9498a26cb5dc8a413f8f6in PR fix: close save, quest, checkpoint, and replay determinism holes #332 (sim_save_id,sim_timestamp,gameplay_hash).22741c427f63b5a3d7d9498a26cb5dc8a413f8f6in PR fix: close save, quest, checkpoint, and replay determinism holes #332 (CActiveQuest::at_tick,Utc::nowremoved).cdea968cd5008c29a5813df13da34fa8d71590d7in PR Aravath demo: CC0 characters, streamed world, and sword combat #205 (MAX_SCAR_CELLS = 4096inastraweave-veil/src/save_blob.rs, rejected infrom_postcardbefore insert).This branch does not re-fix those three.
Fixes #281
Fixes #283
Fixes #284
Supply-chain and Scorecard checks (#305–#311, #313) are left to the security agent.
Type of change
Security Considerations
PlayerInventory.creditsstays 0. Scar loads still reject more than 4096 cells before insert.Checklist