Skip to content

perf: index cells during soft-body tearing - #1037

Open
n33levo wants to merge 1 commit into
dimforge:masterfrom
n33levo:nsarkar/optimize-soft-body-tearing
Open

n33levo wants to merge 1 commit into
dimforge:masterfrom
n33levo:nsarkar/optimize-soft-body-tearing

Conversation

@n33levo

@n33levo n33levo commented Oct 11, 2026

Copy link
Copy Markdown

What It Is

Build sorted particle-to-cell incidence once per tear and use it for fans, membership checks, and bounded connectivity searches. Keep the index in SplitLog, update it as cells move to particle copies, and discard it after tearing. Cuts, non-cell bodies, and repeated-vertex cells keep the scanning path.


Why

Addresses the repeated whole-body cell lookups reported in #1035, using the incidence approach proposed there. Cell ordering and topology stay unchanged. There is no public API or snapshot-format change; remaining edge/boundary scans are not removed.


Tophat E2E

Release builds on Apple M1 macOS, compared with current master. Four alternating baseline/candidate rounds, seven fresh-world trials per fixture:

Public tear operation Before After
1,496-cell 2D grid, 786 cells torn 438.88 ms 10.12 ms
600-cell 3D grid, 269 cells torn 94.85 ms 5.95 ms

All 24 fixtures match event, topology, and post-simulation fingerprints; 17 perform actual tearing. Each checks conservation and runs three subsequent physics steps. Timings exclude construction and those steps, not total step time or rendering FPS.


Verification

  • Default core 2D/3D f32/f64 unit, integration, and documentation suites: 807 passed, 28 standard ignores, no additional filtering.
  • Additional parallel/deterministic, snapshot, and FEM checks pass except a pre-existing compression test reproduced on master and excluded from the combined-feature rerun. The existing 2D f64 parallel test harness also has a compile error; a separate snapshot/tearing consumer validates that configuration.
  • Strict production-library Clippy, all four native no_std + alloc builds, formatting, and git diff --check pass.
  • Local CPU validation only; Linux, Windows, graphical testbeds, and WebAssembly runtime were not tested locally.

This branch has not been deployed

No deployments
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.

1 participant