Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
947 commits
Select commit Hold shift + click to select a range
32c6f61
GL path now *runs* too! Ported over MeshCache renderer fix.
RossNordby Mar 19, 2023
49be4ff
Demo set returned to defaults.
RossNordby Mar 20, 2023
a7a3183
Changed task scheduling strategy.
RossNordby Mar 21, 2023
cee39a5
Prodding partition problems.
RossNordby Mar 22, 2023
6aa081d
Backed out vectorized implementation; too severely bottlenecked on ba…
RossNordby Mar 22, 2023
85722cd
Batch size tuning.
RossNordby Mar 22, 2023
d77ee1a
Binning phase now computes child node centroid bounds. Centroid prepa…
RossNordby Mar 24, 2023
732dbe8
Binned builder now uses binned indices computed from binning pass.
RossNordby Mar 25, 2023
33de3c4
Trimmed some debug information.
RossNordby Mar 26, 2023
6101256
Some tuning; inner multithreading seems to be falling victim to overa…
RossNordby Apr 1, 2023
c6f3cfe
Added job filtering for linkedtaskstack.
RossNordby Apr 1, 2023
240455a
Some missing bits in LinkedTaskStack's filter, and attempt at integra…
RossNordby Apr 1, 2023
22dac46
Sponsor characters no longer potentially NaN out by reaching the targ…
RossNordby Apr 6, 2023
ca78f54
Slight twist: refusing to do any other jobs unless the local worker i…
RossNordby Apr 7, 2023
21cc0d2
Fixed potential infinite loop in convex hull builder.
RossNordby May 5, 2023
53f5efd
Binned builder revamp pretty much done? Some fine tuning. Further imp…
RossNordby May 6, 2023
2b0a4a3
Fixed ContactEventListeners preallocation capacity.
0x5143 May 6, 2023
eb6697a
BinnedBuild now has a slightly nicer interface, and Mesh uses it.
RossNordby May 6, 2023
da21bd1
Demos updated for the mesh changes (plus some changes to helpers).
RossNordby May 6, 2023
c98e072
Demo mesh construction now actually uses multithreading on car/tank d…
RossNordby May 6, 2023
b5500eb
Capacity->count awareness in instance overload.
RossNordby May 6, 2023
9f1fa32
Added sweep builder helper, just in case.
RossNordby May 6, 2023
1cab993
BigCompound now uses the new binned build, like the mesh.
RossNordby May 7, 2023
f73db2c
Version bump.
RossNordby May 7, 2023
dde3a6b
Some simple helper ToStrings.
RossNordby Jun 5, 2023
f75092e
Debracketify.
RossNordby Jun 5, 2023
37cde81
Broad phase stress test fancified a little.
RossNordby Jun 5, 2023
83c3903
Prodding.
RossNordby Jun 7, 2023
76bca1a
Purged older TaskStack/Queue implementations.
RossNordby Jun 7, 2023
d0e438c
Refactored LinkedTaskStack into a nicer namespace and set of files.
RossNordby Jun 7, 2023
f6e16fd
Fixed #231.
RossNordby Jun 8, 2023
a9f43df
Beta version bump.
RossNordby Jun 8, 2023
1cb6552
Fiddling forth on refitless refinement with new builder.
RossNordby Jun 11, 2023
a2e96f4
Reifyin'.
RossNordby Jun 13, 2023
f8be05f
Fixed a bad assert in binned builder and handled default-valued leave…
RossNordby Jun 14, 2023
39fc5d8
Tree.BuildNode actually sets leaf counts now, oops. Microsweep now al…
RossNordby Jun 14, 2023
c39ebd2
Single threaded Tree.Refine2 prototype using the new binned builder n…
RossNordby Jun 15, 2023
e7752cc
Got rid of locky tree cache optimizers. Added a depth-limited optimizer.
RossNordby Jun 15, 2023
f04bbdb
Some additional options that don't really matter for cache optimization.
RossNordby Jun 20, 2023
946a7b0
What if Tree_Refine2.cs contained Refine3, and four separate candidat…
RossNordby Jun 24, 2023
fcf05ab
And then poof!
RossNordby Jun 24, 2023
d67abd7
Got rid of surplus rescheduling.
RossNordby Jun 24, 2023
6b34ce4
A wee bit of refactoring.
RossNordby Jun 24, 2023
7d79cca
Vectorized access oops.
RossNordby Jun 24, 2023
0ee22dd
Small cache optimization bug.
RossNordby Jun 24, 2023
4bcefa5
Basic interrefinement multithreading; no per-refinement-region multit…
RossNordby Jun 25, 2023
0f6ad0c
Some refactoring on the BinnedBuild entrypoint to enable intrarefinem…
RossNordby Jun 26, 2023
e99fab9
Binned build refactor for external task stack execution.
RossNordby Jun 26, 2023
e88147d
Internal refinement threading beginning. There's significant nondeter…
RossNordby Jun 29, 2023
4c4454f
Oops, unstaged bits.
RossNordby Jun 30, 2023
616fc15
BinnedBuild now has a determinism option. Refine2 now actually uses M…
RossNordby Jul 1, 2023
91f724e
Got rid of unnecessary assert.
RossNordby Jul 12, 2023
ba00e0a
A broken root refinement collection phase. Dropping it for now; the d…
RossNordby Jul 16, 2023
d10a47b
Purged!
RossNordby Jul 16, 2023
3943b68
More relevant position.
RossNordby Jul 16, 2023
6dc9a9a
Root reify multithreading.
RossNordby Jul 16, 2023
150a819
Fixed a fairly major oops in binned builder BuildNode for subtreeCoun…
RossNordby Jul 20, 2023
1566048
MT binned builder for subtree refines. There's a very rare race condi…
RossNordby Jul 20, 2023
248ece0
The race condition didn't actually exist, of course, oops. But refine…
RossNordby Jul 20, 2023
9e5847c
Subtree refinement reification now multithreaded too.
RossNordby Jul 21, 2023
c42d289
Refit refactor and attempt at basic bottom up. Predictably worse.
RossNordby Jul 21, 2023
8ca4751
Shared thread dispatch for task stack.
RossNordby Jul 23, 2023
882579a
Fixed unsafe merge with preservation.
RossNordby Jul 23, 2023
8d80446
Multithreaded in-place refit.
RossNordby Jul 23, 2023
69f4b45
Improved binned builder handling of degenerate cases. Shouldn't explode.
RossNordby Jul 24, 2023
adc6999
Refine2 now handles disabled roots/subtree refines.
RossNordby Jul 24, 2023
3f534ad
Cache optimizing refit.
RossNordby Jul 24, 2023
8a53138
Cache optimizing refit multithreaded variant.
RossNordby Jul 25, 2023
b73e46a
RequestStop helper.
RossNordby Jul 25, 2023
a64ba00
Flipped Refit2WithCacheOptimization's allocation strategy inside out.…
RossNordby Jul 27, 2023
34b618b
Broadphase Update2 Tuning and scheduling bugfix.
RossNordby Jul 27, 2023
d97b0f1
Did away with in-broadphase static tree optimization; not always doab…
RossNordby Jul 27, 2023
670a924
Broad phase tasks now properly take into account the target task coun…
RossNordby Jul 30, 2023
3b7f52e
Wee oopsy in a very bad attempt.
RossNordby Aug 1, 2023
182b214
Multithreaded self query.
RossNordby Aug 2, 2023
184332b
Self test variants.
RossNordby Aug 5, 2023
944e0d6
Some reasonable tuning for early large node submission. Outperforms i…
RossNordby Aug 6, 2023
5165cfc
Not a bad idea, also it's busted, also it's probably slower.
RossNordby Aug 6, 2023
e4d737f
Some oopsyfixes in broad phase.
RossNordby Aug 6, 2023
7b074eb
Another convenience overload.
RossNordby Aug 6, 2023
933bda7
Additional oopsy.
RossNordby Aug 6, 2023
7cc02d7
MT intertree.
RossNordby Aug 7, 2023
8e4bc86
Pushcount reset properly.
RossNordby Aug 7, 2023
58902ef
Some degenerate case fixes.
RossNordby Aug 7, 2023
d0deee5
Another self variant; still worse than the dumb version.
RossNordby Aug 8, 2023
e7400ce
Tunin'.
RossNordby Aug 8, 2023
cbe609e
Wee bit more tuning.
RossNordby Aug 8, 2023
e7c2045
Stack friendliness.
RossNordby Aug 8, 2023
413ead7
Some cleanup.
RossNordby Aug 9, 2023
a217efa
A managed worker is not a managed context.
RossNordby Aug 9, 2023
a8d0fe2
Self/intertree overlaps now allow managed contexts to be passed in.
RossNordby Aug 9, 2023
acf02c0
Oops.
RossNordby Aug 9, 2023
212de43
New (broken, disabled) broad phase test implemented.
RossNordby Aug 9, 2023
c109f4a
Well, oops, turns out if you change a number in the old version it's …
RossNordby Aug 10, 2023
b069646
Missing convenience function.
RossNordby Aug 10, 2023
299ed89
Binned build with 1 leaf early early out fix.
RossNordby Aug 10, 2023
a354d0d
Added priority queue based root refinement subtree selection to match…
RossNordby Aug 12, 2023
e7f4ea7
New add variant. Simpler, tends to have slightly better SAH, though i…
RossNordby Aug 13, 2023
e94307c
Tree rotating variant. Root alone isn't sufficient, and going deep is…
RossNordby Aug 13, 2023
cd3b130
actually nevermind it's fast enough!
RossNordby Aug 14, 2023
e3e7d7c
Fixed unguarded metanodes access in binned build/refine.
RossNordby Aug 14, 2023
0b5c39c
Old add deleted. Cleaned up API for new add variants.
RossNordby Aug 14, 2023
b508f9c
Fixed task spawning gap in refits; now load balances far better.
RossNordby Aug 14, 2023
774714c
Little bit of validation.
RossNordby Aug 23, 2023
754cd0c
Added a Bodies.CountBodies helper.
RossNordby Aug 24, 2023
cc5a395
Utilize static virtual members
Saalvage Aug 21, 2023
bab35e5
Fix straggler in GL project
Saalvage Aug 21, 2023
7eafd89
Sponsors update!
RossNordby Aug 27, 2023
23849bc
Remove unused imports
Saalvage Aug 27, 2023
edbedd1
Remove unneeded `unsafe` specifiers
Saalvage Aug 27, 2023
76a79fc
Fix almost all warnings and suppress (almost) all of the rest
Saalvage Aug 27, 2023
e9b878d
Make accidentally `internal` (?) constraint `public`, eliminating the…
Saalvage Aug 27, 2023
62483bc
Fix straggler warning
Saalvage Aug 27, 2023
c4f18dd
Oops
Saalvage Aug 27, 2023
4170e68
Only try to publish on `push`, not `pull_request`
Saalvage Aug 28, 2023
2d7838a
Scooted Inequality1DOF out of the library, since it's technically jus…
RossNordby Aug 28, 2023
3a40224
TaskStack dispatch a little more adaptive.
RossNordby Aug 30, 2023
b5c6280
Comment clarification.
RossNordby Sep 2, 2023
e5af11e
Tree test job size tuning.
RossNordby Sep 2, 2023
df18221
Cleaned up the not-great attempt at a multithreaded intertree revamp.
RossNordby Sep 2, 2023
c38a6d6
Some test fiddling.
RossNordby Sep 2, 2023
db9cb3d
DemoSet normalized.
RossNordby Sep 2, 2023
d6c9b5c
BREAKING CHANGES: IContactManifold has a less stinky API. Includes a …
RossNordby Sep 4, 2023
e482a98
Some missing debug validation updates.
RossNordby Sep 4, 2023
b0898c4
Convex hulls can now tolerate coplanar inputs, at least sometimes.
RossNordby Sep 6, 2023
97ef574
Rolled back attempt at degenerate hull support; too many holes. Conve…
RossNordby Sep 7, 2023
c56db63
Missing doc.
RossNordby Sep 14, 2023
b5154b6
PredictBoundingBoxes/IntegrateBundlesAfterSubstepping now pass -1's f…
RossNordby Sep 27, 2023
49fd1d0
Removed reference to old "ReleaseStrip" build config.
RossNordby Sep 27, 2023
be40228
Introduce `IDisposableShape`
Saalvage Oct 9, 2023
5d93c96
Version bump.
RossNordby Oct 9, 2023
0a11a24
Robustified a degenerate corner case in convex hull builder.
RossNordby Oct 10, 2023
13b9ff3
okay 2.5 still hasn't been released and .net 8 has hmm
RossNordby Nov 14, 2023
72c25a8
CS9195 remediation.
RossNordby Nov 14, 2023
82067ae
Workflow update.
RossNordby Nov 14, 2023
5c23c16
Version bump.
RossNordby Nov 14, 2023
7820d9c
Fixed some demos build configs.
RossNordby Nov 20, 2023
13f7f8d
oops, apparently broke the per body gravity demo a while ago.
RossNordby Nov 21, 2023
aca6370
Worked around https://github.com/dotnet/runtime/issues/95043.
RossNordby Nov 21, 2023
62cd95e
Version bump for fix.
RossNordby Nov 21, 2023
02d18a6
Clarification!
RossNordby Nov 21, 2023
a1a7866
slightly out of date roadmap
RossNordby Nov 22, 2023
0c20dea
Fun times in convex hull bug land.
RossNordby Dec 14, 2023
79f982d
Tinytweak; shouldn't reject things that were incorrectly rejected bef…
RossNordby Dec 14, 2023
4ffecb2
Disabled debugstuff and cleaned up redundant old implementations.
RossNordby Dec 14, 2023
0ecb874
Version bump.
RossNordby Dec 14, 2023
5f61291
Sponsor update!
RossNordby Dec 29, 2023
c242931
Solver-side integration should now properly filter body indices befor…
RossNordby Jan 12, 2024
563773c
Version bump.
RossNordby Jan 12, 2024
fe8d87e
Guarded against stackalloc-induced overflow for large compounds.
RossNordby Jan 13, 2024
1fdf734
Version bump.
RossNordby Jan 13, 2024
5002b7d
Disabled debug steps in convex hull helper, oops.
RossNordby Feb 5, 2024
e39d488
Update GL projects to .NET 8
NoahStolk Feb 4, 2024
dd38847
Fix some typos in the character demo too
NoahStolk Feb 4, 2024
a763813
Version bump.
RossNordby Feb 5, 2024
4956d40
No documented transfer of ownership of stream in ContentArchive.Save,…
RossNordby Feb 14, 2024
6a48c1f
Fixed an issue with kinematic integration responsibilities; incorrect…
RossNordby Mar 4, 2024
03767bf
Moved batch merging to cross platform intrinsics.
RossNordby Mar 4, 2024
9a94101
Version bump.
RossNordby Mar 4, 2024
f5beda9
Bumped imagesharp version.
RossNordby Mar 5, 2024
5b152ba
BigCompound now shifts node bounds correctly in response to center of…
RossNordby Mar 7, 2024
10bc4a2
Helper for grabbing leaf-associated NodeChild references.
RossNordby Mar 7, 2024
0cb704f
Added convience helper for directly using BodyInertia in compound bui…
RossNordby Mar 7, 2024
bd02aeb
CompoundChild.AsPose now an instance method.
RossNordby Mar 7, 2024
424fcf0
Missing AsPose oopsy.
RossNordby Mar 7, 2024
7fd2e4c
CompoundChild constructor for marginally less annoyance.
RossNordby Mar 7, 2024
a543511
Another missing AsPose oopsy.
RossNordby Mar 7, 2024
d3b4d90
All demos scooted into file scoped namespaces.
RossNordby Mar 7, 2024
05e3e8d
Version bump.
RossNordby Mar 7, 2024
2a266d4
Simulations can now be given Shapes collections, enabling the sharing…
RossNordby Apr 3, 2024
1eb1c03
Version bump.
RossNordby Apr 3, 2024
0a23c15
Bumped dependency version.
RossNordby Apr 21, 2024
fd93751
Wee error check.
RossNordby Jul 15, 2024
f1103bb
Some comments clarifications/typofixes.
RossNordby Jul 15, 2024
f4b086c
Fixed a special case hole that allowed negative values to be reported…
RossNordby Nov 16, 2024
f215c14
Job count initialization fix, oops!
RossNordby Nov 29, 2024
b765bdc
Version bump.
RossNordby Nov 29, 2024
54a922b
Bumping to .net 9 for demos. Library staying at 8 for now.
RossNordby Nov 29, 2024
89b6b9a
Github actions.
RossNordby Nov 29, 2024
ec5082f
Bump Demos.GL to .NET 9
FriendlyChicken Dec 5, 2024
3301514
ci: Add release.yml for changelog generation
VaclavElias Dec 16, 2024
0126ed5
refactor!: Consolidate common project settings
VaclavElias Dec 17, 2024
cfa0d5c
ci: Update GitHub Actions workflow
VaclavElias Dec 29, 2024
a1d6cd3
ci: Add .NET Core workflow for publishing NuGet packages
VaclavElias Dec 29, 2024
1772bb6
feat: Add ignore paths so the GitHub Actions isn't triggered when not…
VaclavElias Dec 29, 2024
2b785b8
In the middle of fixing ye olde convex hull bug with a drizzling of b…
RossNordby Oct 2, 2024
7a211c6
Further poking.
RossNordby Nov 9, 2024
a7fb5ae
Debug poking.
RossNordby Nov 11, 2024
1be62ae
Debug fixes.
RossNordby Nov 16, 2024
d9b3729
Debug improvements and limited edge filtering.
RossNordby Nov 17, 2024
3a35365
More aggressive filtering.
RossNordby Nov 17, 2024
9b8d261
Disallowed vertex paranoid cleanup.
RossNordby Jan 13, 2025
291c27f
Not-quite-working debug visualization.
RossNordby Jan 14, 2025
bf45c5b
Moving toward a wee bit of consistency in testing.
RossNordby Jan 19, 2025
3a49385
Wee morning test refactoring.
RossNordby Jan 19, 2025
32424f4
Multitest refactoring.
RossNordby Jan 20, 2025
479d3ff
Multitest selection.
RossNordby Jan 21, 2025
22ccb1e
Slab expansion by tangent scootage.
RossNordby Mar 9, 2025
6d70d48
Revert attempt at relaxation; selection of internal points is too agg…
RossNordby Mar 9, 2025
e319d39
Preppin for merge.
RossNordby Mar 9, 2025
23bf024
GL: Use compile/link status for errors
CallumDev Jun 5, 2024
3feb3e9
Update dotnet-core-publish.yml
RossNordby Mar 10, 2025
840c980
Bug fixes bump.
RossNordby Mar 11, 2025
7ae5321
Unbreak release.yaml oopsy.
RossNordby Mar 11, 2025
a16c94a
Oopsdemo.
RossNordby Apr 5, 2025
6369d4c
Bump imagesharp.
RossNordby Apr 5, 2025
f64b616
feat: Docfx implementation added
VaclavElias Dec 29, 2024
99d1442
fix: GitHub action publish dir corrected
VaclavElias Dec 29, 2024
fb6215a
ChildIndex clarifications.
RossNordby Mar 11, 2025
c0b8034
Roadmap/TOC/packaging updates.
RossNordby Apr 5, 2025
69d6cdf
Already did that!
RossNordby Apr 5, 2025
f100180
Url fiddling.
RossNordby Apr 5, 2025
c0236b6
Link rewriting, maybe?
RossNordby Apr 5, 2025
0353b2b
Squint.
RossNordby Apr 5, 2025
b4bf2ce
Resquint.
RossNordby Apr 6, 2025
856c1df
Better link fixup.
RossNordby Apr 6, 2025
29e3cbe
I'll admit I'm just letting claude do this.
RossNordby Apr 6, 2025
8110e08
Escapes.
RossNordby Apr 6, 2025
d15b538
save me claude
RossNordby Apr 6, 2025
40eb72e
A few more missing ones.
RossNordby Apr 6, 2025
52e2426
Link fiddling. Had a bad pattern.
RossNordby Apr 13, 2025
0be5195
Claude doin' my job.
RossNordby Apr 13, 2025
65432b1
Oops!
RossNordby Apr 13, 2025
984f1d6
Docupdates.
RossNordby Apr 13, 2025
7ee05bf
well that's convenient
RossNordby Apr 13, 2025
de46d90
AddWithoutAwakeningBodies added for convenience.
RossNordby Apr 14, 2025
7688e66
oops there was no documentation on that type at all
RossNordby May 5, 2025
bfb11dc
Bonus clarifications.
RossNordby May 5, 2025
e967b03
Wee basic investigations and repro.
RossNordby May 20, 2025
bf885cd
Refinement degeneracy made more consistent. Improved refinement prior…
RossNordby Jun 21, 2025
1d1aead
Oops, cleanup.
RossNordby Jun 21, 2025
4f257d4
Fixes https://github.com/bepu/bepuphysics2/issues/376.
RossNordby Jul 13, 2025
f73cd4c
Improved insertion/rotation heuristics (oops missing counts). No more…
RossNordby Aug 25, 2025
7d0b80d
No more stack overrun on pathological tree queries!
RossNordby Aug 28, 2025
9cdaaff
Eliminated a subtle double-scaled epsilon oopsy and added a scale sca…
RossNordby Sep 2, 2025
46319bc
prune one more claudecomment
RossNordby Sep 2, 2025
52db6c4
Hammering on cursor visibility apparently, in some contexts, causes s…
RossNordby Oct 20, 2025
053ea20
Slightly boosted the informativeness of the self contained demo.
RossNordby Oct 20, 2025
f8223ca
Another clarification.
RossNordby Oct 20, 2025
9c0001c
Not all shapes are triangles!
RossNordby Nov 20, 2025
cfb5daa
Those aren't necessarily triangles!
RossNordby Nov 28, 2025
b754cee
z is not w
RossNordby Feb 1, 2026
3f193be
well those are some quite latent bugs oops
RossNordby Mar 1, 2026
c52116a
missing sponsor!
RossNordby Mar 1, 2026
956a679
Bug fixes!
FastestMolasses Feb 14, 2026
56d9ad7
that's an oopsy.
RossNordby Apr 8, 2026
5fdf590
First pass for generalizing MeshReduction over alternative Mesh types.
RossNordby Apr 8, 2026
e2ce485
slightly declauded comment style
RossNordby Apr 18, 2026
55e9c3b
Test demo to validate the mesh type abstraction.
RossNordby Apr 18, 2026
f73164b
while we're here, let's trim out some unnecessary attributes for the …
RossNordby Apr 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 34 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# .github/release.yml

changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
categories:
- title: 💥 Breaking Changes
labels:
- breaking-change
- title: 🎉 New Features
labels:
- enhancement
- new-feature
- title: 🚀 Performance
labels:
- performance
- title: 🧠 Fiddling
labels:
- fiddling
- title: 🎮 Demos App
labels:
- demos
- title: 🪲 Bug Fixes
labels:
- bug
- title: 📄 Documentation
labels:
- documentation
- title: 💪 Other Changes
labels:
- "*"
45 changes: 45 additions & 0 deletions .github/workflows/bepu-docs-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build Bepu Docs for GitHub Pages

env:
COMMON_SETTINGS_PATH: Documentation/docfx.json

on:
workflow_dispatch:

jobs:
publish-docs:
runs-on: windows-latest

steps:
- name: .NET SDK Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x

- name: Checkout Bepu
uses: actions/checkout@v4

- name: Install DocFX
# This installs the latest version of DocFX and may introduce breaking changes
# run: dotnet tool update -g docfx
# This installs a specific, tested version of DocFX.
run: dotnet tool update -g docfx --version 2.78.2

- name: Build Bepu API Docs
run: docfx metadata ${{ env.COMMON_SETTINGS_PATH }}

- name: Build Bepu Docs
run: docfx build ${{ env.COMMON_SETTINGS_PATH }}

