From 622b3d0b0eb9bb43feb787fbe3b1392b3cac7d2e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 14 Mar 2026 16:09:13 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20add=20consistency=20chec?= =?UTF-8?q?k=20for=20run=5Fthrust=5Fsimulation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces a unit test for the `run_thrust_simulation` function in `QAG_Truth.ipynb` to ensure reliability and output consistency. Key changes: - Corrected `importimport` typo in the notebook's first code cell. - Updated `run_thrust_simulation` to return the calculated `d_retrocausal[-1]` value for programmatic testing. - Added `test_thrust_consistency()` which verifies numerical accuracy (~7713.34) and positive scaling of displacement with psychon input. - Integrated the test into the notebook's main execution block. These changes improve the testability of the QAG propulsion model and provide a regression baseline for future modifications. Co-authored-by: Sir-Ripley <31619989+Sir-Ripley@users.noreply.github.com> --- QAG_Truth.ipynb | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/QAG_Truth.ipynb b/QAG_Truth.ipynb index b1286ba..c60c7ba 100644 --- a/QAG_Truth.ipynb +++ b/QAG_Truth.ipynb @@ -35,7 +35,7 @@ }, "outputs": [], "source": [ - "importimport numpy as np\n", + "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "# ==========================================\n", @@ -92,6 +92,7 @@ "\n", " print(f\"--- QAG PROPULSION ({psychon_ug}µg Psychon) ---\")\n", " print(f\"Retrocausal Displacement: {d_retrocausal[-1]:.4f} units\")\n", + " return d_retrocausal[-1]\n", "\n", "def run_stress_test(psychon_ug=5400.0):\n", " steps = 500\n", @@ -186,10 +187,28 @@ " print(f\"Recycling (R_qag): {r_qag*100:.2f}%\")\n", "\n", "# ==========================================\n", + "# 7. UNIT TESTS\n", + "# ==========================================\n", + "def test_thrust_consistency():\n", + " print(\"--- RUNNING QAG THRUST CONSISTENCY TEST ---\")\n", + " d1 = run_thrust_simulation(5400.0)\n", + " d2 = run_thrust_simulation(10800.0)\n", + " \n", + " # Verify that doubling psychon increases displacement (it scales linearly with qid_scale)\n", + " assert d2 > d1, \"Displacement should increase with psychon count\"\n", + " \n", + " # Fixed point check for 5400.0 psychon_ug\n", + " # Formula derived expected value: ~7713.34\n", + " assert abs(d1 - 7713.3436) < 0.01, f\"Expected ~7713.34, got {d1:.2f}\"\n", + " \n", + " print(\"TEST PASSED: Thrust displacement consistency verified.\")\n", + "\n", + "# ==========================================\n", "# EXECUTION BLOCK (Run them all!)\n", "# ==========================================\n", "if __name__ == \"__main__\":\n", " print(\"\\n--- INITIALIZING QAG MASTER SIMULCAST ---\\n\")\n", + " test_thrust_consistency()\n", " run_galactic_theater(1.0)\n", " run_thrust_simulation(5400.0)\n", " run_stress_test(5400.0)\n",