Skip to content

feat(csharp): expose RVM instruction budget setter - #811

Merged
Anand Krishnamoorthi (anakrish) merged 1 commit into
microsoft:mainfrom
maksym-mishchenko:maksym-mishchenko-instruction-setter-submission
Sep 9, 2026
Merged

feat(csharp): expose RVM instruction budget setter#811
Anand Krishnamoorthi (anakrish) merged 1 commit into
microsoft:mainfrom
maksym-mishchenko:maksym-mishchenko-instruction-setter-submission

Conversation

@maksym-mishchenko

Copy link
Copy Markdown
Contributor

Expose the existing native instruction-budget control to C# callers through Rvm.SetMaxInstructions(ulong). The method preserves native counting and exhaustion behavior and rejects values that exceed the native pointer width. No native runtime behavior or ABI changes are included.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@anakrish

Copy link
Copy Markdown
Collaborator

Maksym (@maksym-mishchenko) Thanks for fixing this gap. LGTM.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The binding correctly forwards validated values and is thoroughly tested and documented.

Pull request overview

Exposes the native RVM instruction budget to C# callers while preserving existing execution semantics.

Changes:

  • Adds Rvm.SetMaxInstructions(ulong) with pointer-width validation.
  • Adds comprehensive native and C# lifecycle tests.
  • Documents budget behavior and error handling.
File summaries
File Description
src/rvm/vm/execution.rs Adds instruction-budget behavior tests.
docs/rvm/vm-runtime.md Documents runtime budget semantics.
bindings/csharp/Regorus/Rvm.cs Adds the public C# setter.
bindings/csharp/Regorus.Tests/RvmProgramTests.cs Adds C# integration and boundary tests.
bindings/csharp/README.md Adds usage guidance.
bindings/csharp/API.md Updates the public API reference.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@anakrish
Anand Krishnamoorthi (anakrish) merged commit aae56a0 into microsoft:main Sep 9, 2026
60 checks passed
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.

3 participants