DigestTrace class final
The digest of a running simulation, taken every so many steps.
This is the instrument the whole cloud service rests on, and the reason
it is written before the service: a run submitted to a server is verified by
replaying it, and a replay is only evidence if the same tape produces the
same run on the server's machine as on the player's. Whether it does is a
measurement, not an assumption — dart:math's sin is a platform's libm on
the VM and the browser's own routine on the web, and neither IEEE 754 nor
the Dart specification says the two agree on the last bit.
A trace turns that from one bit of news into a location. Two traces of the same tape either match, or they name the first checkpoint at which they stopped matching, and the defect is between that checkpoint and the one before.
Constructors
- DigestTrace({int every = 25})
-
DigestTrace.fromJson(Map<
String, Object?> json) -
Reads a trace back, or throws a DigestTraceFormatException that says
why not.
factory
Properties
-
digests
→ List<
int> -
The digest at each of steps.
no setter
- every → int
-
How many steps pass between checkpoints.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hexDigests
→ List<
String> -
The digests as eight-digit hexadecimal, which is how a trace is committed.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
steps
→ List<
int> -
The step numbers checkpointed, in order.
no setter
Methods
-
divergenceFrom(
List< int> expected) → Divergence? -
The first checkpoint at which this trace and
expecteddisagree. -
divergenceFromHex(
List< String> expected) → Divergence? - The same question against a trace written as hexadecimal.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
observe(
int step, Object? state) → void -
Takes a checkpoint if
stepis one, and does nothing if it is not. -
toJson(
) → Map< String, Object?> -
Writes this trace down —
every, the checkpointed steps, and their digests as hex — the shape a.f3drun'scheckpointsfield holds. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited