SIMD hull collision (#93)

SIMD based hull collision inspired by example code from @cairnc in #54 

<img width="1676" height="1332" alt="image"
src="https://github.com/user-attachments/assets/58b137bd-bf7b-4c99-863c-64341b973a3d"
/>

- Fixed #78
- Fixed #85 and fixed CI to error on UB.
- Updated benchmarks
- Added AMD scalar benchmarks
- Added Neon benchmarks
- More determinism unit tests
- Sample leak detection
- Added b3Body_AllowFastRotation
- Added b3Body_IsFastRotationAllowed
- Bumped b3HullData version
- Bumped b3CompoundData version
This commit is contained in:
Erin Catto 2026-07-18 22:43:03 -07:00 • committed by GitHub
commit c37cfe4cd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
84 changed files with 3898 additions and 1151 deletions

View file

@ -0,0 +1,9 @@
threads,ms
1,40706
2,20798.5
3,13788.7
4,10323.8
5,8358.62
6,6957.96
7,6005.53
8,5292.26
1 threads ms
2 1 40706
3 2 20798.5
4 3 13788.7
5 4 10323.8
6 5 8358.62
7 6 6957.96
8 7 6005.53
9 8 5292.26

View file

@ -0,0 +1,9 @@
threads,ms
1,1525.94
2,780.126
3,524.776
4,401.402
5,325.756
6,273.225
7,238.761
8,213.639
1 threads ms
2 1 1525.94
3 2 780.126
4 3 524.776
5 4 401.402
6 5 325.756
7 6 273.225
8 7 238.761
9 8 213.639

View file

@ -0,0 +1,9 @@
threads,ms
1,31501.3
2,16601.6
3,11227.1
4,8563.17
5,6942.15
6,5857.2
7,5070.54
8,4517.74
1 threads ms
2 1 31501.3
3 2 16601.6
4 3 11227.1
5 4 8563.17
6 5 6942.15
7 6 5857.2
8 7 5070.54
9 8 4517.74

View file

@ -0,0 +1,9 @@
threads,ms
1,5026.74
2,2674.22
3,1794.82
4,1368.46
5,1105.67
6,939.709
7,808.349
8,720.536
1 threads ms
2 1 5026.74
3 2 2674.22
4 3 1794.82
5 4 1368.46
6 5 1105.67
7 6 939.709
8 7 808.349
9 8 720.536

View file

@ -0,0 +1,9 @@
threads,ms
1,24.5593
2,26.5894
3,27.5323
4,27.8544
5,27.8073
6,28.2759
7,28.1201
8,28.7588
1 threads ms
2 1 24.5593
3 2 26.5894
4 3 27.5323
5 4 27.8544
6 5 27.8073
7 6 28.2759
8 7 28.1201
9 8 28.7588

View file

@ -0,0 +1,9 @@
threads,ms
1,4932.85
2,2561.79
3,1704.06
4,1272.41
5,1017.39
6,850.793
7,724.552
8,635.926
1 threads ms
2 1 4932.85
3 2 2561.79
4 3 1704.06
5 4 1272.41
6 5 1017.39
7 6 850.793
8 7 724.552
9 8 635.926

View file

@ -0,0 +1,9 @@
threads,ms
1,2540.8
2,1420.77
3,992.02
4,783.73
5,650.823
6,570.124
7,510.213
8,467.848
1 threads ms
2 1 2540.8
3 2 1420.77
4 3 992.02
5 4 783.73
6 5 650.823
7 6 570.124
8 7 510.213
9 8 467.848

View file

@ -0,0 +1,9 @@
threads,ms
1,221.556
2,143.138
3,113.761
4,100.076
5,93.3681
6,89.6276
7,88.2381
8,85.6611
1 threads ms
2 1 221.556
3 2 143.138
4 3 113.761
5 4 100.076
6 5 93.3681
7 6 89.6276
8 7 88.2381
9 8 85.6611

View file

@ -0,0 +1,9 @@
threads,ms
1,815.263
2,468.217
3,344.646
4,296.781
5,269.952
6,252.229
7,240.146
8,234.044
1 threads ms
2 1 815.263
3 2 468.217
4 3 344.646
5 4 296.781
6 5 269.952
7 6 252.229
8 7 240.146
9 8 234.044

View file

@ -0,0 +1,9 @@
threads,ms
1,346.159
2,201.958
3,154.425
4,134.719
5,126.168
6,118.983
7,114.768
8,113.253
1 threads ms
2 1 346.159
3 2 201.958
4 3 154.425
5 4 134.719
6 5 126.168
7 6 118.983
8 7 114.768
9 8 113.253

View file

@ -1,9 +1,9 @@
threads,ms
1,0
2,0
3,0
4,0
5,0
6,0
7,0
8,5488.14
1,42026.4
2,22031.7
3,15189.6
4,11643.4
5,9501.71
6,8106.17
7,7077.93
8,6338.72

1 threads ms
2 1 0 42026.4
3 2 0 22031.7
4 3 0 15189.6
5 4 0 11643.4
6 5 0 9501.71
7 6 0 8106.17
8 7 0 7077.93
9 8 5488.14 6338.72

View file

@ -1,9 +1,9 @@
threads,ms
1,50240.2
2,37216.3
3,31420.6
4,23466.2
5,19266
6,16078.2
7,13874.8
8,12405.8
1,17336.6
2,8857.22
3,5945.65
4,4508.71
5,3674.55
6,3105.97
7,2696.86
8,2410.11

1 threads ms
2 1 50240.2 17336.6
3 2 37216.3 8857.22
4 3 31420.6 5945.65
5 4 23466.2 4508.71
6 5 19266 3674.55
7 6 16078.2 3105.97
8 7 13874.8 2696.86
9 8 12405.8 2410.11

View file

@ -1,9 +1,9 @@
threads,ms
1,1488.56
2,760.38
3,512.213
4,389.109
5,316.481
6,268.681
7,234.538
8,208.135
1,1586.48
2,787.633
3,531.491
4,401.5
5,325.625
6,275.095
7,238.344
8,214.504

1 threads ms
2 1 1488.56 1586.48
3 2 760.38 787.633
4 3 512.213 531.491
5 4 389.109 401.5
6 5 316.481 325.625
7 6 268.681 275.095
8 7 234.538 238.344
9 8 208.135 214.504

View file

@ -1,9 +1,9 @@
threads,ms
1,24363.8
2,13463.4
3,9229.2
4,7110.22
5,5784.18
6,4952.28
7,4305.77
8,3859.87
1,20044.1
2,10386.4
3,7087.11
4,5437.88
5,4451.58
6,3792.59
7,3293.41
8,2970.84

1 threads ms
2 1 24363.8 20044.1
3 2 13463.4 10386.4
4 3 9229.2 7087.11
5 4 7110.22 5437.88
6 5 5784.18 4451.58
7 6 4952.28 3792.59
8 7 4305.77 3293.41
9 8 3859.87 2970.84

View file

@ -1,9 +1,9 @@
threads,ms
1,2182.19
2,1111.43
3,770.761
4,588.373
5,487.242
6,412.618
7,361.125
8,327.371
1,2071.23
2,1143.38
3,778.58
4,597.287
5,487.523
6,419.766
7,366.281
8,333.042

1 threads ms
2 1 2182.19 2071.23
3 2 1111.43 1143.38
4 3 770.761 778.58
5 4 588.373 597.287
6 5 487.242 487.523
7 6 412.618 419.766
8 7 361.125 366.281
9 8 327.371 333.042

View file

@ -1,9 +1,9 @@
threads,ms
1,10.0177
2,12.2186
3,13.1469
4,13.9029
5,14.4534
6,14.2852
7,14.2133
8,14.433
1,10.938
2,12.76
3,13.5526
4,13.9525
5,15.3005
6,15.6679
7,15.4235
8,14.7126

1 threads ms
2 1 10.0177 10.938
3 2 12.2186 12.76
4 3 13.1469 13.5526
5 4 13.9029 13.9525
6 5 14.4534 15.3005
7 6 14.2852 15.6679
8 7 14.2133 15.4235
9 8 14.433 14.7126

View file

@ -1,9 +1,9 @@
threads,ms
1,2415.01
2,1205.83
3,797.971
4,608.846
5,493.836
6,413.397
7,352.727
8,311.869
1,2331.14
2,1259.61
3,827.118
4,616.691
5,495.451
6,411.55
7,355.527
8,316.039

1 threads ms
2 1 2415.01 2331.14
3 2 1205.83 1259.61
4 3 797.971 827.118
5 4 608.846 616.691
6 5 493.836 495.451
7 6 413.397 411.55
8 7 352.727 355.527
9 8 311.869 316.039

View file

@ -1,9 +1,9 @@
threads,ms
1,2295.15
2,1266.67
3,891.229
4,705.264
5,586.454
6,511.619
7,460.223
8,424.157
1,2434.57
2,1325.14
3,937.234
4,737.677
5,615.764
6,536.387
7,479.755
8,444.147

1 threads ms
2 1 2295.15 2434.57
3 2 1266.67 1325.14
4 3 891.229 937.234
5 4 705.264 737.677
6 5 586.454 615.764
7 6 511.619 536.387
8 7 460.223 479.755
9 8 424.157 444.147

View file

@ -1,9 +1,9 @@
threads,ms
1,209.402
2,136.201
3,109.042
4,96.4747
5,90.4057
6,86.776
7,84.5495
8,82.5579
1,225.438
2,141.14
3,115.727
4,101.289
5,93.6898
6,90.61
7,86.1046
8,86.7291

1 threads ms
2 1 209.402 225.438
3 2 136.201 141.14
4 3 109.042 115.727
5 4 96.4747 101.289
6 5 90.4057 93.6898
7 6 86.776 90.61
8 7 84.5495 86.1046
9 8 82.5579 86.7291

View file

@ -1,9 +1,9 @@
threads,ms
1,717.735
2,409.163
3,304.326
4,258.89
5,234.893
6,218.016
7,206.416
8,200.162
1,727.276
2,433.755
3,315.505
4,270.352
5,246.82
6,228.451
7,216.217
8,210.749

1 threads ms
2 1 717.735 727.276
3 2 409.163 433.755
4 3 304.326 315.505
5 4 258.89 270.352
6 5 234.893 246.82
7 6 218.016 228.451
8 7 206.416 216.217
9 8 200.162 210.749

View file

@ -1,9 +1,9 @@
threads,ms
1,325.527
2,199.714
3,152.192
4,133.217
5,123.004
6,115.157
7,111.613
8,108.696
1,334.365
2,191.522
3,144.41
4,127.041
5,119.247
6,113.65
7,108.433
8,105.905

1 threads ms
2 1 325.527 334.365
3 2 199.714 191.522
4 3 152.192 144.41
5 4 133.217 127.041
6 5 123.004 119.247
7 6 115.157 113.65
8 7 111.613 108.433
9 8 108.696 105.905

View file

@ -1,9 +1,9 @@
threads,ms
1,27144.2
2,14602.3
3,10240.3
4,8022.88
5,6649.81
6,5770.75
7,5112.17
8,4749.63
1,27059.6
2,14569.2
3,10081.7
4,7825.43
5,6480.34
6,5518.81
7,4901.6
8,4256.68

1 threads ms
2 1 27144.2 27059.6
3 2 14602.3 14569.2
4 3 10240.3 10081.7
5 4 8022.88 7825.43
6 5 6649.81 6480.34
7 6 5770.75 5518.81
8 7 5112.17 4901.6
9 8 4749.63 4256.68

View file

@ -0,0 +1,5 @@
threads,ms
1,15032.6
2,7877.68
3,5546.68
4,4296.53
1 threads ms
2 1 15032.6
3 2 7877.68
4 3 5546.68
5 4 4296.53

View file

@ -0,0 +1,5 @@
threads,ms
1,1089.82
2,569.935
3,399.883
4,309.318
1 threads ms
2 1 1089.82
3 2 569.935
4 3 399.883
5 4 309.318

View file

@ -0,0 +1,5 @@
threads,ms
1,13501.4
2,7288.19
3,5229.53
4,4253.67
1 threads ms
2 1 13501.4
3 2 7288.19
4 3 5229.53
5 4 4253.67

View file

@ -0,0 +1,5 @@
threads,ms
1,1810.73
2,976.492
3,687.311
4,563.518
1 threads ms
2 1 1810.73
3 2 976.492
4 3 687.311
5 4 563.518

View file

@ -0,0 +1,5 @@
threads,ms
1,8.9855
2,10.7568
3,14.1527
4,14.9816
1 threads ms
2 1 8.9855
3 2 10.7568
4 3 14.1527
5 4 14.9816

View file

@ -0,0 +1,5 @@
threads,ms
1,1917.44
2,1025.05
3,727.266
4,621.283
1 threads ms
2 1 1917.44
3 2 1025.05
4 3 727.266
5 4 621.283

View file

@ -0,0 +1,5 @@
threads,ms
1,1954.85
2,1079.88
3,789.64
4,626.161
1 threads ms
2 1 1954.85
3 2 1079.88
4 3 789.64
5 4 626.161

View file

@ -0,0 +1,5 @@
threads,ms
1,186.082
2,119.994
3,103.081
4,91.2481
1 threads ms
2 1 186.082
3 2 119.994
4 3 103.081
5 4 91.2481

View file

@ -0,0 +1,5 @@
threads,ms
1,609.865
2,348.635
3,272.314
4,236.167
1 threads ms
2 1 609.865
3 2 348.635
4 3 272.314
5 4 236.167

View file

@ -0,0 +1,5 @@
threads,ms
1,288.292
2,184.331
3,144.592
4,156.867
1 threads ms
2 1 288.292
3 2 184.331
4 3 144.592
5 4 156.867

View file

@ -0,0 +1,5 @@
threads,ms
1,21065.2
2,11419.4
3,8383.39
4,7675.16
1 threads ms
2 1 21065.2
3 2 11419.4
4 3 8383.39
5 4 7675.16

View file

@ -150,9 +150,9 @@ int main( int argc, char** argv )
#endif
Benchmark benchmarks[] = {
{ "convex_pile", NULL, CreateConvexPile, NULL, NULL, 500 },
{ "convex_pile", GetConvexPileCapacity, CreateConvexPile, NULL, NULL, 500 },
{ "joint_grid", NULL, CreateJointGrid, NULL, NULL, 100 },
{ "junkyard", NULL, CreateJunkyard, NULL, StepJunkyard, 500 },
{ "junkyard", GetJunkyardCapacity, CreateJunkyard, NULL, StepJunkyard, 500 },
{ "large_pyramid", NULL, CreateLargePyramid, NULL, NULL, 200 },
{ "large_world", GetLargeWorldCapacity, CreateLargeWorld, NULL, StepLargeWorld, 500 },
{ "many_pyramids", NULL, CreateManyPyramids, NULL, NULL, 100 },