You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[clr-interp] Matrix4x4 tests fail on DOTNET_InterpMode=1 #123104
On DOTNET_InterpMode=1 these tests fail because the underlying SIMD api uses Single.MultiplyAddEstimate which behaves differently than the expected path when jitted vs R2R'd
if (BlockNonDeterministicIntrinsics(mustExpand))
{
returnnullptr;
}
This in turn is implemented as:
boolBlockNonDeterministicIntrinsics(bool mustExpand)
{
// We explicitly block these APIs from being expanded in R2R// since we know they are non-deterministic across hardwareif (IsReadyToRun())
{
if (mustExpand)
{
implLimitation();
}
returntrue;
}
returnfalse;
}
That is, they should explicitly be left in as calls and not generated in the R2R image. Instead, they should end up always being jitted and so should always return the same result at runtime.
@tannergooding In our case, on ios, it would mean that these would be interpreted (so their execution would be orders of magnitude slower). Would you say that this is acceptable ? Do you think these would be performance critical ?
In our case, on ios, it would mean that these would be interpreted (so their execution would be orders of magnitude slower). Would you say that this is acceptable ?
I think its a matter of correctness and so a bit irrelevant. We cannot have functions, particularly "core math" functions differing in result between different modes (AOT vs R2R vs JIT vs Interpreter) within the same process.
Do you think these would be performance critical ?
The estimate functions primarily exist for "performance" related reasons. That is, they intentionally exist to say give me the faster of FusedMultiplyAdd(x, y, z) or (x * y) + z. I wouldn't think it should be terribly difficult for the interpreter to handle these itself. That being said, I also wouldn't expect them to be all that typical in code that ends up being interpreted in practice.
Thanks for the explanation. Seems like this issue reproduces on our tests due to misconfiguration. On iOS we should be fine since we would only use the interpreter path and it doesn't seem to be perf critical as of right now. Triaging as future milestone.
I ran into this same failure in #131493. Looks like it may be an interpreter bug?
AI analysis:
InterpCompiler::AllocOffsets ( src/coreclr/interpreter/compileropt.cpp ) marked a dVar 's destination call "active" after calling EndActiveCall(pIns). So a call whose result feeds another call's arguments never became a dependency of that call, and both got base offset 0 in the param area. The inner call's return buffer therefore aliased its own arguments:
Matrix4x4.CreateTranslation writes result.X/Y/Z into the retbuf, clobbering position (bytes 0–11), then reads position back for result.W → W = (1,0,0,1) instead of the translation row. clr-abi.md:143 explicitly permits a compiled callee to use the return buffer as scratch, so the interpreter is at fault. It only manifests with an R2R/JIT'd callee — an interpreted callee copies to the retbuf only at ret .
(As noted this only shows up with R2R because of different timing in when the retbuf is written).
Activity
davidwrighton commentedon Jan 12, 2026
I don't think we should fix this.
dotnet-policy-service commentedon Jan 12, 2026
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.
tannergooding commentedon Jan 12, 2026
The R2R path should be marking these appropriately, so they are forced to compile at runtime. We generally document this under https://github.com/dotnet/runtime/blob/main/docs/design/coreclr/botr/vectors-and-intrinsics.md#non-deterministic-intrinsics-in-systemprivatecorelib
See also https://github.com/dotnet/runtime/blob/main/src/coreclr/jit/importercalls.cpp#L9850-L9867, which should be hitting:
This in turn is implemented as:
That is, they should explicitly be left in as calls and not generated in the R2R image. Instead, they should end up always being jitted and so should always return the same result at runtime.
BrzVlad commentedon Jan 20, 2026
@tannergooding In our case, on ios, it would mean that these would be interpreted (so their execution would be orders of magnitude slower). Would you say that this is acceptable ? Do you think these would be performance critical ?
tannergooding commentedon Jan 20, 2026
I think its a matter of correctness and so a bit irrelevant. We cannot have functions, particularly "core math" functions differing in result between different modes (AOT vs R2R vs JIT vs Interpreter) within the same process.
The estimate functions primarily exist for "performance" related reasons. That is, they intentionally exist to say give me the faster of
FusedMultiplyAdd(x, y, z)or(x * y) + z. I wouldn't think it should be terribly difficult for the interpreter to handle these itself. That being said, I also wouldn't expect them to be all that typical in code that ends up being interpreted in practice.BrzVlad commentedon Jan 20, 2026
Thanks for the explanation. Seems like this issue reproduces on our tests due to misconfiguration. On iOS we should be fine since we would only use the interpreter path and it doesn't seem to be perf critical as of right now. Triaging as future milestone.
[runtime tests] Report ActiveIssue-skipped tests and crashed runners (#…
AndyAyersMS commentedon Jul 31, 2026
I ran into this same failure in #131493. Looks like it may be an interpreter bug?
AI analysis:
InterpCompiler::AllocOffsets ( src/coreclr/interpreter/compileropt.cpp ) marked a dVar 's destination call "active" after calling EndActiveCall(pIns). So a call whose result feeds another call's arguments never became a dependency of that call, and both got base offset 0 in the param area. The inner call's return buffer therefore aliased its own arguments:
IR_0049: call [288 <- 288] Vector3:op_UnaryNegation
IR_004d: call [288 <- 288] Matrix4x4:CreateTranslation(Vector3) <-- corrupts
positionIR_006a: call [288 <- 288] Matrix4x4:op_Multiply
Matrix4x4.CreateTranslation writes result.X/Y/Z into the retbuf, clobbering position (bytes 0–11), then reads position back for result.W → W = (1,0,0,1) instead of the translation row. clr-abi.md:143 explicitly permits a compiled callee to use the return buffer as scratch, so the interpreter is at fault. It only manifests with an R2R/JIT'd callee — an interpreted callee copies to the retbuf only at ret .
(As noted this only shows up with R2R because of different timing in when the retbuf is written).
I'll put up a PR with a proposed fix.
interp: don't alias a call's return buffer with its own arguments (#1…