WEBVTT

1
00:00:00.300 --> 00:00:05.233
An access service may apply the same policy thousands of times.

2
00:00:05.233 --> 00:00:10.233
Rebuilding its internal representation for every request can repeat preparation that has

3
00:00:10.233 --> 00:00:12.233
already been done.

4
00:00:12.233 --> 00:00:16.567
This lesson follows one small policy through new requests, a policy

5
00:00:16.567 --> 00:00:19.733
revision, and a process restart.

6
00:00:19.733 --> 00:00:23.567
We will separate the rule we can reuse from the answer we must obtain

7
00:00:23.567 --> 00:00:26.367
for the current request.

8
00:00:26.367 --> 00:00:30.467
That distinction matters whenever cached work outlives the circumstances

9
00:00:30.467 --> 00:00:32.300
that made it valid.

10
00:00:32.300 --> 00:00:36.467
Our examples are about exact behavior and reuse.

11
00:00:36.467 --> 00:00:39.995
They are not new speed measurements.

12
00:00:39.995 --> 00:00:40.000
They are not new speed measurements.

13
00:00:40.300 --> 00:00:45.900
For this teaching policy, role means that the person is approved staff.

14
00:00:45.900 --> 00:00:50.667
Region means that the request comes from an allowed location.

15
00:00:50.667 --> 00:00:55.967
One means the condition is true, and zero means it is false.

16
00:00:55.967 --> 00:01:01.100
Version one permits access only when both conditions are true.

17
00:01:01.100 --> 00:01:04.233
We write that as role and region.

18
00:01:04.233 --> 00:01:08.967
The word and requires both inputs to be one.

19
00:01:08.967 --> 00:01:12.400
These are deliberately simple conditions.

20
00:01:12.400 --> 00:01:16.367
The application is responsible for supplying their current values

21
00:01:16.367 --> 00:01:19.600
and keeping their meanings consistent.

22
00:01:19.900 --> 00:01:23.267
Our first request has role one and region one.

23
00:01:23.267 --> 00:01:27.667
The person is approved staff, and the location is allowed.

24
00:01:27.667 --> 00:01:30.467
Substitute those values into the rule.

25
00:01:30.467 --> 00:01:32.433
One and one gives one.

26
00:01:32.433 --> 00:01:37.533
Both requirements are satisfied, so this request is allowed.

27
00:01:37.533 --> 00:01:41.567
This allow decision belongs to this request under version one.

28
00:01:41.567 --> 00:01:45.386
It is not a promise about the next request.

29
00:01:45.386 --> 00:01:45.400
It is not a promise about the next request.

30
00:01:45.700 --> 00:01:49.900
Compilation turns the source expression into an internal representation

31
00:01:49.900 --> 00:01:52.300
that an evaluator can use.

32
00:01:52.300 --> 00:01:58.167
For our small rule, it records the inputs and the and operation connecting them.

33
00:01:58.167 --> 00:02:02.367
The input values are supplied when we evaluate a request.

34
00:02:02.367 --> 00:02:08.833
The resulting allow or deny bit is a different object from the compiled representation.

35
00:02:08.833 --> 00:02:15.233
In the current C M I R path, the persistent cache stores compiled representation nodes.

36
00:02:15.233 --> 00:02:19.967
Reusing those nodes does not mean that every later preparation step or every requested

37
00:02:19.967 --> 00:02:23.133
output has already been computed.

38
00:02:23.433 --> 00:02:27.767
A cache keeps reusable work under an identifying key.

39
00:02:27.767 --> 00:02:31.200
Before lookup, this compiler checks that the expression graph is

40
00:02:31.200 --> 00:02:34.800
acceptable, including its structural limits.

41
00:02:34.800 --> 00:02:39.300
With the cache enabled and initially empty, the lookup misses.

42
00:02:39.300 --> 00:02:43.333
The system builds the representation and stores it.

43
00:02:43.333 --> 00:02:49.300
A later admitted lookup for the same compatible structure can hit that entry and reuse it.

44
00:02:49.300 --> 00:02:53.400
In the current implementation, the key includes an expression-structure

45
00:02:53.400 --> 00:02:57.067
digest and the flattening option.

46
00:02:57.067 --> 00:03:01.133
A hit also depends on the entry still being present.

47
00:03:01.133 --> 00:03:06.800
Clearing the cache or evicting an entry can turn a later lookup into a miss.

48
00:03:06.800 --> 00:03:11.995
Reuse is conditional, even inside the same process.

49
00:03:11.995 --> 00:03:12.000
Reuse is conditional, even inside the same process.