- name: Fix Documentation Links
run: powershell -File Documentation/fix-links.ps1 -sitePath "Documentation/_site" -repoUrl "https://github.com/bepu/bepuphysics2/blob/master"

- name: Deploy
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: Documentation/_site
publish_branch: gh-pages
cname: docs.bepuphysics.com
56 changes: 56 additions & 0 deletions .github/workflows/dotnet-core-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: .NET Core - Publish NuGet Packages

env:
COMMON_SETTINGS_PATH: CommonSettings.props
BASE_RUN_NUMBER: 23

on: [workflow_dispatch]

jobs:
build:

runs-on: windows-latest

steps:
- name: Print run_number
run: echo ${{ github.run_number }}
- name: Set version number
run: |
$version = "2.5.0-beta.$(${{ github.run_number }} + $env:BASE_RUN_NUMBER)"
echo "VERSION=$version" >> $env:GITHUB_ENV
shell: powershell
- name: Print VERSION
run: echo "VERSION is $env:VERSION"
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
include-prerelease: true
- name: Set Version in CommonSettings.props
run: |
$settingsContent = Get-Content -Path ${{ env.COMMON_SETTINGS_PATH }} -Raw
$updatedContent = $settingsContent -replace '<Version>.*?</Version>', "<Version>${{ env.VERSION }}</Version>"
Set-Content -Path ${{ env.COMMON_SETTINGS_PATH }} -Value $updatedContent
- name: Install dependencies
run: |
dotnet restore DemoContentBuilder
dotnet restore Demos
- name: Build
run: |
dotnet build DemoContentBuilder --configuration Release --no-restore /p:Platform=x64
dotnet build Demos --configuration Release --no-restore
- name: Test
run: dotnet test DemoTests -c Release --verbosity normal
- name: Publish
if: github.event_name != 'pull_request'
run: |
dotnet nuget add source "https://nuget.pkg.github.com/bepu/index.json" --name "github" --username "rossnordby" --password "${{secrets.GITHUB_TOKEN}}"
dotnet pack "BepuPhysics" -c Release
dotnet pack "BepuUtilities" -c Release
dotnet nuget push "**/*.nupkg" -s "github" -k "${{secrets.GITHUB_TOKEN}}" --skip-duplicate
dotnet nuget push "**/*.nupkg" -s "https://api.nuget.org/v3/index.json" -k "${{secrets.NUGET_KEY}}" --skip-duplicate
- name: Create GitHub Release Draft
run: |
gh release create ${{ env.VERSION }} --title "v${{ env.VERSION }}" --notes "Release notes for ${{ env.VERSION }}" --draft
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 20 additions & 11 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
name: .NET Core
name: .NET Core - Build and Test

