docs: reorganise -- current reference gathered, finished work archived, superseded and dead ideas marked as such

docs/CLAUDE.md Phase 2, 2026-10-14.  All moves by git mv; every archived
file carries a header saying what it is, why, and where to look instead.

- docs/reference/ (new): roadmap and versioning policy, M7.1, word-ACL
  design, kernel args, hosted acceptance test, dictionary, primitives,
  ontology, L8 table -- previously spread over docs/, docs/lithosananke/
  and docs/03-architecture/.
- docs/working/archive/historical/: finished work (session plan, test-gap
  audit, birthing plan, fix write-ups, the January architecture draft).
- docs/working/archive/superseded/: the Hermes-VM Tripod docs and July
  Hermes designs (-> FABRIC-3.5/3.6), the StarForth roadmap, every working
  doc already flagged superseded or obsolete.
- docs/working/archive/dead/: the hal_* target contract (never adopted),
  L4Re, metrics-and-knobs.
- Papers and proposals into docs/working/papers/.
- References rewritten across the repo (not logs/, not docs/patent/);
  CLAUDE.md's documentation section rewritten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-14 16:03:56 -04:00
co-authored by Claude Opus 5.5
parent 1a4b163861
commit 7aed588f78
116 changed files with 305 additions and 175 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
<!-- Moved from docs/ONTOLOGY.md to docs/working/papers/ONTOLOGY.md on 2026-06-16 (docs reorg Phase 2) -->
<!-- Moved from docs/reference/ONTOLOGY.md to docs/working/papers/ONTOLOGY.md on 2026-06-16 (docs reorg Phase 2) -->
# StarForth Ontology, Taxonomy, and Lexicon
**Version**: 1.0
Binary file not shown.
+338
View File
@@ -0,0 +1,338 @@
% StarForth System Narrative
% Technical overview for research reviewers, patent counsel, and future reference
% Version 1.0 - 2025-12-13
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amssymb}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{hyperref}
\usepackage{parskip}
\title{\textbf{StarForth System Narrative}\\
\large The Story of a Provably Deterministic Adaptive Runtime}
\author{StarForth Project}
\date{December 13, 2025}
\begin{document}
\maketitle
\section*{Abstract}
This document presents the technical narrative of StarForth: a FORTH-79 virtual machine that achieves deterministic adaptive optimization through a thermodynamically-inspired feedback control system. We describe the problem, the approach, the implementation, and the experimental validation showing 0\% algorithmic variance across 90 independent runs. This is not marketing material. This is the technical story these systems and figures tell, presented for research evaluation and patent documentation.
\section{The Problem: Adaptive Runtimes Are Inherently Non-Deterministic}
Virtual machines optimize execution by learning from runtime behavior. The PyPy JIT compiler traces hot loops. The HotSpot JVM promotes frequently-executed methods. These systems work, but they share a fundamental limitation: \textit{adaptive optimization introduces non-determinism}.
Run the same program twice with the same input. The execution times differ. The compiled traces differ. The optimization decisions differ. Why? Because adaptive runtimes accumulate \textit{statistical noise}:
\begin{itemize}
\item Execution frequency counters depend on scheduling jitter
\item Cache eviction policies depend on memory pressure
\item Threshold-based decisions amplify small timing variations
\end{itemize}
For most applications, this non-determinism is acceptable. For safety-critical systems, real-time systems, and scientific reproducibility, it is not. The question becomes: \textit{Can an adaptive runtime be both adaptive and deterministic?}
\section{The Insight: Feedback Loops Converge to Attractors}
The key insight comes from dynamical systems theory. A system governed by feedback loops does not remain chaotic indefinitely. If the loops are properly designed, the system converges to a \textit{stable attractor}---a point in state space that the system approaches regardless of initial conditions.
Consider a simple example: exponential decay with constant input.
\begin{equation}
\frac{df}{dt} = r - \lambda f(t)
\end{equation}
where $f$ is execution frequency, $r$ is constant execution rate, and $\lambda$ is decay coefficient. This system has a fixed-point attractor at $f^* = r/\lambda$. Starting from any initial $f_0$, the system converges to $f^*$ exponentially:
\begin{equation}
f(t) = f^* + (f_0 - f^*) e^{-\lambda t}
\end{equation}
The transient term vanishes. The system forgets its initial conditions. This is \textit{deterministic convergence}.
The question shifts: Can we build an adaptive runtime where \textit{every metric} behaves this way?
\section{The Approach: Seven Coupled Feedback Loops}
StarForth implements seven feedback loops, each serving a specific purpose:
\subsection*{Loop \#1: Execution Heat Tracking (Positive Feedback)}
Every time a FORTH word executes, its frequency counter increments:
\begin{equation}
f_{\text{word}} \gets f_{\text{word}} + 1
\end{equation}
This is \textit{positive feedback}: more executions $\Rightarrow$ higher frequency $\Rightarrow$ higher cache rank $\Rightarrow$ faster lookups $\Rightarrow$ more executions.
\subsection*{Loop \#2: Rolling Window of Truth (Neutral Monitoring)}
A circular buffer records the last 4096 execution events:
\begin{equation}
B[i \bmod 4096] = \text{word\_id}_i
\end{equation}
This provides \textit{deterministic seeding}: every run replays the same initial history, eliminating variance from cold-start conditions.
\subsection*{Loop \#3: Linear Decay (Negative Feedback)}
A background heartbeat thread reduces frequency proportional to current value:
\begin{equation}
f_{\text{word}} \gets f_{\text{word}} - \lambda \cdot f_{\text{word}} \cdot \Delta t
\end{equation}
This is \textit{negative feedback}: high frequency $\Rightarrow$ fast decay $\Rightarrow$ lower frequency $\Rightarrow$ slow decay. The system stabilizes at an equilibrium where execution rate balances decay.
\subsection*{Loop \#4: Pipelining Metrics (Positive Feedback)}
The system tracks word-to-word transitions:
\begin{equation}
P(B|A) = \frac{\text{count}(A \to B)}{\text{count}(A)}
\end{equation}
High-probability transitions enable speculative prefetching, creating positive feedback in the instruction pipeline.
\subsection*{Loop \#5: Window Width Inference (Negative Feedback)}
Variance in metrics triggers adaptive window shrinking. Using Levene's test for variance homogeneity:
\begin{equation}
\text{If } \text{Var}(w_{\text{current}}) > \text{Var}(w_{\text{candidate}}) \Rightarrow w \gets w_{\text{candidate}}
\end{equation}
High variance $\Rightarrow$ smaller window $\Rightarrow$ lower variance. The system finds the \textit{variance inflection point}: the smallest window before variance begins to increase.
\subsection*{Loop \#6: Decay Slope Inference (Negative Feedback)}
The system infers optimal decay rate via exponential regression on rolling window data:
\begin{equation}
\lambda^* = \arg\min_{\lambda} \sum_{i=1}^N \left[ \ln(f_i) - (\ln(f_0) - \lambda t_i) \right]^2
\end{equation}
Unstable metrics $\Rightarrow$ steeper decay $\Rightarrow$ faster stabilization.
\subsection*{Loop \#7: Adaptive Heartbeat (Meta-Coordination)}
The heartbeat thread adjusts its tick rate based on system stability. Stable system $\Rightarrow$ slower ticks $\Rightarrow$ reduced overhead.
\section{The Implementation: Concrete Mechanisms}
These loops are not abstract concepts. They are implemented in strict ANSI C99:
\begin{description}
\item[Execution frequency:] \texttt{uint64\_t execution\_heat} in \texttt{DictEntry} struct
\item[Decay coefficient:] Q48.16 fixed-point stored in \texttt{physics.decay\_slope}
\item[Rolling window:] Circular buffer in \texttt{rolling\_window\_of\_truth.c}
\item[Transition probabilities:] Q48.16 fixed-point in \texttt{transition\_metrics}
\item[Hot-words cache:] Array of top-$K$ entries sorted by frequency
\item[Inference engine:] Levene's test + exponential regression in \texttt{inference\_engine.c}
\item[Heartbeat system:] POSIX pthread in \texttt{vm.c}
\end{description}
The system uses no floating-point arithmetic. All calculations use 64-bit integers or Q48.16 fixed-point. This eliminates rounding errors as a source of non-determinism.
\section{The Phase Space: Three Dimensions, One Attractor}
We characterize system state in three-dimensional phase space:
\begin{equation}
\mathcal{S} = \{(w, \lambda, \sigma^2) \mid w \in \mathbb{N}, \lambda \in \mathbb{R}^+, \sigma^2 \in \mathbb{R}^+\}
\end{equation}
where:
\begin{itemize}
\item $w$ = window size (number of events retained)
\item $\lambda$ = decay coefficient (frequency reduction rate)
\item $\sigma^2$ = variance (metric dispersion)
\end{itemize}
Each execution trajectory is a path through this space. The central question: do all trajectories converge to the same point?
\section{The Experiment: 90 Independent Runs}
We designed a factorial experiment:
\begin{itemize}
\item 3 workload patterns (2-cycle, 3-cycle, random)
\item 6 initial window sizes (512, 1024, 2048, 4096, 8192, 16384)
\item 5 repetitions per configuration
\item Total: $3 \times 6 \times 5 = 90$ independent runs
\end{itemize}
Each run executes 1 million FORTH operations, records per-tick metrics, and computes steady-state statistics.
\section{The Results: 0\% Algorithmic Variance}
The data tell a clear story.
\subsection*{Finding 1: Deterministic Convergence}
All 90 runs converge to the \textit{same steady-state metrics}:
\begin{table}[h]
\centering
\begin{tabular}{lc}
\toprule
\textbf{Metric} & \textbf{Coefficient of Variation} \\
\midrule
Window size $w$ & $< 0.001\%$ \\
Decay slope $\lambda$ & $< 0.001\%$ \\
Variance $\sigma^2$ & $< 0.001\%$ \\
\bottomrule
\end{tabular}
\caption{Variance across 90 independent runs. CV $\to$ 0 indicates deterministic convergence.}
\end{table}
The coefficient of variation (CV = $\sigma/\mu$) measures relative dispersion. Values below 0.001\% are indistinguishable from measurement noise. The system exhibits \textit{zero algorithmic variance}.
\subsection*{Finding 2: Fixed-Point Attractor}
All execution trajectories converge to the same point in $(w, \lambda, \sigma^2)$ phase space:
\begin{equation}
\mathbf{x}^* = (w^*, \lambda^*, \sigma^{*2}) = (4096, 2.3 \times 10^{-4}, 0.014)
\end{equation}
This is a \textit{stable fixed-point attractor}. Regardless of initial conditions (window size, decay rate, workload pattern), the system reaches the same equilibrium.
\subsection*{Finding 3: Exponential Convergence}
Convergence is not gradual. It is exponential:
\begin{equation}
\text{CV}(t) = \text{CV}_0 \cdot e^{-\alpha t}
\end{equation}
where $\alpha \approx 5 \times 10^{-4}$ per tick. The system reaches steady state within 5000--10000 ticks (50--100 milliseconds on modern hardware).
\section{The Implications: What This Enables}
\subsection*{1. Reproducible Performance Characterization}
Run the same program twice. Get the same execution metrics. Not approximately. \textit{Exactly}. This enables:
\begin{itemize}
\item Regression testing for performance (detect 0.01\% slowdowns)
\item A/B testing with statistical power (eliminate runtime variance)
\item Deterministic replay for debugging (reproduce timing-dependent bugs)
\end{itemize}
\subsection*{2. Provable Real-Time Bounds}
Traditional adaptive runtimes cannot guarantee worst-case execution time (WCET) because optimization decisions are non-deterministic. StarForth converges to a fixed optimization state, making WCET analysis tractable.
\subsection*{3. Scientific Reproducibility}
Publish a paper with performance benchmarks. Other researchers download the code, run the benchmarks, get the \textit{same numbers}. Not ``similar'' numbers. The same numbers.
\subsection*{4. Patent Claims}
The combination of:
\begin{enumerate}
\item Thermodynamically-inspired decay model ($f(t) = f_0 e^{-\lambda t}$)
\item Coupled feedback loops (positive + negative)
\item Deterministic seeding via rolling window
\item Adaptive inference (Levene's test + exponential regression)
\item Provable convergence to fixed-point attractor
\end{enumerate}
constitutes a novel approach to adaptive runtime optimization. No prior art combines these elements.
\section{The Distinction: Metaphor vs. Implementation}
The system uses a \textit{thermodynamic metaphor}:
\begin{itemize}
\item Execution frequency $\leftrightarrow$ Thermal energy
\item Exponential decay $\leftrightarrow$ Heat dissipation
\item Steady-state equilibrium $\leftrightarrow$ Thermal equilibrium
\end{itemize}
This is \textit{conceptual mapping}, not literal physics. The actual implementation uses:
\begin{itemize}
\item Integer counters (not temperature sensors)
\item Exponential functions (not thermodynamic equations)
\item Statistical inference (not physical measurement)
\end{itemize}
The metaphor provides \textit{design intuition}. The mathematics provide \textit{formal guarantees}. This distinction is critical for patent claims and peer review.
\section{The Architecture: From Execution to Optimization}
The data flow is straightforward:
\begin{enumerate}
\item \textbf{Execute word} $\Rightarrow$ increment frequency counter (Loop \#1)
\item \textbf{Record event} $\Rightarrow$ update rolling window (Loop \#2)
\item \textbf{Heartbeat tick} $\Rightarrow$ apply decay (Loop \#3)
\item \textbf{Compute transitions} $\Rightarrow$ update probabilities (Loop \#4)
\item \textbf{Detect variance} $\Rightarrow$ adjust window (Loop \#5)
\item \textbf{Analyze trajectory} $\Rightarrow$ infer decay slope (Loop \#6)
\item \textbf{Check stability} $\Rightarrow$ adjust heartbeat rate (Loop \#7)
\item \textbf{Sort by frequency} $\Rightarrow$ populate hot-words cache
\item \textbf{Lookup word} $\Rightarrow$ O(1) cache hit or O(log N) dictionary search
\end{enumerate}
Each step is deterministic. Each output depends only on current state, not on timing jitter or external randomness.
\section{The Validation: How We Know It Works}
Three levels of validation:
\subsection*{Level 1: Unit Tests (936 Tests)}
Every component has isolated tests:
\begin{itemize}
\item Q48.16 fixed-point arithmetic (50 tests)
\item Exponential regression (12 tests)
\item Levene's test implementation (8 tests)
\item FORTH-79 word semantics (850+ tests)
\end{itemize}
All tests pass with zero failures.
\subsection*{Level 2: Integration Tests (Design of Experiments)}
The 90-run factorial experiment validates end-to-end system behavior. No mocking. No stubbing. Real execution with real metrics.
\subsection*{Level 3: Theoretical Analysis}
Mathematical proof of convergence via Banach fixed-point theorem:
\begin{enumerate}
\item Frequency evolution is contractive mapping ($\lambda > 0$)
\item Contractive mappings have unique fixed points
\item Rolling window provides deterministic initial conditions
\item Therefore: all runs converge to same fixed point
\end{enumerate}
The experimental data confirm the theoretical prediction.
\section{The Bottom Line}
StarForth demonstrates that adaptive optimization and deterministic execution are not mutually exclusive. The key is \textit{feedback control theory}: design loops that converge to attractors.
The system achieves:
\begin{itemize}
\item 0\% algorithmic variance (proven experimentally)
\item Exponential convergence (proven theoretically)
\item Fixed-point attractor (characterized empirically)
\item Reproducible performance (validated across 90 runs)
\end{itemize}
This is not a research prototype. This is a production-ready virtual machine running 936 regression tests, compiling with zero warnings, and achieving deterministic behavior under factorial experimental design.
The figures tell the story. The math proves the claims. The code implements the system.
\vspace{1em}
\noindent\rule{\textwidth}{0.4pt}
\noindent\textit{This document is intended for technical evaluation by research institutions, government reviewers, and patent counsel. It presents factual descriptions of implemented systems and experimental results. No marketing claims. No speculative futures. Just the technical narrative these systems tell.}
\end{document}
Binary file not shown.
+411
View File
@@ -0,0 +1,411 @@
% StarForth Ontology - LaTeX Version
% For inclusion in academic papers
% Version 1.0 - 2025-12-13
\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{enumitem}
\usepackage{booktabs}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,arrows}
\usepackage{algorithm}
\usepackage{algpseudocode}
\title{StarForth Ontology: Formal Conceptual Framework for\\
Thermodynamically-Inspired Adaptive Virtual Machine}
\author{StarForth Project}
\date{Version 1.0 -- December 13, 2025}
\begin{document}
\maketitle
\begin{abstract}
This document establishes a formal ontology, taxonomy, and lexicon for the StarForth adaptive runtime system. We provide precise mathematical definitions to eliminate ambiguity in academic discourse, explicitly distinguishing metaphorical concepts (thermodynamic analogies) from literal implementations (frequency counters, exponential decay functions). This framework enables reproducible research and rigorous peer review.
\end{abstract}
\tableofcontents
\newpage
% ============================================================================
\section{Introduction}
The StarForth adaptive runtime employs concepts from thermodynamics, dynamical systems theory, and statistical inference. To avoid imprecise terminology, this ontology provides:
\begin{itemize}
\item \textbf{Formal definitions} with mathematical notation
\item \textbf{Taxonomic hierarchy} of system components
\item \textbf{Explicit scope limitations} (what is/isn't claimed)
\item \textbf{Usage guidelines} for academic writing
\end{itemize}
% ============================================================================
\section{Core Lexicon}
\subsection{Primary Measurable Quantities}
\begin{description}[style=nextline]
\item[Execution Frequency $f$]
Count of times a dictionary entry has been executed, potentially adjusted by decay.
\begin{equation}
f(t) = f_0 \cdot e^{-\lambda t}
\end{equation}
where $f_0$ is initial frequency and $\lambda$ is decay coefficient.
\textit{Measurement}: Unsigned 64-bit integer (\texttt{uint64\_t execution\_heat}).
\textit{Note}: ``Heat'' is metaphorical naming; actual quantity is frequency.
\item[Decay Coefficient $\lambda$]
Rate parameter controlling exponential reduction in execution frequency.
\begin{equation}
\lambda \in \mathbb{R}^+, \quad \text{units: } [1/\text{time}]
\end{equation}
\textit{Measurement}: Derived via exponential regression; stored as Q48.16 fixed-point.
\item[Window Size $w$]
Number of recent execution events retained in rolling buffer.
\begin{equation}
w \in [w_{\text{min}}, w_{\text{max}}], \quad w \in \mathbb{N}
\end{equation}
\textit{Measurement}: Configurable parameter (default: 4096).
\end{description}
\subsection{Derived Metrics}
\begin{description}[style=nextline]
\item[Transition Probability $P(B|A)$]
Conditional probability that word $B$ executes immediately after word $A$.
\begin{equation}
P(B|A) = \frac{\text{count}(A \to B)}{\text{count}(A)}
\end{equation}
\item[Coefficient of Variation $CV$]
Normalized measure of dispersion.
\begin{equation}
CV = \frac{\sigma}{\mu}
\end{equation}
where $\sigma$ is standard deviation and $\mu$ is mean.
\textit{Convergence criterion}: $CV \to 0$ as $t \to \infty$.
\item[Variance Inflection Point $w^*$]
Window size where variance begins to increase when window shrinks.
\begin{equation}
w^* = \arg\min_{w \in [w_{\text{min}}, w_{\text{current}}]} \text{Var}(w)
\end{equation}
\end{description}
% ============================================================================
\section{Mathematical Formalism}
\subsection{Frequency Evolution Model}
\textbf{Discrete-time update}:
\begin{equation}
f[t+1] = f[t] + \Delta_{\text{exec}}[t] - \Delta_{\text{decay}}[t]
\end{equation}
where
\begin{align}
\Delta_{\text{exec}}[t] &= \begin{cases}
1 & \text{if word executed at tick } t \\
0 & \text{otherwise}
\end{cases} \\
\Delta_{\text{decay}}[t] &= \lambda \cdot f[t] \cdot \Delta t
\end{align}
\textbf{Continuous-time model}:
\begin{equation}
\frac{df}{dt} = r(t) - \lambda f(t)
\end{equation}
where $r(t)$ is execution rate [executions/second].
\textbf{Solution}:
\begin{equation}
f(t) = e^{-\lambda t} \left[ f_0 + \int_0^t r(\tau) e^{\lambda \tau} d\tau \right]
\end{equation}
\subsection{Hot-Words Cache Selection}
Dictionary entry $e$ is cached if and only if:
\begin{equation}
\text{rank}(e) \leq K
\end{equation}
where
\begin{equation}
\text{rank}(e) = |\{e' \in \text{Dictionary} : f(e') > f(e)\}| + 1
\end{equation}
and $K$ is cache size (constant).
\subsection{Window Width Inference}
\textbf{Objective}: Find optimal window size $w^*$ minimizing variance.
\textbf{Method}: Binary search with Levene's test for variance homogeneity.
\begin{algorithm}[H]
\caption{Variance Inflection Point Search}
\begin{algorithmic}
\State Initialize: $w_{\text{low}} \gets w_{\text{min}}, w_{\text{high}} \gets w_{\text{current}}$
\While{$w_{\text{high}} - w_{\text{low}} > \epsilon$}
\State $w_{\text{mid}} \gets \lfloor (w_{\text{low}} + w_{\text{high}}) / 2 \rfloor$
\State Compute $\text{Var}(w_{\text{mid}})$ from trajectory
\State Perform Levene's test: $F \gets \text{Levene}(w_{\text{mid}}, w_{\text{current}})$
\If{$p\text{-value}(F) < \alpha$}
\State $w_{\text{low}} \gets w_{\text{mid}}$ \Comment{Variance increased, search right}
\Else
\State $w_{\text{high}} \gets w_{\text{mid}}$ \Comment{Variance stable, search left}
\EndIf
\EndWhile
\State \Return $w^* \gets w_{\text{mid}}$
\end{algorithmic}
\end{algorithm}
\subsection{Decay Slope Inference}
\textbf{Given}: Time series $\{(t_i, f_i)\}_{i=1}^N$ from rolling window.
\textbf{Model}: Exponential decay
\begin{equation}
f(t) = f_0 \cdot e^{-\lambda t}
\end{equation}
\textbf{Log-transform}:
\begin{equation}
\ln(f) = \ln(f_0) - \lambda t
\end{equation}
\textbf{Least squares solution}:
\begin{equation}
\lambda^* = \arg\min_{\lambda} \sum_{i=1}^N \left[ \ln(f_i) - (\ln(f_0) - \lambda t_i) \right]^2
\end{equation}
Closed-form solution via linear regression on log-transformed data.
% ============================================================================
\section{Taxonomy}
\subsection{Component Hierarchy}
\begin{enumerate}
\item \textbf{Measurement Layer}
\begin{itemize}
\item Execution Frequency Tracking
\item Temporal Recording (Rolling Window)
\item Transition Tracking (Word-to-Word)
\end{itemize}
\item \textbf{Transformation Layer}
\begin{itemize}
\item Decay Models (Linear, Exponential)
\item Normalization (Ranking, Probability)
\end{itemize}
\item \textbf{Inference Layer}
\begin{itemize}
\item Window Width Inference (Levene's Test)
\item Decay Slope Inference (Exponential Regression)
\end{itemize}
\item \textbf{Actuation Layer}
\begin{itemize}
\item Hot-Words Cache (Frequency-Sorted)
\item Speculative Execution (Prefetch)
\end{itemize}
\item \textbf{Coordination Layer}
\begin{itemize}
\item Heartbeat System (Time-Driven Ticks)
\item Loop Orchestration
\end{itemize}
\end{enumerate}
\subsection{Feedback Loop Classification}
\begin{table}[h]
\centering
\begin{tabular}{@{}lll@{}}
\toprule
\textbf{Loop} & \textbf{Type} & \textbf{Mechanism} \\
\midrule
\#1 Execution Heat & Positive & $f \uparrow \Rightarrow \text{rank} \uparrow \Rightarrow \text{cache hit} \Rightarrow f \uparrow$ \\
\#2 Rolling Window & Neutral & Record history (monitoring only) \\
\#3 Linear Decay & Negative & $f \uparrow \Rightarrow \text{decay} \uparrow \Rightarrow f \downarrow$ \\
\#4 Pipelining & Positive & Transition $\uparrow \Rightarrow$ prediction $\uparrow$ \\
\#5 Window Inference & Negative & $\sigma^2 \uparrow \Rightarrow w \downarrow \Rightarrow \sigma^2 \downarrow$ \\
\#6 Slope Inference & Negative & Unstable $\Rightarrow \lambda \uparrow \Rightarrow$ stabilize \\
\#7 Adaptive Heartbeat & Meta & Stable $\Rightarrow$ slower ticks \\
\bottomrule
\end{tabular}
\caption{Feedback loop classification by type and mechanism}
\end{table}
% ============================================================================
\section{Convergence Theory}
\subsection{Deterministic Convergence}
\begin{definition}[Deterministic Convergence]
A system exhibits deterministic convergence if, for all executions $i, j$ of identical workloads:
\begin{equation}
\lim_{t \to \infty} \frac{|\text{metric}_i(t) - \text{metric}_j(t)|}{\sigma} < \epsilon
\end{equation}
where $\epsilon \to 0$ and $\sigma$ is pooled standard deviation.
\end{definition}
\begin{theorem}[0\% Variance Convergence]
Under continuous execution with fixed workload, the coefficient of variation of steady-state metrics approaches zero:
\begin{equation}
\lim_{t \to \infty} CV(t) = \lim_{t \to \infty} \frac{\sigma(t)}{\mu(t)} = 0
\end{equation}
\end{theorem}
\begin{proof}[Sketch]
\begin{enumerate}
\item Frequency evolution is governed by contractive mapping $T: f \mapsto f + r - \lambda f$.
\item Fixed point $f^*$ exists by Banach fixed-point theorem when $\lambda > 0$.
\item Rolling window deterministically seeds metrics from identical initial conditions.
\item Levene's test-based adaptation reduces variance monotonically.
\item Therefore, all runs converge to same fixed point $\Rightarrow \sigma \to 0$.
\end{enumerate}
\end{proof}
\subsection{Attractor Characterization}
\begin{definition}[Phase Space]
The system state space is defined as:
\begin{equation}
\mathcal{S} = \{(w, \lambda, \sigma^2) \mid w \in \mathbb{N}, \lambda \in \mathbb{R}^+, \sigma^2 \in \mathbb{R}^+\}
\end{equation}
\end{definition}
\begin{definition}[Attractor]
A point $\mathbf{x}^* = (w^*, \lambda^*, \sigma^{*2})$ is an attractor if:
\begin{equation}
\mathbf{x}_{t+1} = F(\mathbf{x}_t) \quad \text{and} \quad F(\mathbf{x}^*) = \mathbf{x}^*
\end{equation}
where $F$ is the state transition function.
\end{definition}
Empirically, StarForth exhibits a \textit{stable fixed-point attractor} in $(w, \lambda, \sigma^2)$ space, confirmed across 90 experimental runs.
% ============================================================================
\section{Metaphorical Mappings}
\subsection{Thermodynamic Analogy}
\begin{table}[h]
\centering
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{Thermodynamic Concept} & \textbf{Execution Analog} \\
\midrule
Thermal Energy & Execution Frequency (count) \\
Heat Dissipation & Exponential Decay ($e^{-\lambda t}$) \\
Temperature & Normalized Frequency Rank \\
Thermal Equilibrium & Steady-State Convergence \\
Cooling Rate & Decay Coefficient $\lambda$ \\
\bottomrule
\end{tabular}
\caption{Thermodynamic metaphor mapping (conceptual only)}
\end{table}
\textbf{Important Caveat}: These are \textit{conceptual analogies}, not literal physical processes. No actual thermodynamic equations or hardware temperature measurements are involved.
% ============================================================================
\section{Scope Limitations}
\subsection{What This Framework DOES Cover}
\begin{itemize}
\item Execution frequency measurement and temporal decay
\item Adaptive caching via frequency-based ranking
\item Statistical inference for parameter tuning
\item Dynamical systems characterization of convergence
\end{itemize}
\subsection{What This Framework DOES NOT Cover}
\begin{itemize}
\item Actual thermodynamic processes or physics simulations
\item Machine learning or neural network training
\item Quantum computing or quantum-inspired algorithms
\item Biological neural systems or biomimicry
\end{itemize}
% ============================================================================
\section{Usage Guidelines}
\subsection{Academic Writing Conventions}
\paragraph{In Abstracts/Titles:} Use precise, non-metaphorical terminology.
\begin{itemize}
\item {\color{green!50!black}$\checkmark$} ``Thermodynamically-Inspired Adaptive Runtime''
\item {\color{red}$\times$} ``Physics-Based Virtual Machine''
\end{itemize}
\paragraph{In Technical Sections:} Qualify metaphors explicitly.
\begin{quote}
``We employ a \textit{thermodynamic metaphor} where execution frequency is treated as `heat' that dissipates exponentially over time, mathematically modeled as $f(t) = f_0 e^{-\lambda t}$.''
\end{quote}
\paragraph{In Formalism:} Use mathematical definitions, not analogies.
\begin{itemize}
\item {\color{green!50!black}$\checkmark$} ``Frequency evolves as $df/dt = r(t) - \lambda f(t)$''
\item {\color{red}$\times$} ``Heat cools like Newton's law of cooling''
\end{itemize}
% ============================================================================
\section{Conclusion}
This ontology provides a formal foundation for precise academic discourse on the StarForth adaptive runtime system. By explicitly distinguishing metaphorical concepts from literal implementations, we enable rigorous peer review and reproducible research.
% ============================================================================
\appendix
\section{Notation Summary}
\begin{table}[h]
\centering
\begin{tabular}{@{}ll@{}}
\toprule
\textbf{Symbol} & \textbf{Definition} \\
\midrule
$f$ & Execution frequency \\
$\lambda$ & Decay coefficient \\
$w$ & Window size \\
$K$ & Cache size \\
$\sigma$ & Standard deviation \\
$\mu$ & Mean \\
$CV$ & Coefficient of variation \\
$P(B|A)$ & Transition probability \\
$w^*$ & Variance inflection point \\
$\mathcal{S}$ & State space \\
\bottomrule
\end{tabular}
\caption{Mathematical notation used in this document}
\end{table}
% ============================================================================
\bibliographystyle{plain}
\begin{thebibliography}{9}
\bibitem{strogatz2015}
Strogatz, S. (2015). \textit{Nonlinear Dynamics and Chaos: With Applications to Physics, Biology, Chemistry, and Engineering}. Westview Press.
\bibitem{astrom2008}
Åström, K. J., \& Murray, R. M. (2008). \textit{Feedback Systems: An Introduction for Scientists and Engineers}. Princeton University Press.
\bibitem{casella2002}
Casella, G., \& Berger, R. L. (2002). \textit{Statistical Inference}. Duxbury Press.
\bibitem{bolz2009}
Bolz, C. F., Cuni, A., Fijalkowski, M., \& Rigo, A. (2009). Tracing the meta-level: PyPy's tracing JIT compiler. In \textit{Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems} (pp. 18-25).
\bibitem{ertl1996}
Ertl, M. A. (1996). Stack caching for interpreters. In \textit{ACM SIGPLAN Notices} (Vol. 30, No. 6, pp. 315-327).
\end{thebibliography}
\end{document}