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
Copy file name to clipboardExpand all lines: CHANGELOG.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
### Added
10
10
11
11
-*(rvm)* add opt-in per-execution memory budgets for run-to-completion evaluation, including typed Rust and binding errors ([#792](https://github.com/microsoft/regorus/pull/792))
12
-
-*(rvm,ffi,csharp)* add scoped evaluation-memory budgeting via `RegoVM::with_evaluation_memory_budget` and one-call data execution helpers for charging evaluation-specific data with execution ([#792](https://github.com/microsoft/regorus/pull/792))
Ordinary `Execute` and `ExecuteEntryPoint` calls use the existing VM data and start a fresh budget for execution. Program compilation, program loading, and prior `SetDataJson`, `SetInputJson`, and `SetContextJson` calls are excluded; use this path for static or preloaded data.
104
+
Ordinary `Execute` and `ExecuteEntryPoint` calls use the existing VM data and start a fresh budget for execution. Program compilation, program loading, and prior `SetDataJson`, `SetInputJson`, and `SetContextJson` calls occur before and outside the budget; use this path for static or preloaded data.
Use `ExecuteWithDataJson`, `ExecuteEntryPointWithDataJson(string, string)`, or `ExecuteEntryPointWithDataJson(ulong, string)` when evaluation-specific data should be charged with execution. These methods make one native call that includes native JSON parsing/storage for `dataJson`, execution, native JSON serialization, and native C-string allocation. Managed UTF-8 decoding and the managed C# `string` allocation after the native call returns are not charged.
125
-
126
-
If scoped data replacement fails, the VM keeps its previous data. The previous and provisional native data can coexist transiently, so both count toward the peak live bytes observed by the budget.
120
+
Native result JSON serialization and C-string allocation are included before an `Execute` or `ExecuteEntryPoint` call returns. Managed UTF-8 decoding and the managed C# `string` allocation after the native call returns are excluded.
127
121
128
-
Memory budgets require a native library built with allocator memory tracking and are supported only for run-to-completion execution. `RegorusMemoryBudgetExceededException` is thrown when a budget is exceeded. `RegorusMemoryBudgetUnsupportedException` is thrown if a configured budget is used to start or resume suspendable execution. Enforcement is cooperative, so one instruction can overshoot before the next checkpoint. Same-thread baseline ratcheting can make the effective limit stricter after unrelated frees are observed; those frees are never credited back. Public multi-call begin/end scopes are intentionally absent because allocator counters are thread-local and abandoned or cross-thread scopes would be unsafe.
122
+
Memory budgets require a native library built with allocator memory tracking and are supported only for run-to-completion execution. `RegorusMemoryBudgetExceededException` is thrown when a budget is exceeded. `RegorusMemoryBudgetUnsupportedException` is thrown if a configured budget is used to start or resume suspendable execution. Enforcement is cooperative, so one instruction can overshoot before the next checkpoint. Same-thread baseline ratcheting can make the effective limit stricter after unrelated frees are observed; those frees are never credited back. Failed terminal execution clears retained state, and a reused VM gets a fresh budget. Public multi-call begin/end scopes are intentionally absent because allocator counters are thread-local and abandoned or cross-thread scopes would be unsafe.
RVM run-to-completion evaluation can use an optional additional live-memory budget. Each ordinary `Execute` or `ExecuteEntryPoint` call starts with a fresh budget for execution; program compilation, program loading, and prior `SetDataJson`, `SetInputJson`, and `SetContextJson` calls are not charged.
110
+
RVM run-to-completion evaluation can use an optional additional live-memory budget. Each ordinary `Execute` or `ExecuteEntryPoint` call starts with a fresh budget for execution; program compilation, program loading, and prior `SetDataJson`, `SetInputJson`, and `SetContextJson` calls occur before and outside that budget.
Use the one-call `Execute*WithDataJson` methods when evaluation-specific data should be charged in the same native budget scope as execution:
129
+
The native execution budget includes result JSON serialization and C-string allocation before the native call returns. Managed UTF-8 decoding and C# `string` allocation after that return are not charged.
Those methods include native JSON parsing/storage for `dataJson`, execution, native result JSON serialization, and native C-string allocation. Managed UTF-8 decoding and C# `string` allocation after the native call returns are not charged. If scoped data replacement fails, the previous VM data is preserved, but the previous and provisional data may coexist transiently and count toward peak live bytes.
138
-
139
-
The budget is cooperative and may overshoot between VM checks. Same-thread allocation-counter baseline ratcheting can make the effective limit stricter after unrelated frees are observed; those frees are not credited back. Budgets are not supported in suspendable execution mode. `ClearMemoryBudgetConfig` restores the previous unlimited per-execution behavior. Public multi-call begin/end scopes are intentionally absent because allocator counters are thread-local. The process-wide limit exposed by `MemoryLimits` remains a separate safeguard.
131
+
The budget is cooperative and may overshoot between VM checks. Same-thread allocation-counter baseline ratcheting can make the effective limit stricter after unrelated frees are observed; those frees are not credited back. Budgets are not supported in suspendable execution mode. `ClearMemoryBudgetConfig` restores the previous unlimited per-execution behavior. Public multi-call begin/end scopes are intentionally absent because allocator counters are thread-local. Failed terminal execution clears retained state, and a reused VM starts a fresh budget. The process-wide limit exposed by `MemoryLimits` remains a separate safeguard.
Copy file name to clipboardExpand all lines: bindings/ffi/CHANGELOG.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
9
9
### Added
10
10
11
-
- Add `regorus_rvm_set_memory_budget_config`, `RegorusMemoryBudgetConfig`, and appended statuses for memory-budget exhaustion and unsupported suspendable execution.
12
-
- Add one-call RVM data execution APIs: `regorus_rvm_execute_with_data`,
13
-
`regorus_rvm_execute_entry_point_by_name_with_data`, and
14
-
`regorus_rvm_execute_entry_point_by_index_with_data`. Their memory-budget scope covers data
15
-
preparation, execution, and native result production.
11
+
- Add execute-only RVM memory-budget configuration through
12
+
`regorus_rvm_set_memory_budget_config`, `RegorusMemoryBudgetConfig`, and appended statuses for
13
+
exhaustion and unsupported suspendable execution. Native execute result serialization and C-string
0 commit comments