P19 · Research paper
Aegis — KV Cache Lab
Overleaf-ready LaTeX source
PDF coming later
Compile this paper in Overleaf
- 1.Download the Overleaf ZIP above.
- 2.In Overleaf, choose New Project → Upload Project and select the ZIP.
- 3.Click Recompile, then download the generated PDF.
- 4.Name it
aegis-kv-cache-lab.pdfand place it inpublic/papers/.
The paper is a standalone IEEE conference document: it already includes its document class, packages, title, abstract, sections, tables, and bibliography. No copy-and-paste is required.
Preview aegis-kv-cache-lab.tex
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{array}
\usepackage{tabularx}
\newcolumntype{Y}{>{\raggedright\arraybackslash}X}
\hypersetup{hidelinks}
\begin{document}
\title{AEGIS KV-Cache Lab: An Evidence-Aware Architecture, Prototype Evaluation, and Integration Roadmap}
\author{\IEEEauthorblockN{Aaron Singh}
\IEEEauthorblockA{\textit{Department of Electrical and Computer Engineering} \\
\textit{San Francisco State University}}}
\maketitle
\begin{abstract}
This paper presents AEGIS KV-Cache Lab, a project in a twenty-project AI infrastructure portfolio. The current repository is an active prototype with implemented behavior, automated correctness tests, and explicit boundaries around unverified hardware or production claims. We describe the system model, current implementation, goals, and evaluation method, then propose five integrations that advance the project toward reproducible system-level validation. A local audit on August 14, 2026 executed 5 project tests successfully. No accelerator, deployment, or performance conclusion is inferred unless a corresponding committed benchmark or profiler artifact exists.
\end{abstract}
\begin{IEEEkeywords}
AEGIS, AI infrastructure, reproducibility, prototype validation, systems evaluation, hardware--software co-design
\end{IEEEkeywords}
\section{Introduction}
AEGIS KV-Cache Lab (P05) addresses a bounded problem within the portfolio's track-02-llm-serving track. Its declared status is \emph{Active Prototype} \cite{metadata}. The project validates its central mechanism before adding device-specific acceleration, production orchestration, or real-world hardware. This ordering matters because optimization without a trusted reference can make incorrect behavior appear successful.
The project goals are to establish deterministic behavior, encode correctness as tests, create machine-readable evidence, identify limiting resources through measurement, and integrate results with adjacent portfolio systems without losing provenance. The repository contains one paper named exactly after its singular folder: \texttt{P05-aegis-kv-cache-lab.tex}.
\section{Technical Context}
Language-model serving couples execution with cache management, request scheduling, and latency objectives. A simulator can validate policy logic, but only a real model runtime and measured workload can support performance claims. The portfolio benchmark standard requires environment, workload, method, metric, artifact, reproduction, and limitation fields; unknown values remain explicitly unmeasured \cite{benchmark}.
\section{System Model and Architecture}
The prototype is organized around the following domain model:
\begin{equation}
p(r)=\left\lceil\frac{t_r}{T_p}\right\rceil,\quad \sum_r p(r)\leq P_{total}
\end{equation}
The equation is a design and test abstraction rather than a claimed empirical law. It supports invariants and expected-value checks while later implementations replace synthetic inputs with representative workloads or devices.
The software architecture contains an input/configuration layer, a deterministic core, validation and evidence output, and a local visualization. The principal inspected source artifacts are \texttt{python/kv\_cache\_simulator.py}. Unsupported real-world conditions are surfaced as limitations rather than silently simulated.
\section{Detailed Script Operation and Rationale}
The simulator reads a JSON workload and models a fixed pool of KV-cache pages. It rounds token demands to pages, allocates and releases ownership, rejects exhaustion safely, reuses freed pages deterministically, and checks that no page is multiply owned.
The execution path is:
\begin{enumerate}
\item Load page count, page size, and request operations from JSON.
\item Round each token demand upward to whole pages.
\item Allocate free pages or reject the request atomically on exhaustion.
\item Release pages and preserve deterministic reuse order.
\item Check ownership/free-list invariants after every operation and emit a trace.
\end{enumerate}
\begin{table*}[t]
\caption{Implementation artifacts and why they exist}
\label{tab:p05-implementation}
\centering
\small
\begin{tabularx}{\textwidth}{p{0.24\textwidth}YY}
\toprule
\textbf{Artifact} & \textbf{Observed responsibility} & \textbf{Engineering rationale} \\
\midrule
python/kv\_cache\_simulator.py & PagedKVCache, run\_workload, main & Implements the inspectable, unit-tested project core. \\
scripts/reproduce.sh & Fixed test and demonstration entry point & Gives another developer one command for local reproduction. \\
PROJECT.yaml and ANALYSIS.md & Status, completed work, planned work, and claim boundaries & Separates declared intent from evidence-backed implementation. \\
streamlit\_app.py & Local evidence and status visualization & Makes outputs inspectable without upgrading simulation into a hardware claim. \\
\bottomrule
\end{tabularx}
\end{table*}
\section{Implemented Prototype}
The metadata and source audit found these completed features \cite{analysis}:
\begin{itemize}
\item Python paged KV-cache allocator
\item Allocation, exhaustion, release, and deterministic page reuse
\item Internal page ownership invariants and unit tests
\item JSON workload runner and trace output
\end{itemize}
On August 14, 2026, \texttt{python3 -m unittest discover -s tests -p 'test\_*.py'} completed successfully with 5 tests. The inspected test artifacts are \texttt{tests/unit/test\_kv\_cache.py}. This is evidence of local correctness for encoded cases, not production scale or hardware performance.
\section{Testing Methodology and Observed Results}
Testing uses Python's standard \texttt{unittest} discovery and exercises the public behavior of the reference implementation. The audit reran the suite from the project folder with \texttt{python3 -m unittest discover -s tests -p 'test\_*.py'}. All 5 discovered tests passed. The result establishes correctness only for the encoded local cases; it does not establish accelerator correctness, real-device behavior, production reliability, or benchmark completion.
\begin{table*}[t]
\caption{Audited test matrix}
\label{tab:p05-tests}
\centering
\scriptsize
\begin{tabularx}{\textwidth}{p{0.37\textwidth}Yp{0.21\textwidth}}
\toprule
\textbf{Test artifact and case} & \textbf{Behavior being checked} & \textbf{Observed result} \\
\midrule
tests/unit/test\_kv\_cache.py:test\_allocation\_rounds\_tokens\_up\_to\_pages & Allocation rounds tokens up to pages. & Pass (local, 2026-08-14) \\
tests/unit/test\_kv\_cache.py:test\_release\_makes\_pages\_reusable & Release makes pages reusable. & Pass (local, 2026-08-14) \\
tests/unit/test\_kv\_cache.py:test\_exhaustion\_rejects\_without\_corrupting\_cache & Exhaustion rejects without corrupting cache. & Pass (local, 2026-08-14) \\
tests/unit/test\_kv\_cache.py:test\_duplicate\_request\_is\_rejected & Duplicate request is rejected. & Pass (local, 2026-08-14) \\
tests/unit/test\_kv\_cache.py:test\_unknown\_release\_is\_rejected & Unknown release is rejected. & Pass (local, 2026-08-14) \\
\bottomrule
\end{tabularx}
\end{table*}
No numerical performance result is promoted by this test run. Where scripts emit JSON or JSONL, those outputs remain raw or simulation-specific until a reviewed summary includes hardware, software, workload, warm-up, repetition, correctness threshold, Git revision, and limitations.
\begin{table*}[t]
\caption{Declared status versus audited evidence}
\label{tab:p05-audit}
\centering
\small
\begin{tabularx}{\textwidth}{p{0.20\textwidth}Yp{0.25\textwidth}}
\toprule
\textbf{Audit field} & \textbf{Finding} & \textbf{Evidence source} \\
\midrule
Declared status & Active Prototype & PROJECT.yaml \\
Evidence-backed status & Active local prototype; 5 tests passed & Source plus local unittest run \\
Accepted measured results & None recorded in measured\_results & PROJECT.yaml \\
Mismatch / claim boundary & The simulator does not allocate real model tensors or measure device memory & PROJECT.yaml and ANALYSIS.md \\
Next proof required & Request growth and partial-page accounting; Fragmentation and eviction policies & Planned features \\
\bottomrule
\end{tabularx}
\end{table*}
\section{Claim Boundaries and Risks}
The project records these unverified or excluded claims:
\begin{itemize}
\item The simulator does not allocate real model tensors or measure device memory
\end{itemize}
The main risk is confusing synthetic or modeled behavior with deployed-system behavior. Other risks include incomplete workloads, platform-dependent timing, missing failure injection, and interfaces not yet exercised across device boundaries. Performance claims require a reviewed record meeting the portfolio standard.
\section{Evaluation Plan}
Evaluation proceeds through correctness tests, deterministic reproduction with Git and environment metadata, repeated benchmarks reporting latency/throughput/memory/error metrics, and a named profiler capture tied to exact hardware and source revision. Success requires reference equivalence within a documented tolerance, preservation of safety and resource invariants, clear failures, and evidence reproducible from a clean environment.
\section{Goals, Milestones, and Success Criteria}
The project goals are staged so that correctness precedes performance and integration. A goal is complete only when its proof artifact is committed or otherwise reviewable; prose or a simulated number alone is insufficient.
\begin{table*}[t]
\caption{Project goals and required proof}
\label{tab:p05-goals}
\centering
\small
\begin{tabularx}{\textwidth}{p{0.06\textwidth}YY}
\toprule
\textbf{ID} & \textbf{Goal} & \textbf{Completion evidence} \\
\midrule
G1 & Request growth and partial-page accounting & Passing tests and a reviewed source artifact \\
G2 & Fragmentation and eviction policies & Machine-readable result with reproduction metadata \\
G3 & Tensor-backed cache comparison & Reference-equivalence or domain-correctness report \\
G4 & Model fragmentation, growth, and eviction & Named profiler, deployment, or integration artifact \\
G5 & Compare against a tensor-backed runtime cache & Dashboard/report link preserving provenance and limitations \\
\bottomrule
\end{tabularx}
\end{table*}
\section{Future Work and Integrations}
The five project-specific next steps are:
\begin{enumerate}
\item Request growth and partial-page accounting
\item Fragmentation and eviction policies
\item Tensor-backed cache comparison
\item Integrate vLLM or SGLang request traces.
\item Export fragmentation and eviction events to ARGUS and SENTINEL.
\end{enumerate}
The early items complete declared evidence; the later items connect downstream portfolio consumers. Each integration should add tests and a reviewable artifact such as JSONL evidence, a report, profiler capture, deployment manifest, trace, or labeled data set.
\section{Conclusion}
AEGIS KV-Cache Lab is an evidence-aware active prototype: its implemented behavior and tests are real, while unbuilt hardware, deployment, and performance goals remain labeled. Completing the five integrations in dependency order will advance it from a learning artifact toward a credible portfolio component.
\begin{thebibliography}{00}
\bibitem{metadata} Aaron Singh, ``AEGIS KV-Cache Lab PROJECT.yaml,'' local portfolio repository, updated 2026-08-13.
\bibitem{analysis} Aaron Singh, ``AEGIS KV-Cache Lab: README, ANALYSIS, source, and test artifacts,'' local portfolio repository, accessed Aug. 14, 2026.
\bibitem{benchmark} Aaron Singh, ``AI Infrastructure Portfolio Benchmark Standard,'' local portfolio repository, accessed Aug. 14, 2026.
\end{thebibliography}
\end{document}