Skip to content

[interp] Fixes for Vector3 Interop test #119025

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kg
Copy link
Member

@kg kg commented Aug 22, 2025

With these fixes and the fixes from #119020, JIT\SIMD\Vector3Interop_ro\Vector3Interop_ro gets to All PInvoke testcases passed now. The reverse p/invoke test cases don't pass yet, still.

  • Fix some check failures in getClassAlignmentRequirement
  • Implement CPOBJ
  • Implement INITBLK

Copy link
Contributor

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

Fix contract violations in getClassAlignmentRequirement
Basic implementation of CPOBJ in the interpreter
Implement initblk in the interpreter
@kg kg force-pushed the interp-vector3interop-2 branch from c32449a to aa81ad5 Compare August 22, 2025 22:54
@kg kg marked this pull request as ready for review August 22, 2025 22:56
@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 22:56
@kg kg requested review from BrzVlad and janvorli as code owners August 22, 2025 22:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements fixes for Vector3 interop tests in the CoreCLR interpreter by addressing several critical issues. The changes focus on fixing alignment requirement checks and implementing missing IL opcodes that are needed for proper Vector3 interop functionality.

Key changes include:

  • Fixing contract violations in getClassAlignmentRequirement by changing from leaf to non-leaf transitions
  • Implementing the CPOBJ IL opcode for copying objects by value
  • Implementing the INITBLK IL opcode for initializing memory blocks

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/coreclr/vm/jitinterface.cpp Updates contract declarations and transitions for getClassAlignmentRequirement to handle potential GC triggers
src/coreclr/vm/interpexec.cpp Adds execution logic for the INTOP_INITBLK operation with null reference checking
src/coreclr/interpreter/intops.def Defines the new INTOP_INITBLK opcode in the interpreter operations table
src/coreclr/interpreter/compiler.cpp Implements compilation logic for CEE_CPOBJ and CEE_INITBLK IL opcodes, plus fixes type conversion for localloc

void* dst = LOCAL_VAR(ip[1], void*);
uint8_t value = LOCAL_VAR(ip[2], uint8_t);
uint32_t size = LOCAL_VAR(ip[3], uint32_t);
if (size && !dst)
Copy link
Preview

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

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

The null check logic is incorrect. The condition should check if dst is null when size > 0, but the current logic size && !dst will throw even when size is 0 and dst is null, which should be a valid no-op case according to .NET semantics.

Suggested change
if (size && !dst)
if (size > 0 && !dst)

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant