Skip to content

Fix ABIStress test hashing padding - #88097

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-abistress-test
Jun 27, 2023
Merged

Fix ABIStress test hashing padding#88097
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-abistress-test

Conversation

@jakobbotsch

@jakobbotschjakobbotsch commented Jun 27, 2023

Copy link
Copy Markdown
Member

ABIStress was storing data inside of padding and hashing it when trying to determine if all values made it through correctly. Make sure we only hash the fields.

With physical promotion enabled this causes the test to fail. That's because of this type:

publicstructI128_2{publicbyteF0;publicInt128F1;publicI128_2(bytef0,Int128f1)=>(F0,F1)=(f0,f1);}

which has 15 bytes of padding in it. When the constructor is invoked, a temp is created, and physical promotion ends up promoting that temp and only writing the significant "field" parts.

I verified that regular promotion also causes the test to fail if a type is added that is regularly promoted, e.g. with struct S { public byte F0; public long F1; } the same problem is hit on main.

ABIStress was including padding in its hashing when trying to determine
if all values made it through correctly. Make sure we only hash the
fields that actually store data.
@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 27, 2023
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

ABIStress was including padding in its hashing when trying to determine if all values made it through correctly. Make sure we only hash the fields that actually store data.

With physical promotion enabled this causes the test to fail. That's because of this type:

publicstructI128_2{publicbyteF0;publicInt128F1;publicI128_2(bytef0,Int128f1)=>(F0,F1)=(f0,f1);}

which has 15 bytes of padding in it.

I verified that regular promotion also causes the test to fail if a type is added that is regularly promoted, e.g. with struct S { public byte F0; public long F1; } the same problem is hit on main.

Author:jakobbotsch
Assignees:jakobbotsch
Labels:

area-CodeGen-coreclr

Milestone:-

@jakobbotsch

Copy link
Copy Markdown
MemberAuthor

cc @dotnet/jit-contrib PTAL @AndyAyersMS

@jakobbotsch
jakobbotsch merged commit d879656 into dotnet:mainJun 27, 2023
@jakobbotsch
jakobbotsch deleted the fix-abistress-test branch June 27, 2023 22:36
@ghostghost locked as resolved and limited conversation to collaborators Jul 28, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jakobbotsch@AndyAyersMS