WEBVTT

00:00:00.500 --> 00:00:02.322
Start with Records on the right.

00:00:03.223 --> 00:00:07.025
When the canister takes a snapshot, this service opens its Hylix

00:00:07.038 --> 00:00:07.689
record.

00:00:08.588 --> 00:00:11.582
Follow the retained descriptor down to the bytes it will read.

00:00:12.481 --> 00:00:15.736
The encoded record holds a revision and handles for the entries

00:00:15.749 --> 00:00:16.699
map and the blob.

00:00:17.598 --> 00:00:20.306
Hylix's working set holds encoded bytes.

00:00:21.205 --> 00:00:24.564
When the service opens the record, Store decodes its fields

00:00:24.577 --> 00:00:25.853
into the actor frame.

00:00:26.752 --> 00:00:30.241
A later access in that frame reuses the decoded record.

00:00:32.367 --> 00:00:34.814
Watch the byte cache in a small native test.

00:00:35.715 --> 00:00:39.061
The first access loads a four-kibibyte segment into the Working

00:00:39.074 --> 00:00:39.465
Set.

00:00:40.363 --> 00:00:43.475
The test changes eight bytes inside that segment and reads them

00:00:43.488 --> 00:00:44.673
back from the same copy.

00:00:45.572 --> 00:00:47.772
The next write hits that resident segment.

00:00:48.671 --> 00:00:51.783
It changes the same eight bytes, and the next read sees the

00:00:51.796 --> 00:00:52.551
new value.

00:00:53.449 --> 00:00:55.546
Repeat the loop up to one thousand.

00:00:56.444 --> 00:00:59.100
All those edits leave just one span to flush.

00:00:59.999 --> 00:01:03.150
When the write frame ends, the provider gets one eight-byte

00:01:03.163 --> 00:01:03.580
write.

00:01:04.478 --> 00:01:07.264
The test counted one segment read and that one write.

00:01:08.163 --> 00:01:10.871
Reopen the arena and read the allocation again.

00:01:11.770 --> 00:01:13.892
The saved value is one thousand.

00:01:16.033 --> 00:01:19.366
Back in the probe, one update rewrites both modules.

00:01:20.266 --> 00:01:22.740
Payloads replaces its fixed vector first.

00:01:23.639 --> 00:01:26.868
Records then rewrites the map and blob and sets its revision

00:01:26.881 --> 00:01:27.389
to one.

00:01:28.287 --> 00:01:31.087
The collection writes reach the byte cache during the call.

00:01:31.985 --> 00:01:35.371
At the end of the frame, Store encodes the dirty record into

00:01:35.384 --> 00:01:36.048
the cache.

00:01:36.946 --> 00:01:40.058
The arena publishes its allocation metadata and flushes the

00:01:40.071 --> 00:01:42.259
remaining dirty spans to the provider.

00:01:43.157 --> 00:01:45.969
A snapshot query can read those committed bytes.

00:01:46.868 --> 00:01:50.527
When the query closes, its temporary decoded record and cache

00:01:50.540 --> 00:01:51.347
are discarded.

00:01:52.246 --> 00:01:54.850
The stable image stays as it was before the query.

00:01:55.748 --> 00:01:58.548
The snapshot returns both owners at revision one.

00:01:59.446 --> 00:02:02.324
Payloads has a new set of values in stable memory.

00:02:03.222 --> 00:02:06.074
Follow its retained vector descriptor for the next read.

