Skip to content

Conversation

@CrooseGit
Copy link
Contributor

Previously, the CI has only been running the tests for the arm intrinsic in release mode.
When the CI is modified to fix this, it is discovered that the tests do not build in debug for arm targets.

This PR amends the CI, test tool, and the intrinsics themselves to address the above issues.

@rustbot
Copy link
Collaborator

rustbot commented Oct 28, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@CrooseGit CrooseGit force-pushed the dev/reucru01/fix-debug-tests branch 2 times, most recently from 0ec44c2 to d15e102 Compare October 29, 2025 10:50
Copy link
Contributor

@folkertdev folkertdev left a comment

Choose a reason for hiding this comment

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

Can you give some background on why the tests did not pass in debug mode? I'd also personally like to merge the changes to the intrinsics separately from changes to the CI infrastructure

Comment on lines 86 to 92
cargo run "${INTRINSIC_TEST}" "${PROFILE}" \
cargo run "${INTRINSIC_TEST}" --release \
--bin intrinsic-test -- intrinsics_data/arm_intrinsics.json \
--runner "${TEST_RUNNER}" \
--cppcompiler "${TEST_CXX_COMPILER}" \
--skip "${TEST_SKIP_INTRINSICS}" \
--target "${TARGET}"
--target "${TARGET}" \
--profile "${PROFILE}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Combining both --release and --profile looks suspicious. What does that do?

Copy link
Contributor Author

@CrooseGit CrooseGit Oct 31, 2025

Choose a reason for hiding this comment

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

Fair point, it not obvious.
It runs the intrinsic test tool itself in release mode, and then passes the $PROFILE env-var as an argument to the tool. The tool then compiles and runs a series of rust test programs with the specified profile, comparing the outputs against the equivalent C programs.
I could add a comment explaining this?
Thanks

Comment on lines +28 to +31
let profile_dir = match profile {
"dev" => "debug",
_ => "release",
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should explicitly match release here and just panic on anything else to make future debugging easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, will do.
Thanks

@CrooseGit
Copy link
Contributor Author

CrooseGit commented Oct 31, 2025

@folkertdev

Can you give some background on why the tests did not pass in debug mode? I'd also personally like to merge the changes to the intrinsics separately from changes to the CI infrastructure

The offending intrinsics were passing arguments to the linked llvm intrinsics that were then failing LLVMs internal assertions. LLVM requires certain arguments to be const for some of its intrinsics, and in debug mode these arguments were not const. However, in release due to things being inlined and / or being optimised away the relevant arguments became const anyway.
RE separate PRs, that can be arranged. Currently I am trying to fix the big endian CI failures, but once that is sorted, then will do.
Thanks

@CrooseGit CrooseGit force-pushed the dev/reucru01/fix-debug-tests branch from d15e102 to 2dce2b9 Compare November 26, 2025 16:37
The intrinsics test was flagging differences in aarch64_be between rust in debug and clang in O2.
It was found that rust was correct in debug, but incorrect in release,
and in both cases were being compared against clang in O2 which was also
incorrect.

The vdot intrinsics were fixed and are now correct in rust for both
release and debug. However the vcmla ones could not be as the issue lies
with LLVM. Both the vdot and vcmla intrinsics were added to the skiplist
as clang is still incorrect for both.
LLVM issue: llvm/llvm-project#166190
@CrooseGit
Copy link
Contributor Author

@folkertdev
Now I have fixed the ARM intrinsic issues in debug, I have split the PR like you requested.
The CI changes must be merged after the intrinsic changes otherwise the tests will just fail, so here here is part one of the split PRs #1964

@CrooseGit
Copy link
Contributor Author

@CrooseGit CrooseGit closed this Nov 28, 2025
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.

4 participants