Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rapier(x)d-simd-compat to use simd instructions #315

Merged
merged 4 commits into from
Apr 10, 2025

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented Mar 25, 2025

  • Fix rapier2d-simd-compat doesn't really use simd128 instruction #314

  • run cargo clean to avoid reusing previously compiled crate ; while this doesn't help much with linked issue, I believe that's a sensible thing to do which will avoid surprises in the long run, so I'd argue to keep it, we're not benefitting much from incremental compilation speed if it comes at a price of sneaky build differences.

  • add simd rustflags when building rapier-compat simd -> that's the real fix.

  • TODO: add a CI check ; to avoid regressions

@Master-Hash
Copy link

I believe cargo clean doesn't help?

@Master-Hash
Copy link

I confirm the artifact here fixes.

@Vrixyz
Copy link
Contributor Author

Vrixyz commented Mar 25, 2025

I confirm the artifact here fixes.

Thanks for your attention, I'll probably add a verification step in CI, then discuss it with @sebcrozet before we make a new release containing the fix, in the meantime I hope this updated artifact can be useful.

@Master-Hash
Copy link

I'll use my personal build anyway mdrrrr

@@ -41,4 +41,10 @@ fi

# Working dir in wasm-pack is the project root so we need that "../../"

wasm-pack build --target web --out-dir "../../rapier-compat/builds/${dimension}d${feature_postfix}/wasm-build" "$rust_source_directory"
if [[ $feature == "simd" ]]; then
export additional_rustflags='-C target-feature=+simd128'
Copy link
Contributor Author

@Vrixyz Vrixyz Mar 25, 2025

Choose a reason for hiding this comment

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

I tried export RUSTFLAGS=[...] but this didn't work (wasn't used by wasm-pack), I think my shell expertise is needing an update, there's probably a slightly cleaner way to achieve this.

in the meantime just removing the export in the only self-improvement I can come up with.

@Vrixyz Vrixyz changed the title attempt to fix #314 Fix rapier2d-simd-compat to use simd instructions Apr 2, 2025
@Vrixyz Vrixyz changed the title Fix rapier2d-simd-compat to use simd instructions Fix rapier(x)d-simd-compat to use simd instructions Apr 2, 2025
@Vrixyz Vrixyz force-pushed the fix_simd_builds branch 6 times, most recently from 7b24c1a to 96f4ca3 Compare April 3, 2025 15:38
@Vrixyz Vrixyz force-pushed the fix_simd_builds branch from 96f4ca3 to 787eb95 Compare April 3, 2025 16:02
@Vrixyz Vrixyz requested a review from sebcrozet April 4, 2025 13:40
@sebcrozet sebcrozet merged commit 083a866 into dimforge:master Apr 10, 2025
6 checks passed
@sebcrozet
Copy link
Member

Thanks!

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.

rapier2d-simd-compat doesn't really use simd128 instruction
3 participants