[L] Change in dart/sdk[main]: [ Service ] Add expression evaluation support to dart_runtime_service_vm

0 views
Skip to first unread message

Ben Konyi (Gerrit)

unread,
Mar 12, 2026, 1:52:55 PMMar 12
to Jessy Yameogo, Nicholas Shahan, Mark Zhou, Srujan Gaddam, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Jessy Yameogo and Nicholas Shahan

Ben Konyi voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Jessy Yameogo
  • Nicholas Shahan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Gerrit-Change-Number: 487560
Gerrit-PatchSet: 3
Gerrit-Owner: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Jessy Yameogo <yje...@google.com>
Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
Gerrit-CC: Mark Zhou <mark...@google.com>
Gerrit-CC: Srujan Gaddam <sru...@google.com>
Gerrit-Attention: Jessy Yameogo <yje...@google.com>
Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
Gerrit-Comment-Date: Thu, 12 Mar 2026 17:52:53 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Nicholas Shahan (Gerrit)

unread,
Mar 12, 2026, 5:43:42 PMMar 12
to Ben Konyi, Commit Queue, Jessy Yameogo, Mark Zhou, Srujan Gaddam, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Jessy Yameogo

Nicholas Shahan added 3 comments

File pkg/dart_runtime_service/lib/src/expression_evaluator.dart
Line 28, Patchset 4 (Latest): Future<RpcResponse> evaluate(json_rpc.Parameters parameters);
Nicholas Shahan . unresolved

Are we hoping to align these parameters across the various implementations? Right now it's not obvious what the parameters are.

File pkg/dart_runtime_service_vm/lib/src/native_bindings.dart
Line 129, Patchset 4 (Latest): const kResult = 'result';
const kError = 'error';
const kCode = 'code';
const kMessage = 'message';
const kData = 'data';
Nicholas Shahan . unresolved

Should we define these somewhere so they can be reused by other runtime services?

OK to punt of that until we start implementing the next runtime service though.

Line 146, Patchset 4 (Latest): final data = (converted[kError]! as Map<String, Object?>)[kData];
Nicholas Shahan . unresolved

Is the `kData` key not always present? This could warrant a comment here explaining why this isn't part of the destructuring case.

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Jessy Yameogo
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Gerrit-Change-Number: 487560
Gerrit-PatchSet: 4
Gerrit-Owner: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Jessy Yameogo <yje...@google.com>
Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
Gerrit-CC: Mark Zhou <mark...@google.com>
Gerrit-CC: Srujan Gaddam <sru...@google.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Attention: Jessy Yameogo <yje...@google.com>
Gerrit-Comment-Date: Thu, 12 Mar 2026 21:43:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ben Konyi (Gerrit)

unread,
Mar 13, 2026, 12:47:31 PMMar 13
to Commit Queue, Jessy Yameogo, Nicholas Shahan, Mark Zhou, Srujan Gaddam, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Jessy Yameogo and Nicholas Shahan

Ben Konyi voted and added 3 comments

Votes added by Ben Konyi

Commit-Queue+1

3 comments

File pkg/dart_runtime_service/lib/src/expression_evaluator.dart
Line 28, Patchset 4: Future<RpcResponse> evaluate(json_rpc.Parameters parameters);
Nicholas Shahan . resolved

Are we hoping to align these parameters across the various implementations? Right now it's not obvious what the parameters are.

Ben Konyi

Yeah, these parameters will be identical across implementations. I passed the raw parameters here since then I could simply forward them directly to the internal RPCs and not have to rebuild a new `Parameters` object. However, it's probably better to be more explicit than to try and save a few cycles and small memory allocations.

I've gone ahead and also added some documentation explaining what the expected parameters are.

File pkg/dart_runtime_service_vm/lib/src/native_bindings.dart
Line 129, Patchset 4: const kResult = 'result';

const kError = 'error';
const kCode = 'code';
const kMessage = 'message';
const kData = 'data';
Nicholas Shahan . resolved

Should we define these somewhere so they can be reused by other runtime services?

