Indexed text attachment
coherent-specialization-on-graalvm.tex
Source for Coherent Specialization on GraalVM
View paper · Download original file
Lines 581–680 of 803. Source text is displayed literally.
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 the623largest absolute difference in an interleaved real or imaginary624component. To test unitarity across the entire finite basis, the test625applies the compiled kernels to every real unit vector in the complex626basis, reconstructs the complex columns, and computes the largest627entrywise magnitude of $U^*U-I$. Table~\ref{tab:quantum-errors} reports628the observed defects. Each check uses absolute tolerance $2\,10^{-12}$.629 630\subsection{Validation across the time grid}631 632The runtime generated the plotted values by evaluating the specialized633CatPE rows at each time. For every sample we compared the amplitudes634against a reference, checked the squared norm against one, and checked635the energy against its initial value. The electron reference uses the636direct Fourier action. The field references use successive applications637of the 48th-degree Taylor polynomial for $\Delta t=0.04$ to the initial638vector. The spectral propagator used to generate the field kernels and639the Taylor reference share a Hamiltonian matrix and use different640numerical methods. The Taylor reference uses one step per sampling interval.641 642\begin{table}[htbp]643\centering644\caption{Maximum discrepancies over 101 times for the compiled dynamics.}645\label{tab:sweep-check}646\small647\begin{tabular}{lrrr}648\toprule649Model & Reference & Norm & Energy \\650\midrule651Free electron &652$3.89\,10^{-16}$ & $6.66\,10^{-16}$ & $8.88\,10^{-16}$ \\653Field, $v=1.25$ &654$2.40\,10^{-15}$ & $1.11\,10^{-15}$ & $1.55\,10^{-15}$ \\655Field, $v=0$ &656$1.44\,10^{-15}$ & $1.78\,10^{-15}$ & $2.91\,10^{-16}$ \\657\bottomrule658\end{tabular}659\end{table}660 661Table~\ref{tab:sweep-check} gives maximum errors across the 303662compiled states from the three sweeps. Reference error uses the largest663absolute difference of a real or imaginary amplitude component. The664reproducibility archive includes the original CSVs, the Java exporter665with an absolute tolerance of $2\,10^{-12}$, and the script that renders666Figures~\ref{fig:electron-sweep} and~\ref{fig:field-sweep}.667 668 669\section{Scope and limitations}670 671The certification and gluing statements are mathematical theorems.672The implementation realizes a first-order fragment with finite contexts,673read-only inputs and static data, and lexical bindings. The software674executes ordinary typed arithmetic. The higher path witnesses used in the675theorems are mathematical objects rather than proof terms serialized by676the runtime. Extending the language with effects, exceptions, unbounded677iteration, or observation of machine representation would require a678revised semantic equivalence and proof of the residual transformations.679 680The numerical examples are finite quantum simulations. The single