Skip to content

Retire the dormant float destruction manager - #406

Merged
lazyxeon merged 7 commits into
mainfrom
cursor/retire-float-destruction-b3de
Oct 21, 2026
Merged

lazyxeon merged 7 commits into
mainfrom
cursor/retire-float-destruction-b3de

Conversation

@lazyxeon

@lazyxeon lazyxeon commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

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 in astraweave-destruction (planar_children is two pieces; BreakRule::stone strength is 100). Porting the float grid onto that crate would put f32 and HashMap order on the hashed path, so those formulas are not copied.

PhysicsWorld::add_destructible_box still creates a dynamic box. break_destructible still calls remove_body. process_destructible_hits and benches/destruction.rs are deleted. The destruction replay 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:

  • Physics trace v1.14 marks destruction.rs, DestructionManager, process_destructible_hits, and benches/destruction.rs removed in §5, §6, §10, §11, and Appendix A. §5 lists the live pub mod set. docs/architecture/destruction.md §6 no longer says the float manager was left in place.
  • Invariant 19: PhysicsWorld does not write DestructionCommand. break_destructible only removes the Rapier body.
  • planar_cut_is_stable checks ids, the axis-0 half, the shifted positions, and the mass split. BreakRule::stone strength 100 is stone_break_strength_is_one_hundred. The duplicate character-controller crate-doc bullet is gone. The README row is break_destructible. The GravityManager row now says that module is removed (feat: local field on main, greybox host, weaving stamps #330).
  • examples/physics_demo3d key 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_aabb is not a stub. lib.rs:1522 calls self.water.add_aabb. Invariant 17, the §6 row, the closed §11 question, and Appendix A items 4 and 5 say that. The impulse still uses BuoyancyData.drag for bodies already in buoyancy_bodies.
  • Invariant 7 and Appendix A item 11: remove_body clears five maps, including climb_flags.
  • environment_tests.rs no longer imports PhysicsWorld, and the header no longer says the file tests destruction.

Fixes #255

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Security enhancement

Security Considerations

  • Does this PR introduce new dependencies? If yes, have they been vetted for security issues? No new dependencies.
  • Does this PR modify how user input is handled? If yes, has it been validated/sanitized?
  • Does this PR change authentication or authorization mechanisms?
  • Does this PR access sensitive data or modify how it's stored?
  • Does this PR introduce new network communication or modify existing protocols?

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings
  • I have run security checks (cargo audit, cargo deny) locally
Open in Web Open in Cursor 

cursoragent and others added 2 commits October 21, 2026 13:16
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>
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: lazyxeon/AstraWeave/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 64ac0ad5-4a1f-4485-a7f9-4ddb888fea78
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Oct 21, 2026

Copy link
Copy Markdown

@coderabbitai review

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

  1. Physics trace v1.13 says the file is gone and stamps ae523346 as verified, while §5, §6, §10, §11, and Appendix A still describe destruction.rs, DestructionManager, process_destructible_hits, and benches/destruction.rs as 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 the pub mod list. lib.rs no longer has mod destruction. #330's gravity deletion at least marked the leftover paragraphs as historical. This bump does not.

  2. New invariant 19 says fracture state changes go through astraweave-destruction. PhysicsWorld does not write a DestructionCommand. A contact still changes nothing in the support graph. break_destructible only removes the Rapier body.

Holding, from the base tree and this diff:

  • No new dependency. cargo-deny is green on this head. No unsafe. The crate still has #![forbid(unsafe_code)]. The deleted file imported glam::Vec3 and HashMap only.
  • In-repo .rs callers of astraweave_physics::destruction on the base were the bench and the tests this PR deletes. examples/physics_demo3d still compiles against add_destructible_box and break_destructible.
  • The destruction replay case hashes demolition_bytes. This diff does not touch that function, the command log, or PhysicsWorld::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_debris cap 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.

Open in Web View Automation 

Sent by Cursor Automation: ASTRA PR AUDIT AGENT

Comment thread docs/architecture/physics.md Resolved
Comment thread docs/architecture/physics.md Resolved
Comment thread astraweave-physics/src/lib.rs Resolved
Comment thread astraweave-destruction/src/fracture.rs Resolved
Comment thread astraweave-physics/README.md Resolved
cursoragent and others added 2 commits October 21, 2026 16:15
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .rs hits for DestructionManager, FracturePattern, DebrisShape, and process_destructible_hits are gone. break_destructible is remove_body (lib.rs:1670-1672). PhysicsWorld::step does not enqueue DestructionCommand. The physics crate's only DestructionCommand writes are inside deformed_replay, which this diff does not touch. astraweave-destruction was already a physics dependency and is still used by deformed.rs (GeometryNotice, allows_climb). No new dependency. #![forbid(unsafe_code)] is unchanged. The deleted file imported glam::Vec3 and HashMap only.
  • cargo-deny and cargo-audit are 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.rs production 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_stable passed, including the locked prefracture digest. cargo test -p astraweave-physics --lib break_destructible passed (test_break_destructible, remove_body_drops_transform_and_break_destructible_delegates). Float cbrt / HashMap piece-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.rs exists. #255 item 2 is tracked on #411, which has the deferred-failure label and an exit criterion that key M is not only break_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.

Open in Web View Automation 

Sent by Cursor Automation: ASTRA PR AUDIT AGENT

Comment thread docs/architecture/physics.md Resolved
Comment thread docs/architecture/physics.md Resolved
cursoragent and others added 2 commits October 21, 2026 17:42
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_aabb is lib.rs:1522 and calls self.water.add_aabb. AnalyticWater stores the fourth argument as linear_drag and sample does not read it (astraweave-water/src/lib.rs). apply_buoyancy_forces walks only buoyancy_bodies. The drag term is vel * BuoyancyData.drag, then the force is applied as force * dt. columns.sample runs 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) clears body_ids, body_kinds, char_map, buoyancy_bodies, and climb_flags. break_destructible (lib.rs:1670) only calls that. PhysicsWorld still does not write DestructionCommand. The physics crate's only DestructionCommand writes are inside deformed_replay, which this diff does not touch.
  • environment_tests.rs no longer imports PhysicsWorld, and the header no longer says the file tests destruction.
  • No in-repo .rs caller remains for DestructionManager, FracturePattern, DebrisShape, or process_destructible_hits. #![forbid(unsafe_code)] is unchanged. Cargo.toml only drops the [[bench]] name = "destruction" entry. Cargo.lock is unchanged, so there is no new dependency. deformed.rs still uses astraweave-destruction. fracture.rs production code is unchanged. planar_cut_is_stable locks the ids, the axis-0 half, the shifted positions, and the mass split. The float cbrt / HashMap tests stay deleted.
  • cargo-deny and cargo-audit passed on this head. Trace-sync passed. Rust since 6dbdb4fd is 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.

Open in Web View Automation 

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`. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lazyxeon
lazyxeon marked this pull request as ready for review October 21, 2026 18:45
@lazyxeon
lazyxeon merged commit 5273aa4 into main Oct 21, 2026
36 checks passed
@lazyxeon
lazyxeon deleted the cursor/retire-float-destruction-b3de branch October 21, 2026 18:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T18:51:43.717454Z ca73eba Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_hits as a symbol of the removed destruction.rs. The base definition was PhysicsWorld::process_destructible_hits in lib.rs. The §6 row already says it was lib.rs.
  • tests/cross_subsystem_validation.rs still imports unused VehicleConfig, and the header still says vehicles interact with destruction. The destruction tests were the only use. Integration-test clippy is not the lib -D warnings gate, 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.md still lists process_destructible_hits as a no-op stub.
  • docs/architecture/ARCHITECTURE_MAP.md still lists DestructionManager and cites process_destructible_hits at lib.rs:1587 and add_water_aabb as an empty body.
  • docs/architecture/workspace_map.html still records both as silent failures on astraweave-physics.
  • docs/current/DESTRUCTION_ARCHAEOLOGY.md and DESTRUCTION_DESIGN.md still 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.

Open in Web View Automation 

Sent by Cursor Automation: ASTRA PR AUDIT AGENT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

retire astraweave-physics destruction.rs and process_destructible_hits

2 participants