Indexed text attachment
coherent-specialization-on-graalvm.tex
Source for Coherent Specialization on GraalVM
View paper · Download original file
Lines 523–622 of 803. Source text is displayed literally.
523each sampled time. The residual rows still accept the state. A plotted524sweep supplies the same initial state to those rows at each time and525then takes the listed observations. Slicing the plot and evaluating526only the selected coordinates therefore agree when the compiler inputs,527arithmetic order, and observation rule are held fixed. The same528commutation holds for the rounded values produced by this independent529evaluation of each time.530 531Time composition makes a different comparison. The exact propagators532satisfy $U_H(t+s)=U_H(t)U_H(s)$. To compare a sequence of rounded steps533with this law, write $x_0=\psi$, $x_i=K_{\delta_i}(x_{i-1})$ for534executions of compiled kernels and define535$e_i=\|x_i-U_H(\delta_i)x_{i-1}\|_2$. With536$y_i=U_H(\delta_1+\cdots+\delta_i)\psi$,537\begin{align*}538 x_i-y_i&=x_i-U_H(\delta_i)x_{i-1}\\539 &\quad+U_H(\delta_i)(x_{i-1}-y_{i-1}),\\540 \|x_n-y_n\|_2&\leq\sum_{i=1}^n e_i .541\end{align*}542The bound uses the triangle inequality and the exact unitarity of543$U_H(\delta_i)$. Each $e_i$ includes coefficient generation and544arithmetic error at that step's actual input. The discrepancy with545one compiled application at $t=\sum_i\delta_i$ is bounded by adding546$\|K_t(\psi)-U_H(t)\psi\|_2$. For normalized $\psi$ and a state error547at most $\varepsilon$, the change in an exact projector probability548is at most $(2+\varepsilon)\varepsilon$ by Cauchy--Schwarz and549$\|P_\ell\|\leq1$. Computing that probability in binary64 adds its own550rounding error. These bounds explain what the observed composition551defects measure on a tested trajectory. A bound over all inputs would552require uniform control of the local errors.553 554\section{Reproducible checks}555\label{sec:evidence}556 557The artifact was tested on Linux x86-64 using GraalVM Community55824.0.2 and Truffle, GraalJS, and GraalPy 24.2.2. All eight JUnit tests passed559in the traced build. The trace test requested synchronous compilation560only for CatPE kernel roots. The Graal log reported completed tier-2561compilations of all three word kernels and of every output row in both562quantum examples. In the forest run, the trace also recorded a563deoptimization and a subsequent successful compilation. The test564continued to compare results to the independent forest calculation.565 566\begin{table}[htbp]567\centering568\caption{Word kernels on 4,096 input tuples per row.}569\label{tab:words}570\small571\begin{tabular}{lrrr}572\toprule573Kernel & Source & Residual & Mismatches \\574\midrule575Symmetric FIR & 346 & 67 & 0 \\576Antisymmetric FIR & 346 & 65 & 0 \\577Decision forest & 91 & 57 & 0 \\578\bottomrule579\end{tabular}580\end{table}581 582The word tests use a fixed pseudorandom seed and alternate between583full-width signed values and small values. Each tuple is evaluated by the584unspecialized interpreter and the Truffle kernel, and both values are585compared to a separate domain oracle. Table~\ref{tab:words} reports node586counts in source and residual terms. Both guest languages call all three587word kernels on fixed samples. They also exercise an identity kernel on588the signed maximum through foreign numeric representations, with the589host recovering the exact word.590 591The free-electron test uses a 12-site lattice with $a=0.7$, $m=1$, and592$t=0.83$. Its initial packet has center $3$, width $1.3$, and carrier593mode $2$. The field test uses the six-dimensional sector and initial594occupation of Section~\ref{sec:fermion-field} at $t=0.6$. The595field matrix is also compared with explicit entries for the fixture.596The experiments compare the output of the reusable compiled rows to597the independent references in Sections~\ref{sec:electron}598and~\ref{sec:fermion-field}. GraalJS and GraalPy invoke the same compiled599row objects and return every component of both outputs. Their results600agree component by component with the host calls.601 602\begin{table}[htbp]603\centering604\caption{Absolute error for the quantum fixtures.}605\label{tab:quantum-errors}606\small607\begin{tabular}{lrr}608\toprule609Measurement & Free electron & Fermion field \\610\midrule611Reference & $1.665\,10^{-16}$ & $6.661\,10^{-16}$ \\612Norm squared & $2.220\,10^{-16}$ & $8.882\,10^{-16}$ \\613Energy & $2.220\,10^{-16}$ & $8.882\,10^{-16}$ \\614Inverse & $1.110\,10^{-16}$ & $8.882\,10^{-16}$ \\615Composition & $1.665\,10^{-16}$ & $4.441\,10^{-16}$ \\616Unitarity & $2.220\,10^{-16}$ & $1.776\,10^{-15}$ \\617\bottomrule618\end{tabular}619\end{table}620 621Inverse error compares $U(-t)U(t)\psi$ to $\psi$. Composition error622compares $U(t)^2\psi$ to $U(2t)\psi$. Vector discrepancies use the