Repository navigation
Retire the dormant float destruction manager - #406
Conversation
astraweave-destruction already owns fracture, debris, and break strength. The physics float manager, its bench, and process_destructible_hits had no production caller. break_destructible still removes the body. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
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 |
Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
There was a problem hiding this comment.
Requesting changes. Deleting the float manager is the right cut. On the base commit, DestructionManager had no caller outside astraweave-physics tests and benches/destruction.rs. process_destructible_hits was empty, and PhysicsWorld::step never called it. The hashed path stays in astraweave-destruction (Fixed64, ordered Vec, 256-slot debris). break_destructible still only calls remove_body.
Two problems in the diff need a fix before this should land.
-
Physics trace v1.13 says the file is gone and stamps
ae523346as verified, while §5, §6, §10, §11, and Appendix A still describedestruction.rs,DestructionManager,process_destructible_hits, andbenches/destruction.rsas present and Active.docs/architecture/destruction.md§6 still says the manager is left in place. The trace's own check is to match §5 to thepub modlist.lib.rsno longer hasmod destruction. #330's gravity deletion at least marked the leftover paragraphs as historical. This bump does not. -
New invariant 19 says fracture state changes go through
astraweave-destruction.PhysicsWorlddoes not write aDestructionCommand. A contact still changes nothing in the support graph.break_destructibleonly removes the Rapier body.
Holding, from the base tree and this diff:
- No new dependency.
cargo-denyis green on this head. Nounsafe. The crate still has#![forbid(unsafe_code)]. The deleted file importedglam::Vec3andHashMaponly. - In-repo
.rscallers ofastraweave_physics::destructionon the base were the bench and the tests this PR deletes.examples/physics_demo3dstill compiles againstadd_destructible_boxandbreak_destructible. - The
destructionreplay case hashesdemolition_bytes. This diff does not touch that function, the command log, orPhysicsWorld::step. The other eighteen required cases do not read the removed module. Replay jobs on this head were still pending, so I did not re-run them. - The old
max_debriscap lived only on the dormant manager. The production pool remains the 256-slot array.
Also in the diff, not blocking a compile: planar_cut_is_stable asserts that a [SupportNode; 2] has length 2, and checks BreakRule::stone() from a planar-cut test. The crate docs now list the character controller twice. The README row still uses the removed type name. #255 also asked to retarget physics_demo3d or drop the break key. Key M still only deletes a body, and the health and break-impulse arguments are still ignored.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
Invariant 19 now says PhysicsWorld does not write DestructionCommand and break_destructible only removes the Rapier body. planar_cut_is_stable checks the cut. Key M stays a delete; the window is deferred in #411. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
There was a problem hiding this comment.
Requesting changes. Deleting the float manager is still the right cut, and the five notes from 62bc7e31 are fixed on 6dbdb4fd: the physics and destruction traces now mark destruction.rs, DestructionManager, process_destructible_hits, and benches/destruction.rs historical; invariant 19 matches break_destructible; the planar-cut test locks the cut; the stone strength test is separate; the crate docs and README no longer export the removed type.
One sentence this diff rewrote is still false. Appendix A item 4 calls add_water_aabb a stub, and v1.14 stamps the trace verified against that text. The function registers a water volume. Details are on the line.
What I checked and am holding:
- No production caller of the removed module on the base or on this head. In-repo
.rshits forDestructionManager,FracturePattern,DebrisShape, andprocess_destructible_hitsare gone.break_destructibleisremove_body(lib.rs:1670-1672).PhysicsWorld::stepdoes not enqueueDestructionCommand. The physics crate's onlyDestructionCommandwrites are insidedeformed_replay, which this diff does not touch.astraweave-destructionwas already a physics dependency and is still used bydeformed.rs(GeometryNotice,allows_climb). No new dependency.#![forbid(unsafe_code)]is unchanged. The deleted file importedglam::Vec3andHashMaponly. cargo-denyandcargo-auditare green on this head. OpenSSF Scorecard passed. The trace-sync job passed. Replay-hash jobs were still pending, so this run does not claim the nineteen cross-OS digests.fracture.rsproduction code is unchanged.cargo test -p astraweave-destruction --lib -- planar_cut_is_stable stone_break_strength_is_one_hundred prefracture_manifest_hash_is_locked bake_is_stablepassed, including the locked prefracture digest.cargo test -p astraweave-physics --lib break_destructiblepassed (test_break_destructible,remove_body_drops_transform_and_break_destructible_delegates). Floatcbrt/HashMappiece-count tests stayed deleted.- §5 module list matches
lib.rs. Tests directory is the 22 names in the trace. Benches directory is the 8 names.astraweave-destruction/benches/destruction.rsexists. #255 item 2 is tracked on #411, which has the deferred-failure label and an exit criterion that key M is not onlybreak_destructible.
Also, not blocking the compile: appendix item 11 still says four maps, and environment_tests.rs now warns on an unused PhysicsWorld import. CLAUDE.md still names process_destructible_hits as a live stub, and docs/current/DESTRUCTION_ARCHAEOLOGY.md still describes the deleted 2,788-line file. The trace owner notes still point at that survey.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
add_water_aabb registers an AnalyticWater AABB. remove_body clears climb_flags with the other four maps. environment_tests no longer imports PhysicsWorld or claims to test destruction. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
There was a problem hiding this comment.
No blocking findings on ca73eba9. The three notes from 6dbdb4fd are fixed, and deleting the float manager is still the right cut.
What I checked against this head:
add_water_aabbislib.rs:1522and callsself.water.add_aabb.AnalyticWaterstores the fourth argument aslinear_dragandsampledoes not read it (astraweave-water/src/lib.rs).apply_buoyancy_forceswalks onlybuoyancy_bodies. The drag term isvel * BuoyancyData.drag, then the force is applied asforce * dt.columns.sampleruns first (lib.rs:1499), so a column hit hides the AABB. Invariant 17's "can return" still matches that.remove_body(lib.rs:1652-1666) clearsbody_ids,body_kinds,char_map,buoyancy_bodies, andclimb_flags.break_destructible(lib.rs:1670) only calls that.PhysicsWorldstill does not writeDestructionCommand. The physics crate's onlyDestructionCommandwrites are insidedeformed_replay, which this diff does not touch.environment_tests.rsno longer importsPhysicsWorld, and the header no longer says the file tests destruction.- No in-repo
.rscaller remains forDestructionManager,FracturePattern,DebrisShape, orprocess_destructible_hits.#![forbid(unsafe_code)]is unchanged.Cargo.tomlonly drops the[[bench]] name = "destruction"entry.Cargo.lockis unchanged, so there is no new dependency.deformed.rsstill usesastraweave-destruction.fracture.rsproduction code is unchanged.planar_cut_is_stablelocks the ids, the axis-0 half, the shifted positions, and the mass split. The floatcbrt/HashMaptests stay deleted. cargo-denyandcargo-auditpassed on this head. Trace-sync passed. Rust since6dbdb4fdis unchanged (this push is the trace plus the environment-test header), so I did not rebuild. Replay-hash jobs are still pending, so this run does not claim the nineteen cross-OS digests.
Two leftovers are on the lines below. They do not block the lib clippy gate. CLAUDE.md, docs/current/DESTRUCTION_ARCHAEOLOGY.md, and the destruction-trace owner notes still describe the deleted file. add_water_aabb's rustdoc still says bodies inside the box receive buoyancy; they still need add_buoyancy, and a column sample wins first. The trace trap already says that. examples/physics_demo3d key M still only deletes a body. That stays on #411, which has the deferred-failure label.
This can land.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
| | `astraweave-physics/src/vehicle.rs` (4,869 LoC) | `Vehicle`, `VehicleManager`, `VehicleConfig`, `WheelConfig`, `WheelPosition`, `WheelState`, `DrivetrainType`, `EngineConfig`, `FrictionCurve`, `TransmissionConfig`, `VehicleInput`, `VehicleId` | Active (module-level) | Raycast-suspension model (industry standard). Per `vehicle.rs:1-7` doc-comment. | | ||
| | `astraweave-physics/src/environment.rs` (3,401 LoC) | `EnvironmentManager`, `WindZone`, `WindZoneConfig`, `WindType`, `WindZoneShape`, `WindZoneId`, `WaterVolume`, `WaterVolumeId`, `GustEvent` | Active (module-level) | Separate from `PhysicsWorld::wind: Vec3` (a bare global wind vector on `PhysicsWorld` itself). | | ||
| | `astraweave-physics/src/destruction.rs` (2,788 LoC) | `DestructionManager`, `Destructible`, `DestructibleConfig`, `DestructibleId`, `DestructibleState`, `DestructionEvent`, `DestructionTrigger`, `FracturePattern`, `Debris`, `DebrisConfig`, `DebrisId`, `DebrisShape` | Active (module-level) | Separate from `PhysicsWorld::add_destructible_box` (`lib.rs:1556`) which is a passthrough to `add_dynamic_box`. | | ||
| | `astraweave-physics/src/destruction.rs` | `DestructionManager`, `Destructible`, `FracturePattern`, `Debris`, `DebrisShape`, `process_destructible_hits` | **Removed** (historical) | Deleted. Not a `pub mod`. `PhysicsWorld` does not write `DestructionCommand`. `break_destructible` only removes the Rapier body. Fracture is `astraweave-destruction`. | |
There was a problem hiding this comment.
Non-blocking. This row lists process_destructible_hits as a symbol of destruction.rs. On the base commit the function was PhysicsWorld::process_destructible_hits at lib.rs:1685, an empty method. It was not in destruction.rs.
The §6 row already says "was lib.rs", which matches the base. Drop the name from this file's symbol list so the two rows agree.
| destruction::{DestructibleConfig, DestructibleId, DestructionManager}, | ||
| projectile::{ProjectileConfig, ProjectileKind, ProjectileManager}, | ||
| ragdoll::RagdollConfig, | ||
| spatial_hash::SpatialHash, |
There was a problem hiding this comment.
Non-blocking for the lib clippy gate. The same class of warning as the PhysicsWorld import that just left environment_tests.rs.
test_vehicle_config_with_destruction_compatible_mass was the only use of VehicleConfig. That test is gone, and the next import line still names VehicleConfig. The file header still says vehicles interact with destruction. Drop the import.
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.
Adversarial review of ca73eba9 (base 417f267f). No blocking defect. This can land.
What the diff actually does
Deletes the dormant float manager (astraweave-physics/src/destruction.rs, 2,793 lines), its bench, and PhysicsWorld::process_destructible_hits. break_destructible still only calls remove_body (lib.rs:1670-1671). add_destructible_box still ignores health and break impulse and calls add_dynamic_box (lib.rs:1638). Production planar_children is unchanged. The new fracture tests lock the cut that is already in the function: child ids from mix_sim_seed, axis-0 half and shifted positions, mass split with the remainder on the second piece, and copied flags, structure, and island. BreakRule::stone().strength is locked at Fixed64::from_int(100) in its own test. The float piece-count and cbrt formulas were not copied onto the integer crate.
Callers and dependencies
Workspace *.rs search on this head finds no remaining DestructionManager, FracturePattern, DebrisConfig, or astraweave_physics::destruction import. Live callers of the methods that stayed are examples/physics_demo3d, benches/rigid_body.rs, and the physics tests. Combat, weaving, nav, terrain, and aravath_runtime import astraweave-destruction, not the deleted module. deformed_replay is still the only DestructionCommand writer in the physics crate. It enqueues onto a DestructionWorld, not PhysicsWorld, and this diff does not touch it. Invariant 19 matches that boundary.
remove_body (lib.rs:1652-1666) still clears body_ids, body_kinds, char_map, buoyancy_bodies, and climb_flags. add_water_aabb (lib.rs:1522) calls self.water.add_aabb. AnalyticWater::sample returns top face and density and does not read linear_drag. The impulse still multiplies BuoyancyData.drag and only walks buoyancy_bodies. That matches invariant 17. The crate still has #![forbid(unsafe_code)].
Key M still only deletes a Rapier body. The new comment matches open #411.
Determinism
The deleted manager stored f32 in a HashMap and was not on the replay hash. Leaving those formulas off astraweave-destruction keeps f32 and map order off the hashed path. The destruction replay case is the integer crate and is not in this diff. Cross-OS replay on this head is green: determinism-replay hash on ubuntu, windows, and macos, plus compare; Aravath replay hash on windows and macos.
Security
Cargo.lock is not in the diff. No new dependency, input parser, or network path. Public surface shrinks. Cargo Deny Check, Security Audit (cargo-audit), and cargo-audit, cargo-deny, SBOM succeeded on this head. The unchecked local-audit box in the PR body is covered by those jobs.
CI
Gate (fmt, clippy, check), affected Ubuntu tests, Windows test shards, trace sync, and the security jobs above all succeeded on ca73eba9.
Still open, not blocking
The two existing threads still stand:
- §5 lists
process_destructible_hitsas a symbol of the removeddestruction.rs. The base definition wasPhysicsWorld::process_destructible_hitsinlib.rs. The §6 row already says it waslib.rs. tests/cross_subsystem_validation.rsstill imports unusedVehicleConfig, and the header still says vehicles interact with destruction. The destruction tests were the only use. Integration-test clippy is not the lib-D warningsgate, which is why CI stayed green.
Residual, outside this diff
These still describe the deleted stub. They are not a merge condition; the physics and destruction traces are the ones this PR corrected.
CLAUDE.mdstill listsprocess_destructible_hitsas a no-op stub.docs/architecture/ARCHITECTURE_MAP.mdstill listsDestructionManagerand citesprocess_destructible_hitsatlib.rs:1587andadd_water_aabbas an empty body.docs/architecture/workspace_map.htmlstill records both as silent failures onastraweave-physics.docs/current/DESTRUCTION_ARCHAEOLOGY.mdandDESTRUCTION_DESIGN.mdstill describe the float module as on disk.
Scale figures in physics §1 were not recounted. src/ on this head is 27,275 lines and lib.rs is 5,708. The metadata row still says ~31K. The runtime-edge note cites apply_buoyancy_forces at lib.rs:1464; the function starts at lib.rs:1467. Invariant 7 cites the remove_body call at lib.rs:1670; that line is the break_destructible signature and the call is lib.rs:1671.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT


Description
Retires the dormant float destruction manager in
astraweave-physics.DestructionManager,FracturePattern, and the f32 debris formulas had no production caller. Fracture, debris, and break strength already live inastraweave-destruction(planar_childrenis two pieces;BreakRule::stonestrength is 100). Porting the float grid onto that crate would putf32andHashMaporder on the hashed path, so those formulas are not copied.PhysicsWorld::add_destructible_boxstill creates a dynamic box.break_destructiblestill callsremove_body.process_destructible_hitsandbenches/destruction.rsare deleted. Thedestructionreplay case is the integer crate and is unchanged.The GPU frame path is not touched, so this cannot add time to the GTX 1660 Ti frame. This environment has no 1660, so the 11 ms budget was not remeasured here.
Audit follow-up on
62bc7e31:destruction.rs,DestructionManager,process_destructible_hits, andbenches/destruction.rsremoved in §5, §6, §10, §11, and Appendix A. §5 lists the livepub modset.docs/architecture/destruction.md§6 no longer says the float manager was left in place.PhysicsWorlddoes not writeDestructionCommand.break_destructibleonly removes the Rapier body.planar_cut_is_stablechecks ids, the axis-0 half, the shifted positions, and the mass split.BreakRule::stonestrength 100 isstone_break_strength_is_one_hundred. The duplicate character-controller crate-doc bullet is gone. The README row isbreak_destructible. TheGravityManagerrow now says that module is removed (feat: local field on main, greybox host, weaving stamps #330).examples/physics_demo3dkey M still only deletes a body. Retargeting that wgpu window onto the headless integer log is not a small change. Deferred in physics_demo3d key M only deletes a Rapier body #411 (owner @lazyxeon, root cause, plan, and exit criteria in the issue).Audit follow-up on
6dbdb4fd(trace v1.15):add_water_aabbis not a stub.lib.rs:1522callsself.water.add_aabb. Invariant 17, the §6 row, the closed §11 question, and Appendix A items 4 and 5 say that. The impulse still usesBuoyancyData.dragfor bodies already inbuoyancy_bodies.remove_bodyclears five maps, includingclimb_flags.environment_tests.rsno longer importsPhysicsWorld, and the header no longer says the file tests destruction.Fixes #255
Type of change
Security Considerations
Checklist