OK to punt of that until we start implementing the next runtime service though.

Ben Konyi

I'm not sure we'll actually need to. The main reason these are defined here is because we're parsing full JSON-RPC responses from the native VM and transforming them into a returned result or thrown RpcException that `package:json_rpc_2` can handle.

For the other services, we (probably) won't have this same transformation and will most likely be building the responses from scratch in Dart code. If we need these constants, we can find a better home for them then 😊

Line 146, Patchset 4: final data = (converted[kError]! as Map<String, Object?>)[kData];
Nicholas Shahan . resolved

Is the `kData` key not always present? This could warrant a comment here explaining why this isn't part of the destructuring case.

Ben Konyi

That's correct, `kData` isn't always present. I'll add a comment.

Open in Gerrit

Related details

Attention is currently required from:
  • Jessy Yameogo
  • Nicholas Shahan
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Gerrit-Change-Number: 487560
Gerrit-PatchSet: 5
Gerrit-Owner: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Jessy Yameogo <yje...@google.com>
Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
Gerrit-CC: Mark Zhou <mark...@google.com>
Gerrit-CC: Srujan Gaddam <sru...@google.com>
Gerrit-Attention: Jessy Yameogo <yje...@google.com>
Gerrit-Attention: Nicholas Shahan <nsh...@google.com>
Gerrit-Comment-Date: Fri, 13 Mar 2026 16:47:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Nicholas Shahan <nsh...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Nicholas Shahan (Gerrit)

unread,
Mar 13, 2026, 5:02:35 PMMar 13
to Ben Konyi, Commit Queue, Jessy Yameogo, Mark Zhou, Srujan Gaddam, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Ben Konyi and Jessy Yameogo

Nicholas Shahan voted and added 1 comment

Votes added by Nicholas Shahan

Code-Review+1

1 comment

File pkg/dart_runtime_service/lib/src/clients.dart
Line 176, Patchset 5 (Latest): String toString() => logger.name;
Nicholas Shahan . unresolved

Is it intentional to use the `logger.name` in the `Client.toString()`?

Open in Gerrit

Related details

Attention is currently required from:
  • Ben Konyi
  • Jessy Yameogo
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Gerrit-Change-Number: 487560
Gerrit-PatchSet: 5
Gerrit-Owner: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Jessy Yameogo <yje...@google.com>
Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
Gerrit-CC: Mark Zhou <mark...@google.com>
Gerrit-CC: Srujan Gaddam <sru...@google.com>
Gerrit-Attention: Ben Konyi <bko...@google.com>
Gerrit-Attention: Jessy Yameogo <yje...@google.com>
Gerrit-Comment-Date: Fri, 13 Mar 2026 21:02:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Ben Konyi (Gerrit)

unread,
Mar 16, 2026, 1:40:08 PMMar 16
to Nicholas Shahan, Commit Queue, Jessy Yameogo, Mark Zhou, Srujan Gaddam, rev...@dartlang.org, vm-...@dartlang.org
Attention needed from Jessy Yameogo

Ben Konyi voted and added 1 comment

Votes added by Ben Konyi

Commit-Queue+2

1 comment

File pkg/dart_runtime_service/lib/src/clients.dart
Line 176, Patchset 5: String toString() => logger.name;
Nicholas Shahan . resolved

Is it intentional to use the `logger.name` in the `Client.toString()`?

Ben Konyi

Yes, since I wanted the same name as the logger. I've gone ahead and inverted this so `toString() => 'Client ($name)'` and `Logger get logger => Logger(toString())` which is hopefully a bit clearer.

Open in Gerrit

Related details

Attention is currently required from:
  • Jessy Yameogo
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedCommit-Message-Has-TEST
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Gerrit-Change-Number: 487560
Gerrit-PatchSet: 6
Gerrit-Owner: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Jessy Yameogo <yje...@google.com>
Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
Gerrit-CC: Mark Zhou <mark...@google.com>
Gerrit-CC: Srujan Gaddam <sru...@google.com>
Gerrit-Attention: Jessy Yameogo <yje...@google.com>
Gerrit-Comment-Date: Mon, 16 Mar 2026 17:40:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Nicholas Shahan <nsh...@google.com>
satisfied_requirement
open
diffy