50
00:03:12.300 --> 00:03:14.467
Now a second request arrives.

51
00:03:14.467 --> 00:03:18.333
The person is still approved staff, but the location is not allowed.

52
00:03:18.333 --> 00:03:21.100
The policy remains role and region.

53
00:03:21.100 --> 00:03:26.033
We can reuse the compiled representation and evaluate it with these new inputs.

54
00:03:26.033 --> 00:03:30.833
One and zero gives zero, so the second request is denied.

55
00:03:30.833 --> 00:03:34.000
The same program has produced two different answers.

56
00:03:34.000 --> 00:03:36.867
Copying the previous allow bit would be wrong.

57
00:03:36.867 --> 00:03:39.900
Caching a representation and caching a request result

58
00:03:39.900 --> 00:03:43.500
require different validity conditions.

59
00:03:43.800 --> 00:03:46.300
Suppose the policy changes.

60
00:03:46.300 --> 00:03:49.300
Version two adds a resource requirement.

61
00:03:49.300 --> 00:03:53.433
Resource is one when the requested resource meets that requirement, and zero

62
00:03:53.433 --> 00:03:55.333
when it does not.

63
00:03:55.333 --> 00:04:00.233
The new rule requires role, region, and resource all to be true.

64
00:04:00.233 --> 00:04:03.033
This changes the expression structure.

65
00:04:03.033 --> 00:04:09.500
It is a new complete rule to compile or retrieve under its own compatible identity.

66
00:04:09.500 --> 00:04:13.533
We have changed the policy, not merely the request values.

67
00:04:13.533 --> 00:04:17.924
Keep both versions visible while we work the consequence.

68
00:04:17.924 --> 00:04:17.933
Keep both versions visible while we work the consequence.

69
00:04:18.233 --> 00:04:23.733
Consider one request with role one, region one, and resource zero.

70
00:04:23.733 --> 00:04:26.967
Version one looks only at role and region.

71
00:04:26.967 --> 00:04:31.233
It computes one and one, and allows access.

72
00:04:31.233 --> 00:04:36.133
Version two begins with the same two values, giving an intermediate one.

73
00:04:36.133 --> 00:04:39.400
It then combines that one with resource zero.

74
00:04:39.400 --> 00:04:45.400
One and zero gives zero, so the revised policy denies access.

75
00:04:45.400 --> 00:04:49.767
The old result is not an approximate answer to the new policy.

76
00:04:49.767 --> 00:04:52.300
It is the answer to a different rule.

77
00:04:52.300 --> 00:04:58.123
The complete version-one artifact cannot substitute for version two.

78
00:04:58.123 --> 00:04:58.133
The complete version-one artifact cannot substitute for version two.

79
00:04:58.433 --> 00:05:04.167
Changing the complete rule does not mean that every unchanged piece must be thrown away.

80
00:05:04.167 --> 00:05:09.433
The subexpression role and region still occurs inside version two.

81
00:05:09.433 --> 00:05:15.367
The current compiler can reuse compatible cached subtrees in suitable contexts.

82
00:05:15.367 --> 00:05:20.500
Where shared associative structure makes compilation context-dependent, it uses a

83
00:05:20.500 --> 00:05:24.167
root-level cache path instead.

84
00:05:24.167 --> 00:05:29.800
The practical conclusion is precise: do not reuse an obsolete complete rule, but do not

85
00:05:29.800 --> 00:05:34.233
confuse that requirement with discarding all valid shared work.

86
00:05:34.233 --> 00:05:39.722
The compiler decides which compatible pieces it can safely reuse.

87
00:05:39.722 --> 00:05:39.733
The compiler decides which compatible pieces it can safely reuse.

88
00:05:40.033 --> 00:05:42.367
There is another kind of change.

89
00:05:42.367 --> 00:05:47.567
Suppose the expression still says role and region, but the application's definition of an

90
00:05:47.567 --> 00:05:50.433
allowed location changes.

91
00:05:50.433 --> 00:05:55.933
A structural digest cannot discover a meaning that was never encoded in the expression.

92
00:05:55.933 --> 00:06:00.033
The application must update the values or dependencies that represent

93
00:06:00.033 --> 00:06:03.200
the new location policy.

94
00:06:03.200 --> 00:06:08.433
The same representation may still be usable with correctly updated inputs.

95
00:06:08.433 --> 00:06:14.167
What is unsafe is treating unchanged symbols or a matching digest as evidence that an old

96
00:06:14.167 --> 00:06:17.231
decision remains valid.

97
00:06:17.231 --> 00:06:17.233
decision remains valid.

98
00:06:17.533 --> 00:06:21.233
A process is one running instance of the program.

99
00:06:21.233 --> 00:06:26.467
While process A runs, it can retain its cache between calls.

100
00:06:26.467 --> 00:06:29.700
Now end that process.

101
00:06:29.700 --> 00:06:33.033
Start a fresh, independent process B.

102
00:06:33.033 --> 00:06:38.000
The source expression may be identical, but the old in-memory cache entry has not

103
00:06:38.000 --> 00:06:42.500
automatically travelled into the new process.

104
00:06:42.500 --> 00:06:48.800
In this C M I R API, persistent describes reuse within the process.

105
00:06:48.800 --> 00:06:55.967
The cache itself does not promise storage on disk or survival across this restart.

106
00:06:56.267 --> 00:07:00.600
To carry structure across a restart, something must explicitly save

107
00:07:00.600 --> 00:07:03.133
it and later reconstruct it.

108
00:07:03.133 --> 00:07:07.200
That is a separate serialization and reload path.

109
00:07:07.200 --> 00:07:13.067
The repository has bounded research bundles containing flat instructions or clauses.

110
00:07:13.067 --> 00:07:16.833
Those bundles exclude cached query answers.

111
00:07:16.833 --> 00:07:21.133
Loading their structure is not the same operation as finding a live node

112
00:07:21.133 --> 00:07:23.900
in the process cache.

113
00:07:23.900 --> 00:07:28.833
A reload includes decoding, validation, and reconstruction before

114
00:07:28.833 --> 00:07:31.833
the requested outputs are evaluated.

115
00:07:31.833 --> 00:07:36.930
Those steps have their own cost and correctness obligations.

116
00:07:36.930 --> 00:07:36.933
Those steps have their own cost and correctness obligations.

117
00:07:37.233 --> 00:07:42.033
For these research bundles, first check the format and backend.

118
00:07:42.033 --> 00:07:47.333
Then check the expected scenario, variable count, and version identities.

119
00:07:47.333 --> 00:07:54.300
A file for a different scenario is not interchangeable just because it can be decoded.

120
00:07:54.300 --> 00:08:00.533
Next validate the serialized instructions or clauses and reconstruct the structure.

121
00:08:00.533 --> 00:08:05.900
The research validation also compares the resulting behavior with independently computed

122
00:08:05.900 --> 00:08:09.400
scalar reference outputs.

123
00:08:09.400 --> 00:08:11.633
These are separate checks.

124
00:08:11.633 --> 00:08:16.667
A byte hash can identify the payload being examined, but it does not replace format

125
00:08:16.667 --> 00:08:20.400
admission or an exact behavior check.

126
00:08:20.700 --> 00:08:24.567
Imagine a saved bundle that still names the expected scenario, but

127
00:08:24.567 --> 00:08:27.667
declares an unsupported format version.

128
00:08:27.667 --> 00:08:32.667
Keep the source identity fixed and change only this format field.

129
00:08:32.667 --> 00:08:35.733
The loader must refuse that artifact.

130
00:08:35.733 --> 00:08:40.067
It has not evaluated the policy and found the request false.

131
00:08:40.067 --> 00:08:44.433
It has declined to accept this representation.

132
00:08:44.433 --> 00:08:49.133
The application can use a supported rebuild path where available.

133
00:08:49.133 --> 00:08:54.600
It must not silently turn a loading failure into a cached allow decision, or mistake it

134
00:08:54.600 --> 00:08:57.821
for a valid deny result.

135
00:08:57.821 --> 00:08:57.833
for a valid deny result.

136
00:08:58.133 --> 00:09:03.167
For a new request under the same valid rule, reuse the representation when available and

137
00:09:03.167 --> 00:09:05.667
evaluate the current inputs.

138
00:09:05.667 --> 00:09:10.433
For a revised rule, use the revised complete artifact.

139
00:09:10.433 --> 00:09:16.500
For a fresh process, rebuild or follow a separately supported and validated reload path.

140
00:09:16.500 --> 00:09:23.333
For an unsupported saved format, refuse the artifact rather than infer a policy decision.

141
00:09:23.333 --> 00:09:27.967
Reliable reuse means knowing what was saved, what stayed valid, and what still

142
00:09:27.967 --> 00:09:29.667
has to be computed.

143
00:09:29.667 --> 00:09:33.067
That is the foundation for both correct behavior and an honest measurement

144
00:09:33.067 --> 00:09:36.400
of any saved work.
