Skip to content

Conversation

josesimoes
Copy link
Member

@josesimoes josesimoes commented Sep 1, 2025

Description

  • Update mscorlib declaration.

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

Summary by CodeRabbit

  • Chores

    • Synchronized internal mappings and metadata across build configurations to maintain consistent behavior.
    • Updated assembly data version to reflect table realignment; no user-facing changes.
  • Refactor

    • Reindexed internal method tables by inserting placeholders for consistency and maintainability across configurations.
    • Ensured parity between different build modes without altering runtime logic or features.

@nfbot nfbot added the Type: dependencies Pull requests that update a dependency file(s) or version label Sep 1, 2025
Copy link
Contributor

coderabbitai bot commented Sep 1, 2025

Walkthrough

Extends method_lookup tables in src/CLR/CorLib/corlib_native.cpp by inserting NULL placeholders before specific entries, updates assembly metadata constants for both NANOCLR_REFLECTION modes, and increments the final initializer count from 24 to 25 to reflect added entries.

Changes

Cohort / File(s) Change Summary
Method lookup table adjustments
src/CLR/CorLib/corlib_native.cpp
Inserted NULL placeholders before Guid::GenerateNewGuid and MathInternal::Abs entries across lookup blocks; applied identically for NANOCLR_REFLECTION TRUE and FALSE configurations; reindexed method mappings accordingly.
Assembly metadata updates
src/CLR/CorLib/corlib_native.cpp
Updated assembly metadata constants (TRUE: 0x1549C856 → 0xC12CAE16; FALSE: 0xF0208DC0 → 0xA02068F1).
Data initializer sizing
src/CLR/CorLib/corlib_native.cpp
Adjusted g_CLR_AssemblyNative_mscorlib trailing initializer from { 100, 5, 0, 24 } to { 100, 5, 0, 25 }.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a500b26 and 94d98ce.

📒 Files selected for processing (1)
  • src/CLR/CorLib/corlib_native.cpp (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ST_NUCLEO64_F091RC)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
🔇 Additional comments (7)
src/CLR/CorLib/corlib_native.cpp (7)

604-605: Two NULLs before MathInternal::Abs — OK, keep parity with managed tokens

The padding before MathInternal::Abs matches the intended shift. Ensure the managed method table has the same two new tokens.


1311-1313: No-reflection table: Guid padding mirrors reflection table

Three NULLs inserted before GenerateNewGuid here as well. Parity looks correct.


1339-1340: No-reflection table: MathInternal::Abs padding consistent

Two NULLs added before Abs, matching the reflection branch. Good.


1510-1510: Updated native CRC (reflection=TRUE) — confirm against generated value

CRC 0xC12CAE16 should come from the interop generator for CoreLibrary#247. Please confirm it matches the tool output for this table.


1514-1514: Updated native CRC (reflection=FALSE) — confirm against generated value

CRC 0xA02068F1 updated. Verify with the generator for the no-reflection build.


1521-1521: Bump mscorlib native version to 100.5.0.25 — ensure managed side matches

Version increment looks right for this token reindex. Please ensure the managed AssemblyNativeVersionAttribute in CoreLibrary is also 100.5.0.25 and that all targets consume this version.


573-575: Automatic null‐slot count failed — please manually confirm token alignment

The generated counts don’t match expectations (three NULLs before GenerateNewGuid, two before MathInternal::Abs) in both the reflection and no-reflection branches. Manually verify that exactly 3 NULL entries precede Library_corlib_native_System_Guid::GenerateNewGuid and 2 NULL entries precede Library_corlib_native_System_MathInternal::Abs___STATIC__I4__I4 in each #if/#elif table to ensure offsets match CoreLibrary #247.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-mscorlib

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: dependencies Pull requests that update a dependency file(s) or version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants