Skip to content

Stop per-step physics allocations in the modified-collider buffer - #350

Merged
lazyxeon merged 1 commit into
mainfrom
cursor/physics-zero-alloc-a959
Oct 17, 2026
Merged

lazyxeon merged 1 commit into
mainfrom
cursor/physics-zero-alloc-a959

Conversation

@lazyxeon

@lazyxeon lazyxeon commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Description

Rebased onto cbb314b9 (#353). The [patch.crates-io] table keeps both candle-core and rapier3d. Cargo.lock still has a single zip 9.0.3.

one_physics_step_allocates_nothing allocated 8 times after 30 warmup steps. The assert stays at 0.

Five of those are one Vec growing 32, 64, 128, 256, 512 inside RigidBodyColliders::update_positions. Rapier 0.22 PhysicsPipeline::step mem::takes the modified-collider buffer and drops it, so the next step grows a new Vec from zero. third_party/rapier3d is that crate with the drained buffer returned to the set.

The other three were QueryPipeline::update rebuilding the QBVH after pipeline.step had already called update_incremental. That second rebuild is removed. Character-controller tests still pass. The measured step now reports allocs=0.

Main requires 19 replay cases (greybox_checkpoint, quest_ticks, and persist_replay are included). Integrated rigid-body positions are unchanged by buffer reuse. Determinism-replay on this head is the check that those 19 hashes stay byte-identical.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Security Considerations

  • Does this PR introduce new dependencies? No. It vendors the existing rapier3d 0.22.0 and patches buffer reuse.
  • Does this PR modify how user input is handled? No.
  • Does this PR change authentication or authorization mechanisms? No.
  • Does this PR access sensitive data or modify how it's stored? No.
  • Does this PR introduce new network communication or modify existing protocols? No.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
Open in Web Open in Cursor 

@coderabbitai

coderabbitai Bot commented Oct 17, 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: 67cbb99f-d2a0-4f35-b1a2-424f27c35b74
  • 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 force-pushed the cursor/physics-zero-alloc-a959 branch from a31140f to 4443fcb Compare October 17, 2026 00:42

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cursor
cursor Bot force-pushed the cursor/physics-zero-alloc-a959 branch 2 times, most recently from c0173f8 to c54218c Compare October 17, 2026 12:04
lazyxeon added a commit that referenced this pull request Oct 17, 2026
* docs: toolchain LFS checkout and localsim on benchmark shard 0

#348 checks out Git LFS in the toolchain job. #351 measures
astraweave-localsim on shard 0 of the 14-shard matrix. #216 and #350
stay in progress.

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

* docs: state the 600s bench limit is per target

Compilation stays outside that limit. The aw_build job keeps its
30-minute timeout.

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
A settled step allocated 8 times. Three were a full QueryPipeline
rebuild after Rapier had already updated that pipeline incrementally.
The other five were RigidBodyColliders::update_positions growing a
fresh Vec, because PhysicsPipeline::step takes the modified-collider
buffer and drops it. The patched rapier3d 0.22 returns that buffer.
one_physics_step_allocates_nothing stays at 0.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/physics-zero-alloc-a959 branch from c54218c to b7197b7 Compare October 17, 2026 13:45
@lazyxeon
lazyxeon marked this pull request as ready for review October 17, 2026 15:50
@chatgpt-codex-connector

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 ⚠️ Failed 2026-10-17T15:50:23.056888Z b7197b7 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@lazyxeon
lazyxeon merged commit f207542 into main Oct 17, 2026
32 checks passed
@lazyxeon
lazyxeon deleted the cursor/physics-zero-alloc-a959 branch October 17, 2026 15:50
cursor Bot pushed a commit that referenced this pull request Oct 17, 2026
#350 is on main. The patch reuses the modified-collider buffer.
An in-house physics engine is not planned work. #262 stays open.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 17, 2026
#350 is on main. The patch reuses the modified-collider buffer.
An in-house physics engine is not planned work. #262 stays open.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 17, 2026
#350 is on main. The patch reuses the modified-collider buffer.
An in-house physics engine is not planned work. #262 stays open.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 17, 2026
#350 is on main. The patch reuses the modified-collider buffer.
An in-house physics engine is not planned work. #262 stays open.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Oct 17, 2026
#350 is on main. The patch reuses the modified-collider buffer.
An in-house physics engine is not planned work. #262 stays open.

Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
lazyxeon added a commit that referenced this pull request Oct 17, 2026
…362)

* docs: renderer RSS test is green; shards 2 and 4 stay open

#355 closed #352. The 50 MB ceiling stays, and the ci-pr skip line
stays. #356 split shards 1, 5, and 9. #360 and #361 are in progress.

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

* docs: pin the status snapshot to 2898799

The current section is 2026-10-17. The toolchain note names that main.

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

* docs: vendored rapier3d makes a settled step zero-alloc

#350 is on main. The patch reuses the modified-collider buffer.
An in-house physics engine is not planned work. #262 stays open.

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

* ci: ignore unmaintained zbus standalone crates

RUSTSEC-2026-0370, 0371, and 0372 have no safe upgrade. egui-winit
pulls them through accesskit. They were already in the lockfile.

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

* docs: drop the zbus advisory ignores

RUSTSEC-2026-0370, 0371, and 0372 stay unignored. This pull request
does not change supply-chain config.

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

* docs: AccessKit is off and the zbus advisories are resolved

#365 builds eframe without AccessKit and moves editor file dialogs
to rfd 0.17. RUSTSEC-2026-0370, 0371, and 0372 are gone with no
ignore. Click tests are #366, in progress.

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

* docs: shards 2 and 4 are split and #359 is closed

#361 is on main. The fluids GPU timing walk runs only when
AW_FLUID_GPU_TIMINGS is set. #224 stays open. #361 leaves the
in-progress list.

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

* docs: editor click step 1 is on main, #366 step 2 stays open

#368 covers the six toolbar and menu clicks with synthetic RawInput.
egui_kittest waits until accesskit_unix uses zbus 6.

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

* docs: link the Rapier vendor note and the unfiled draft

#363 records how to re-apply the modified-collider patch. The
maintainer write-up stays in-tree and is not filed upstream.

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

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
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.

2 participants