Skip to content

Conversation

rossberg
Copy link
Member

@dtig, this implements the relaxation for relaxed_trunk we have converged on, PTAL.

I also removed all core tests that became obsolete/incorrect with this change. Unfortunately, it turns out that there are none left for relaxed_trunc, which is a bit concerning.

In fact, I then had a look at the tests for the other Relaxed SIMD instructions, and almost all of them only test a few edge cases. That is, with the exception of 5 assertions about relaxed_dot, we seem to have no tests for the “regular” behaviour of these instructions at all! That’s not good. Could somebody work on creating a suitable suite of basic tests? ;)

@rossberg rossberg requested a review from dtig May 13, 2025 11:29
@rossberg rossberg changed the title Wasm 3.0+relaxed.fix [spec/test] Relax relaxed_trunc semantics May 13, 2025
@rossberg
Copy link
Member Author

@dtig, friendly ping.

@dtig
Copy link
Member

dtig commented May 23, 2025

Sorry to have missed this, and thanks for adding.

Re. tests for regular behavior - these already exist as the original SIMD core spec tests. For example, the operations in this case would default to the ones in the deterministic profile which would be the operations introduced in the original SIMD128 proposal so in this case i32x4.trunc_sat_f32x4_s, i32x4.trunc_sat_f32x4_u, i32x4.trunc_sat_f64x2_s_zero, i32x4.trunc_sat_f64x2_u_zero, so this particular set of test would only be testing the out of bounds values or where the results would differ on different architectures. This is the case for most operations introduced in the relaxed SIMD proposal except the dot product and madd/mnadd instructions which have better coverage - though they could always be improved.

@rossberg
Copy link
Member Author

@dtig, well, those are different instructions. It is only an assumption that they behave the same. Verifying that is what tests are for. I mean, right now, an engine would happily pass the test suite even if its implementation of relaxed SIMD instructions was broken on almost every input.

@rossberg rossberg merged commit 3c2c6ee into wasm-3.0 May 26, 2025
9 of 12 checks passed
@rossberg rossberg deleted the wasm-3.0+relaxed.fix branch September 26, 2025 08:30
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