Commit Queue (Gerrit)

unread,
Mar 16, 2026, 2:14:56 PMMar 16
to Ben Konyi, Nicholas Shahan, Jessy Yameogo, Mark Zhou, Srujan Gaddam, rev...@dartlang.org, vm-...@dartlang.org

Commit Queue submitted the change with unreviewed changes

Unreviewed changes

5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: pkg/dart_runtime_service_vm/lib/src/vm_expression_evaluator.dart
Insertions: 2, Deletions: 1.

@@ -177,7 +177,8 @@
try {
if (externalClient != null) {
logger.info(
- 'Found external $kExternalCompileExpressionRpc service: $externalClient',
+ 'Found external $kExternalCompileExpressionRpc service: '
+ '$externalClient',
);
result = await externalClient.sendRequest(
method: kExternalCompileExpressionRpc,
```
```
The name of the file: pkg/dart_runtime_service/lib/src/clients.dart
Insertions: 2, Deletions: 2.

@@ -44,7 +44,7 @@
final DartRuntimeServiceBackend backend;

/// The logger to be used when handling requests from this client.
- Logger get logger => Logger('Client ($name)');
+ Logger get logger => Logger(toString());

/// A [Future] that completes when [close] is invoked.
late final Future<void> done;
@@ -173,7 +173,7 @@
late String _name;

@override
- String toString() => logger.name;
+ String toString() => 'Client ($name)';
}

/// Used for keeping track and managing clients that are connected to a given
```

Change information

Commit message:
[ Service ] Add expression evaluation support to dart_runtime_service_vm

Brings pass rate of package:vm_service tests to ~85%

TEST=Manual
Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487560
Reviewed-by: Nicholas Shahan <nsh...@google.com>
Commit-Queue: Ben Konyi <bko...@google.com>
Files:
  • M pkg/dart_runtime_service/lib/dart_runtime_service.dart
  • M pkg/dart_runtime_service/lib/src/clients.dart
  • M pkg/dart_runtime_service/lib/src/dart_runtime_service.dart
  • M pkg/dart_runtime_service/lib/src/dart_runtime_service_backend.dart
  • M pkg/dart_runtime_service/lib/src/dart_runtime_service_rpcs.dart
  • M pkg/dart_runtime_service/lib/src/event_streams.dart
  • A pkg/dart_runtime_service/lib/src/expression_evaluator.dart
  • M pkg/dart_runtime_service/lib/src/rpc_exceptions.dart
  • M pkg/dart_runtime_service/lib/src/utils.dart
  • M pkg/dart_runtime_service/test/utils/mocks.dart
  • M pkg/dart_runtime_service_vm/lib/dart_runtime_service_vm.dart
  • M pkg/dart_runtime_service_vm/lib/src/native_bindings.dart
  • A pkg/dart_runtime_service_vm/lib/src/vm_expression_evaluator.dart
  • M pkg/vm_service/test/evaluate_optimized_out_variable_test.dart
  • M pkg/vm_service/test/evaluate_uninitialized_late_variable_test.dart
  • M pkg/vm_service/test/external_service_registration_test.dart
  • M pkg/vm_service/test/get_instances_as_list_rpc_expression_evaluation_on_internal_test.dart
  • M pkg/vm_service/test/stream_subscription_test.dart
  • M runtime/bin/dartutils.cc
  • M runtime/bin/dartutils.h
Change size: L
Delta: 20 files changed, 427 insertions(+), 51 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Nicholas Shahan
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I2335d98358362110add93c2acfe51c3fc1385237
Gerrit-Change-Number: 487560
Gerrit-PatchSet: 7
Gerrit-Owner: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Ben Konyi <bko...@google.com>
Gerrit-Reviewer: Jessy Yameogo <yje...@google.com>
Gerrit-Reviewer: Nicholas Shahan <nsh...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages