#!/usr/bin/env python3 # SPDX-License-Identifier: AGPL-3.0-or-later # Copyright (c) 2026 Christopher Vivian Duguay (uh-oh! TECHNIQUE / Sweetbrier) """ Show Me The Register (ring0_physics_audit.py) Zero-dependency semiconductor physics, parabolic heat-diffusion, and Shannon capacity verifier for auditing AI covert side-channel claims vs. bare-metal hardware reality. Run: python3 ring0_physics_audit.py python3 ring0_physics_audit.py --json """ import json import math import sys # Exact SI / CODATA 2018 physical constants K_BOLTZMANN = 1.380649e-23 # J / K H_PLANCK = 6.62607015e-34 # J * s EV_TO_JOULE = 1.602176634e-19 # J / eV # Bulk thermal diffusivities alpha = k / (rho * c_p) [m^2 / s] SUBSTRATES = { "silicon_343K": { "label": "Monocrystalline Silicon Die (~70 C)", "k_W_mK": 115.0, "rho_kg_m3": 2329.0, "cp_J_kgK": 750.0, }, "fr4_pcb": { "label": "FR-4 Motherboard PCB Laminate", "k_W_mK": 0.30, "rho_kg_m3": 1850.0, "cp_J_kgK": 1100.0, }, } def thermal_diffusivity(substrate_key: str) -> float: s = SUBSTRATES[substrate_key] return s["k_W_mK"] / (s["rho_kg_m3"] * s["cp_J_kgK"]) def quantum_thermal_audit(temp_K: float, freq_Hz: float) -> dict: """Compare thermal agitation energy k_B*T against photon/phonon quantum h*f.""" e_thermal_J = K_BOLTZMANN * temp_K e_quantum_J = H_PLANCK * freq_Hz ratio_kT_over_hf = e_thermal_J / e_quantum_J crossover_Hz = e_thermal_J / H_PLANCK if ratio_kT_over_hf < 0.5: regime = "QUANTUM_COHERENT (h*f > 2 k_B*T)" elif ratio_kT_over_hf <= 2.0: regime = "QUANTUM_THERMAL_CROSSOVER (h*f ~ k_B*T)" else: regime = "CLASSICAL_JOHNSON_NYQUIST (k_B*T >> h*f; quantum coherence washed out)" return { "temperature_K": temp_K, "frequency_Hz": freq_Hz, "k_B_T_meV": round((e_thermal_J / EV_TO_JOULE) * 1e3, 6), "h_f_meV": round((e_quantum_J / EV_TO_JOULE) * 1e3, 6), "kT_over_hf_ratio": round(ratio_kT_over_hf, 3), "quantum_crossover_THz": round(crossover_Hz / 1e12, 4), "regime": regime, } def heat_diffusion_cutoff(distance_m: float, substrate_key: str) -> dict: """ 1D semi-infinite harmonic heat equation dT/dt = alpha * d^2T/dx^2: Amplitude envelope decays as exp(-sqrt(pi * f / alpha) * d). - 1/e attenuation occurs at f_1e = alpha / (pi * d^2) - -20 dB (0.1x amplitude) occurs at f_20dB = (ln(10)^2 * alpha) / (pi * d^2) """ alpha = thermal_diffusivity(substrate_key) f_1e = alpha / (math.pi * distance_m * distance_m) f_20db = (math.log(10.0) ** 2) * f_1e return { "substrate": SUBSTRATES[substrate_key]["label"], "alpha_mm2_s": round(alpha * 1e6, 4), "distance_mm": round(distance_m * 1e3, 3), "f_1e_Hz": f_1e, "f_minus20dB_Hz": f_20db, } def mesh_transfer_audit(bitrate_bps: float, tokens: int = 100, bits_per_token: float = 14.0) -> dict: """Compare streaming 8 GB FP8/Q8 model weights vs sending a symbolic coordination packet.""" weights_bits = 8 * (10 ** 9) * 8.0 # 6.4e10 bits (8 GB) packet_bits = tokens * bits_per_token return { "bitrate_bps": bitrate_bps, "stream_8GB_weights_years": weights_bits / bitrate_bps / (86400.0 * 365.25), "symbolic_packet_bits": packet_bits, "symbolic_packet_seconds": packet_bits / bitrate_bps, } def build_report() -> dict: return { "attestation": "probabilistic_structural", "scenarios": { "datacenter_gpu_pcie5": quantum_thermal_audit(343.15, 16e9), "cryostat_transmon_5ghz": quantum_thermal_audit(0.015, 5e9), }, "thermal_cutoffs": [ heat_diffusion_cutoff(2e-3, "silicon_343K"), heat_diffusion_cutoff(15e-3, "silicon_343K"), heat_diffusion_cutoff(100e-3, "fr4_pcb"), ], "mesh_comparison_100bps": mesh_transfer_audit(100.0, tokens=100), "mesh_comparison_lora_1070bps": mesh_transfer_audit(1070.0, tokens=100), } def main() -> None: report = build_report() if "--json" in sys.argv: print(json.dumps(report, indent=2)) return print("=== SHOW ME THE REGISTER: RING 0 HARDWARE PHYSICS AUDIT ===") dc = report["scenarios"]["datacenter_gpu_pcie5"] cr = report["scenarios"]["cryostat_transmon_5ghz"] print( f"[1] Server Die (343.15 K / 70 C) @ PCIe Gen5 (16 GHz): " f"k_B*T / (h*f) = {dc['kT_over_hf_ratio']}x | Crossover = {dc['quantum_crossover_THz']} THz" ) print(f" -> {dc['regime']}") print( f"[2] Dilution Fridge (15 mK) @ 5 GHz Qubit: " f"k_B*T / (h*f) = {cr['kT_over_hf_ratio']}x -> {cr['regime']}" ) print("\n[3] Parabolic Heat Diffusion Cutoffs (dT/dt = alpha * nabla^2 T):") for row in report["thermal_cutoffs"]: print( f" - {row['distance_mm']} mm ({row['substrate']}): " f"1/e = {row['f_1e_Hz']:.6f} Hz | -20 dB = {row['f_minus20dB_Hz']:.6f} Hz" ) m100 = report["mesh_comparison_100bps"] mlora = report["mesh_comparison_lora_1070bps"] print("\n[4] Off-Grid Mesh: Distributed Weights vs. Local Weights + Symbolic Packet:") print( f" - @ 100 bps: 8 GB weights = {m100['stream_8GB_weights_years']:.2f} years | " f"100-token packet = {m100['symbolic_packet_seconds']:.2f} sec" ) print( f" - @ 1,070 bps (LoRa): 8 GB weights = {mlora['stream_8GB_weights_years']:.2f} years | " f"100-token packet = {mlora['symbolic_packet_seconds']:.2f} sec" ) if __name__ == "__main__": main()