on:
push:
branches: [ master ]
paths-ignore:
- '.github/**'
- 'Documentation/**'
pull_request:
branches: [ master ]
paths-ignore:
- '.github/**'
- 'Documentation/**'

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'
include-prerelease: true
- name: Install dependencies
run: |
dotnet restore DemoContentBuilder
Expand All @@ -23,10 +31,11 @@ jobs:
dotnet build Demos --configuration Release --no-restore
- name: Test
run: dotnet test DemoTests -c Release --verbosity normal
- name: Publish
run: |
dotnet nuget add source "https://nuget.pkg.github.com/bepu/index.json" --name "github" --username "rossnordby" --password "${{secrets.GITHUB_TOKEN}}"
dotnet pack "BepuPhysics" -c Release
dotnet pack "BepuUtilities" -c Release
dotnet nuget push "**/*.nupkg" -s "github" -k "${{secrets.GITHUB_TOKEN}}" --skip-duplicate
dotnet nuget push "**/*.nupkg" -s "https://api.nuget.org/v3/index.json" -k "${{secrets.NUGET_KEY}}" --skip-duplicate
# - name: Publish
# if: github.event_name != 'pull_request'
# run: |
# dotnet nuget add source "https://nuget.pkg.github.com/bepu/index.json" --name "github" --username "rossnordby" --password "${{secrets.GITHUB_TOKEN}}"
# dotnet pack "BepuPhysics" -c Release
# dotnet pack "BepuUtilities" -c Release
# dotnet nuget push "**/*.nupkg" -s "github" -k "${{secrets.GITHUB_TOKEN}}" --skip-duplicate
# dotnet nuget push "**/*.nupkg" -s "https://api.nuget.org/v3/index.json" -k "${{secrets.NUGET_KEY}}" --skip-duplicate
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,10 @@ ModelManifest.xml

# Don't ignore content files that happen to use the .obj extension.
!Demos/Content/*.obj

# JetBrains Rider
.idea/

# DocFX API Generated Pages
Documentation/api/*
Documentation/_site/*
95 changes: 61 additions & 34 deletions BepuPhysics/BatchCompressor.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using BepuUtilities;
using BepuPhysics.Constraints;
using BepuUtilities;
using BepuUtilities.Collections;
using BepuUtilities.Memory;
using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;

Expand All @@ -12,7 +12,7 @@ namespace BepuPhysics
/// <summary>
/// Handles the movement of constraints from higher indexed batches into lower indexed batches to avoid accumulating a bunch of unnecessary ConstraintBatches.
/// </summary>
public class BatchCompressor
public unsafe class BatchCompressor
{
//We want to keep removes as fast as possible. So, when removing constraints, no attempt is made to pull constraints from higher constraint batches into the revealed slot.
//Over time, this could result in lots of extra constraint batches that ruin multithreading performance.
Expand Down Expand Up @@ -97,7 +97,7 @@ struct AnalysisRegion


Action<int> analysisWorkerDelegate;
public BatchCompressor(Solver solver, Bodies bodies, float targetCandidateFraction = 0.01f, float maximumCompressionFraction = 0.0005f)
public BatchCompressor(Solver solver, Bodies bodies, float targetCandidateFraction = 0.005f, float maximumCompressionFraction = 0.0005f)
{
this.Solver = solver;
this.Bodies = bodies;
Expand All @@ -107,13 +107,12 @@ public BatchCompressor(Solver solver, Bodies bodies, float targetCandidateFracti
}



void AnalysisWorker(int workerIndex)
{
int jobIndex;
while ((jobIndex = Interlocked.Increment(ref analysisJobIndex)) < analysisJobs.Count)
{
DoJob(ref analysisJobs[jobIndex], workerIndex, threadDispatcher.GetThreadMemoryPool(workerIndex));
DoJob(ref analysisJobs[jobIndex], workerIndex, threadDispatcher.WorkerPools[workerIndex]);
}
}

Expand All @@ -124,7 +123,27 @@ void AnalysisWorker(int workerIndex)
//It'll just require some testing.
//(The broad phase is a pretty likely candidate for this overlay- it both causes no changes in constraints and is very stally compared to most other phases.)

unsafe void DoJob(ref AnalysisRegion region, int workerIndex, BufferPool pool)

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void TryToFindBetterBatchForConstraint(
BufferPool pool, ref QuickList<Compression> compressions, ref TypeBatch typeBatch, int* bodyHandles, ref ActiveConstraintDynamicBodyHandleCollector handleAccumulator, TypeProcessor typeProcessor, int constraintIndex)
{
handleAccumulator.Count = 0;
Solver.EnumerateConnectedRawBodyReferences(ref typeBatch, constraintIndex, ref handleAccumulator);
var dynamicBodyHandles = new Span<int>(bodyHandles, handleAccumulator.Count);
for (int batchIndex = nextBatchIndex - 1; batchIndex >= 0; --batchIndex)
{
if (Solver.batchReferencedHandles[batchIndex].CanFit(dynamicBodyHandles))
{
compressions.Add(new Compression { ConstraintHandle = typeBatch.IndexToHandle[constraintIndex], TargetBatch = batchIndex }, pool);
return;
}
}

}


void DoJob(ref AnalysisRegion region, int workerIndex, BufferPool pool)
{
ref var compressions = ref this.workerCompressions[workerIndex];
ref var batch = ref Solver.ActiveSet.Batches[nextBatchIndex];
Expand All @@ -135,27 +154,31 @@ unsafe void DoJob(ref AnalysisRegion region, int workerIndex, BufferPool pool)
//Each job only works on a subset of a single type batch.
var bodiesPerConstraint = typeProcessor.BodiesPerConstraint;
var bodyHandles = stackalloc int[bodiesPerConstraint];
ActiveConstraintBodyHandleCollector handleAccumulator;
ActiveConstraintDynamicBodyHandleCollector handleAccumulator;
handleAccumulator.Bodies = Bodies;
handleAccumulator.Handles = bodyHandles;
var bodyHandlesSpan = new Span<int>(bodyHandles, bodiesPerConstraint);
for (int i = region.StartIndexInTypeBatch; i < region.EndIndexInTypeBatch; ++i)
handleAccumulator.Count = 0;
if (nextBatchIndex == Solver.FallbackBatchThreshold)
{
//Check if this constraint can be removed.
handleAccumulator.Index = 0;
typeProcessor.EnumerateConnectedBodyIndices(ref typeBatch, i, ref handleAccumulator);
for (int batchIndex = 0; batchIndex < nextBatchIndex; ++batchIndex)
for (int i = region.StartIndexInTypeBatch; i < region.EndIndexInTypeBatch; ++i)
{
//The batch index will never be the fallback batch, since the fallback batch is the very last batch (if it exists at all). So uses batch referenced handles is safe.
if (Solver.batchReferencedHandles[batchIndex].CanFit(bodyHandlesSpan))
{
compressions.Add(new Compression { ConstraintHandle = typeBatch.IndexToHandle[i], TargetBatch = batchIndex }, pool);
break;
}
//This is a fallback batch; the rules are a little different.
//Not all constraint slots up to the typeBatch.ConstraintCount are guaranteed to actually exist. It's potentially sparse.
//Just skip them.
if (typeBatch.IndexToHandle[i].Value >= 0)
TryToFindBetterBatchForConstraint(pool, ref compressions, ref typeBatch, bodyHandles, ref handleAccumulator, typeProcessor, i);
}
}
else
{
for (int i = region.StartIndexInTypeBatch; i < region.EndIndexInTypeBatch; ++i)
{
TryToFindBetterBatchForConstraint(pool, ref compressions, ref typeBatch, bodyHandles, ref handleAccumulator, typeProcessor, i);
}
}
}


struct CompressionTarget
{
public ushort WorkerIndex;
Expand All @@ -172,23 +195,22 @@ public int Compare(ref CompressionTarget a, ref CompressionTarget b)
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
private unsafe void ApplyCompression(int sourceBatchIndex, ref ConstraintBatch sourceBatch, ref Compression compression)
private void ApplyCompression(int sourceBatchIndex, ref ConstraintBatch sourceBatch, ref Compression compression)
{
//Careful here: this is a reference for the sake of not doing pointless copies, but you cannot rely on it having the same values after the completion of the transfer.
ref var constraintLocation = ref Solver.HandleToConstraint[compression.ConstraintHandle.Value];
var constraintLocation = Solver.HandleToConstraint[compression.ConstraintHandle.Value];
var typeProcessor = Solver.TypeProcessors[constraintLocation.TypeId];
if (sourceBatchIndex == Solver.FallbackBatchThreshold)
{
//We're optimizing the fallback batch, so we need to be careful about compressions interfering with each other. The parallel analysis assumed each batch
//contained at most one instance of each body, which doesn't hold for the fallback batch.
//Easy enough to address: check to see if the target batch can still hold the constraint.
var bodyHandles = stackalloc int[typeProcessor.BodiesPerConstraint];
ActiveConstraintBodyHandleCollector handleAccumulator;
var dynamicBodyHandles = stackalloc int[typeProcessor.BodiesPerConstraint];
ActiveConstraintDynamicBodyHandleCollector handleAccumulator;
handleAccumulator.Bodies = Bodies;
handleAccumulator.Handles = bodyHandles;
handleAccumulator.Index = 0;
Solver.EnumerateConnectedBodies(compression.ConstraintHandle, ref handleAccumulator);
if (!Solver.batchReferencedHandles[compression.TargetBatch].CanFit(new Span<int>(bodyHandles, typeProcessor.BodiesPerConstraint)))
handleAccumulator.Handles = dynamicBodyHandles;
handleAccumulator.Count = 0;
Solver.EnumerateConnectedRawBodyReferences(compression.ConstraintHandle, ref handleAccumulator);
if (!Solver.batchReferencedHandles[compression.TargetBatch].CanFit(new Span<int>(dynamicBodyHandles, handleAccumulator.Count)))
{
//Another compression from the fallback batch has blocked this compression.
//Note that this isn't really a problem- batch compression is an incremental process. If some other compression was possible, a future frame will find it pretty quickly.
Expand Down Expand Up @@ -222,7 +244,7 @@ public void Compress(BufferPool pool, IThreadDispatcher threadDispatcher = null,
for (int i = 0; i < workerCount; ++i)
{
//Be careful: the jobs may require resizes on the compression count list. That requires the use of per-worker pools.
workerCompressions[i] = new QuickList<Compression>(Math.Max(8, maximumCompressionCount), threadDispatcher == null ? pool : threadDispatcher.GetThreadMemoryPool(i));
workerCompressions[i] = new QuickList<Compression>(Math.Max(8, maximumCompressionCount), threadDispatcher == null ? pool : threadDispatcher.WorkerPools[i]);
}

//In any given compression attempt, we only optimize over one ConstraintBatch.
Expand Down Expand Up @@ -292,7 +314,7 @@ public void Compress(BufferPool pool, IThreadDispatcher threadDispatcher = null,
{
analysisJobIndex = -1;
this.threadDispatcher = threadDispatcher;
threadDispatcher.DispatchWorkers(analysisWorkerDelegate);
threadDispatcher.DispatchWorkers(analysisWorkerDelegate, analysisJobs.Count);
this.threadDispatcher = null;
}
else
Expand Down Expand Up @@ -377,11 +399,16 @@ public void Compress(BufferPool pool, IThreadDispatcher threadDispatcher = null,
//var applyTime = 1e6 * (applyEnd - applyStart) / Stopwatch.Frequency;
//Console.WriteLine($"Apply time (us): {applyTime}, per applied: {applyTime / compressionsApplied}, (maximum: {maximumCompressionCount})");

for (int i = 0; i < workerCount; ++i)
if (threadDispatcher == null)
workerCompressions[0].Dispose(pool);
else
{
//Be careful: the jobs may require resizes on the compression count list. That requires the use of per-worker pools.
workerCompressions[i].Dispose((threadDispatcher == null ? pool : threadDispatcher.GetThreadMemoryPool(i)));
for (int i = 0; i < workerCount; ++i)
{
workerCompressions[i].Dispose(threadDispatcher.WorkerPools[i]);
}
}

pool.Return(ref workerCompressions);
}

Expand Down
Loading