Binary validation¶
Drive the original 1999 ASITIC binary headlessly and parse its output, so reASITIC’s numerical results can be compared to the ground truth.
The binary lives at ../run/asitic.linux.2.2 (relative to the
reASITIC source tree). It is a 32-bit ELF that depends on the
bundled libstdc++/Mesa/X11/readline shipped under ../run/libs/;
running it requires a working X display (the binary --ngr
flag does not fully bypass the X init). We use xvfb-run to
provide a virtual display when one isn’t already available.
Notes on the legacy binary’s quirks:
The
Ind/ inductance commands segfault in headless mode on modern Linux (uninitialized table read at-4offset, traced tocmd_inductance_computereadingg_metal_layer_tablebefore it has been fully populated). We therefore validate numerical results against published Greenhouse / Grover formulas rather than against the binary’sIndoutput. Geometry-only commands (Geom,MetArea,ListSegs, etc.) work and are the basis of binary-driven testing here.When stdin closes the binary loops forever printing
Unknown or Mistyped Commnd; therefore every script must end with a quit command (Q/QUIT/EXIT).
- exception reasitic.validation.binary_runner.BinaryNotFoundError[source]¶
Bases:
RuntimeErrorRaised when the legacy
asiticbinary cannot be located.
- class reasitic.validation.binary_runner.GeomResult[source]¶
Bases:
objectParsed output of the
Geom <name>command.- __init__(name, kind, length_um=None, width_um=None, metal=None, total_length_um=None, total_area_um2=None, location=None, n_segments=None, spiral_l1_um=None, spiral_l2_um=None, spiral_spacing_um=None, spiral_turns=None, raw='')¶
- Parameters:
name (str)
kind (str)
length_um (float | None)
width_um (float | None)
metal (str | None)
total_length_um (float | None)
total_area_um2 (float | None)
n_segments (int | None)
spiral_l1_um (float | None)
spiral_l2_um (float | None)
spiral_spacing_um (float | None)
spiral_turns (float | None)
raw (str)
- Return type:
None
- reasitic.validation.binary_runner.parse_geom_output(text)[source]¶
Parse the textual block emitted by
Geom <name>.- Parameters:
text (str)
- Return type:
- class reasitic.validation.binary_runner.BinaryRunner[source]¶
Bases:
objectRuns the legacy
asiticbinary under user-mode QEMU.The 1999 ASITIC binary is a 32-bit i386 ELF linked against 1999-era libstdc++ / libreadline / Mesa libraries (bundled in
run/libs/). Native execution on modern Linux works for geometry-only commands but segfaults insidecompute_mutual_inductance(decomp0x0804efb0) for any AC-frequency analysis (Res <freq>,Pi <freq>,2Port,Eddy on). The crash is a 1999-era kernel/FPU-state ABI mismatch.To make results reproducible across hosts, reASITIC’s validation harness only supports QEMU user-mode execution. Install
qemu-user-staticand the harness picks upqemu-i386-staticautomatically; setREASITIC_QEMU_USERto override the QEMU binary. If QEMU is not available, the runner construction raisesBinaryNotFoundErrorand every test that depends on it auto-skips.The parent
asitic-rerepo’sBINARY_VALIDATION.mddocuments how to install QEMU on each major distro and the legacy-Linux containerised path for full reproduction.- classmethod auto(tech_file='tek/BiCMOS.tek', timeout_s=30.0, qemu_user=None)[source]¶
Construct a runner using the legacy binary at
run/asitic.tech_fileis resolved relative to the binary’s directory if not absolute.xvfb-runis auto-enabled when no DISPLAY is set on the host.qemu_useris the QEMU binary used for translation (defaults to$REASITIC_QEMU_USERor"qemu-i386-static"). RaisesBinaryNotFoundErrorwhen the QEMU binary isn’t on the PATH.- Parameters:
- Return type: