design: add initial conditions section to GC pacer redesign

I realized I neglected to talk about initial conditions, even though all
the simulations clearly set *something*.

For golang/go#44167.

Change-Id: Ia1727d5c068847e9192bf87bc1b6a5f0bb832303
Reviewed-on: https://go-review.googlesource.com/c/proposal/+/295509
Reviewed-by: Michael Pratt <mpratt@google.com>
diff --git a/design/44167-gc-pacer-redesign.md b/design/44167-gc-pacer-redesign.md
index 8bb27f9..23b4242 100644
--- a/design/44167-gc-pacer-redesign.md
+++ b/design/44167-gc-pacer-redesign.md
@@ -565,6 +565,27 @@
 It's not important to put these limits in the rest of the pacer because it no
 longer tries to compute the trigger point ahead of time.
 
+### Initial conditions
+
+Like today, the pacer has to start somewhere for the first GC.
+I propose we carry forward what we already do today: set the trigger point at
+7/8ths of the first heap goal, which will always be the minimum heap size.
+If GC 1 is the first GC, then in terms of the math above, we choose to avoid
+defining ![`M_0`](44167/inl27.png), and instead directly define
+
+![Equation 8](44167/eqn8.png)
+
+The definition of ![`P_0`](44167/inl28.png) is necessary for the GC assist
+pacer.
+
+Furthermore, the PI controller's state will be initialized to zero otherwise.
+
+These choices are somewhat arbitrary, but the fact is that the pacer has no
+knowledge of the progam's past behavior for the first GC.
+Naturally the behavior of the GC will always be a little odd, but it should, in
+general, stabilize quite quickly (note that this is the case in each scenario
+for the [simulations](#simulations).
+
 ## A note about CPU utilization
 
 This document uses the term "GC CPU utilization" quite frequently, but so far
@@ -591,7 +612,7 @@
 The latter is computed directly, but is just the difference between the start
 and end time in the critical section; it does not try to account for context
 switches forced by the underlying system, or anything like that.
-Now take this value we just computed and divide it by ![`T`](44167/inl27.png).
+Now take this value we just computed and divide it by ![`T`](44167/inl29.png).
 That's our GC CPU utilization.
 
 This approximation is mostly accurate in the common case, but is prone to skew
diff --git a/design/44167/eqn1.png b/design/44167/eqn1.png
index b72d192..7261d6e 100644
--- a/design/44167/eqn1.png
+++ b/design/44167/eqn1.png
Binary files differ
diff --git a/design/44167/eqn2.png b/design/44167/eqn2.png
index 42053ee..6207419 100644
--- a/design/44167/eqn2.png
+++ b/design/44167/eqn2.png
Binary files differ
diff --git a/design/44167/eqn3.png b/design/44167/eqn3.png
index 7ae3a88..1919c35 100644
--- a/design/44167/eqn3.png
+++ b/design/44167/eqn3.png
Binary files differ
diff --git a/design/44167/eqn4.png b/design/44167/eqn4.png
index 784db07..0ec898d 100644
--- a/design/44167/eqn4.png
+++ b/design/44167/eqn4.png
Binary files differ
diff --git a/design/44167/eqn5.png b/design/44167/eqn5.png
index fade575..c120a67 100644
--- a/design/44167/eqn5.png
+++ b/design/44167/eqn5.png
Binary files differ
diff --git a/design/44167/eqn6.png b/design/44167/eqn6.png
index f6bd4f4..6806914 100644
--- a/design/44167/eqn6.png
+++ b/design/44167/eqn6.png
Binary files differ
diff --git a/design/44167/eqn7.png b/design/44167/eqn7.png
index 1e0b3b4..6c02c17 100644
--- a/design/44167/eqn7.png
+++ b/design/44167/eqn7.png
Binary files differ
diff --git a/design/44167/eqn8.png b/design/44167/eqn8.png
index b11aae2..302e9ed 100644
--- a/design/44167/eqn8.png
+++ b/design/44167/eqn8.png
Binary files differ
diff --git a/design/44167/gc-pacer-redesign.src.md b/design/44167/gc-pacer-redesign.src.md
index 3268a56..1420b34 100644
--- a/design/44167/gc-pacer-redesign.src.md
+++ b/design/44167/gc-pacer-redesign.src.md
@@ -573,6 +573,32 @@
 It's not important to put these limits in the rest of the pacer because it no
 longer tries to compute the trigger point ahead of time.
 
+### Initial conditions
+
+Like today, the pacer has to start somewhere for the first GC.
+I propose we carry forward what we already do today: set the trigger point at
+7/8ths of the first heap goal, which will always be the minimum heap size.
+If GC 1 is the first GC, then in terms of the math above, we choose to avoid
+defining `$M_0$`, and instead directly define
+
+```render-latex
+\begin{aligned}
+N_1 & = \textrm{minimum heap size} \\
+T_1 & = \frac{7}{8} N_1 \\
+P_0 & = 0
+\end{aligned}
+```
+
+The definition of `$P_0$` is necessary for the GC assist pacer.
+
+Furthermore, the PI controller's state will be initialized to zero otherwise.
+
+These choices are somewhat arbitrary, but the fact is that the pacer has no
+knowledge of the progam's past behavior for the first GC.
+Naturally the behavior of the GC will always be a little odd, but it should, in
+general, stabilize quite quickly (note that this is the case in each scenario
+for the [simulations](#simulations).
+
 ## A note about CPU utilization
 
 This document uses the term "GC CPU utilization" quite frequently, but so far
diff --git a/design/44167/inl1.png b/design/44167/inl1.png
index f8832b6..65e95c4 100644
--- a/design/44167/inl1.png
+++ b/design/44167/inl1.png
Binary files differ
diff --git a/design/44167/inl10.png b/design/44167/inl10.png
index ddac0d0..d456b71 100644
--- a/design/44167/inl10.png
+++ b/design/44167/inl10.png
Binary files differ
diff --git a/design/44167/inl11.png b/design/44167/inl11.png
index 759de77..b49102e 100644
--- a/design/44167/inl11.png
+++ b/design/44167/inl11.png
Binary files differ
diff --git a/design/44167/inl12.png b/design/44167/inl12.png
index 3d9bb4a..e01717e 100644
--- a/design/44167/inl12.png
+++ b/design/44167/inl12.png
Binary files differ
diff --git a/design/44167/inl13.png b/design/44167/inl13.png
index acfc8e8..49e45f3 100644
--- a/design/44167/inl13.png
+++ b/design/44167/inl13.png
Binary files differ
diff --git a/design/44167/inl14.png b/design/44167/inl14.png
index 62a247d..8fbcaba 100644
--- a/design/44167/inl14.png
+++ b/design/44167/inl14.png
Binary files differ
diff --git a/design/44167/inl15.png b/design/44167/inl15.png
index 5586f7c..0c92c3b 100644
--- a/design/44167/inl15.png
+++ b/design/44167/inl15.png
Binary files differ
diff --git a/design/44167/inl16.png b/design/44167/inl16.png
index 19a3be1..bb885e8 100644
--- a/design/44167/inl16.png
+++ b/design/44167/inl16.png
Binary files differ
diff --git a/design/44167/inl17.png b/design/44167/inl17.png
index c6eb198..de913d6 100644
--- a/design/44167/inl17.png
+++ b/design/44167/inl17.png
Binary files differ
diff --git a/design/44167/inl18.png b/design/44167/inl18.png
index 46258c0..cc76b06 100644
--- a/design/44167/inl18.png
+++ b/design/44167/inl18.png
Binary files differ
diff --git a/design/44167/inl19.png b/design/44167/inl19.png
index 8954e04..f258005 100644
--- a/design/44167/inl19.png
+++ b/design/44167/inl19.png
Binary files differ
diff --git a/design/44167/inl2.png b/design/44167/inl2.png
index 3b2906d..b75dfe1 100644
--- a/design/44167/inl2.png
+++ b/design/44167/inl2.png
Binary files differ
diff --git a/design/44167/inl20.png b/design/44167/inl20.png
index e2ff650..ebd9fee 100644
--- a/design/44167/inl20.png
+++ b/design/44167/inl20.png
Binary files differ
diff --git a/design/44167/inl21.png b/design/44167/inl21.png
index 34b21bc..65057ea 100644
--- a/design/44167/inl21.png
+++ b/design/44167/inl21.png
Binary files differ
diff --git a/design/44167/inl22.png b/design/44167/inl22.png
index 7e49cfe..df1cd2f 100644
--- a/design/44167/inl22.png
+++ b/design/44167/inl22.png
Binary files differ
diff --git a/design/44167/inl23.png b/design/44167/inl23.png
index 60d3514..58366dc 100644
--- a/design/44167/inl23.png
+++ b/design/44167/inl23.png
Binary files differ
diff --git a/design/44167/inl24.png b/design/44167/inl24.png
index af0131c..254ac81 100644
--- a/design/44167/inl24.png
+++ b/design/44167/inl24.png
Binary files differ
diff --git a/design/44167/inl25.png b/design/44167/inl25.png
index 20af26a..be1423f 100644
--- a/design/44167/inl25.png
+++ b/design/44167/inl25.png
Binary files differ
diff --git a/design/44167/inl26.png b/design/44167/inl26.png
index 1f48988..5d08eab 100644
--- a/design/44167/inl26.png
+++ b/design/44167/inl26.png
Binary files differ
diff --git a/design/44167/inl27.png b/design/44167/inl27.png
new file mode 100644
index 0000000..1752ae2
--- /dev/null
+++ b/design/44167/inl27.png
Binary files differ
diff --git a/design/44167/inl28.png b/design/44167/inl28.png
new file mode 100644
index 0000000..f385442
--- /dev/null
+++ b/design/44167/inl28.png
Binary files differ
diff --git a/design/44167/inl29.png b/design/44167/inl29.png
new file mode 100644
index 0000000..f447caa
--- /dev/null
+++ b/design/44167/inl29.png
Binary files differ
diff --git a/design/44167/inl3.png b/design/44167/inl3.png
index 636e5fb..42bb9f1 100644
--- a/design/44167/inl3.png
+++ b/design/44167/inl3.png
Binary files differ
diff --git a/design/44167/inl4.png b/design/44167/inl4.png
index 03cdee9..ea1729a 100644
--- a/design/44167/inl4.png
+++ b/design/44167/inl4.png
Binary files differ
diff --git a/design/44167/inl5.png b/design/44167/inl5.png
index 32ec3e5..7090982 100644
--- a/design/44167/inl5.png
+++ b/design/44167/inl5.png
Binary files differ
diff --git a/design/44167/inl6.png b/design/44167/inl6.png
index 2aeb809..4c5d9a4 100644
--- a/design/44167/inl6.png
+++ b/design/44167/inl6.png
Binary files differ
diff --git a/design/44167/inl7.png b/design/44167/inl7.png
index 1e2056e..5516cd6 100644
--- a/design/44167/inl7.png
+++ b/design/44167/inl7.png
Binary files differ
diff --git a/design/44167/inl8.png b/design/44167/inl8.png
index 922811f..fa56487 100644
--- a/design/44167/inl8.png
+++ b/design/44167/inl8.png
Binary files differ
diff --git a/design/44167/inl9.png b/design/44167/inl9.png
index 2f96e9f..05c1a1c 100644
--- a/design/44167/inl9.png
+++ b/design/44167/inl9.png
Binary files differ