From 16ef5fdaebb5f5c1410131269fa418a17de767bb Mon Sep 17 00:00:00 2001 From: Dmitriy Vasilev Date: Thu, 30 Apr 2026 04:03:43 +0700 Subject: [PATCH] =?UTF-8?q?feat(math):=20--weinberg=20diagnostic=20?= =?UTF-8?q?=E2=80=94=20phi^-3=20vs=20PDG=20sin^2(theta=5FW)=20(Closes=20#2?= =?UTF-8?q?95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add --weinberg flag to MathCommands::Compare - Print phi^-3, PDG sin^2(theta_W), delta_abs, delta_rel - Golden test: |phi^-3 - sin^2(theta_W)| < 0.005 - JSONL fields: weinberg_enabled, phi_inv_cubed, sin2_theta_w_ref --- bootstrap/src/math_compare.rs | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/bootstrap/src/math_compare.rs b/bootstrap/src/math_compare.rs index 00551ceb..ce6660f3 100644 --- a/bootstrap/src/math_compare.rs +++ b/bootstrap/src/math_compare.rs @@ -24,6 +24,8 @@ const CKM_V_US: f64 = 0.225; const CKM_V_CB: f64 = 0.0418; const CKM_V_UB: f64 = 0.0037; +const SIN2_THETA_W_REF: f64 = 0.23122; + #[derive(Subcommand, Debug)] pub enum MathCommands { /// Compare L5 anchors; optional Pellis, extended SM proxies, hybrid map, sensitivity. @@ -49,6 +51,9 @@ pub enum MathCommands { /// Numeric partials of TRINITY and (if --hybrid) hybrid score w.r.t. phi. #[arg(long)] sensitivity: bool, + /// Weinberg angle diagnostic: phi^-3 vs PDG sin^2(theta_W). + #[arg(long)] + weinberg: bool, }, } @@ -62,6 +67,7 @@ pub fn run_math_command(cmd: MathCommands, repo_root: &Path) -> anyhow::Result<( n, theta, sensitivity, + weinberg, } => run_compare( repo_root, CompareOpts { @@ -72,6 +78,7 @@ pub fn run_math_command(cmd: MathCommands, repo_root: &Path) -> anyhow::Result<( n, theta, sensitivity, + weinberg, }, ), } @@ -85,6 +92,7 @@ pub struct CompareOpts { pub n: u32, pub theta: bool, pub sensitivity: bool, + pub weinberg: bool, } #[inline] @@ -323,6 +331,30 @@ fn run_compare(repo_root: &Path, opts: CompareOpts) -> anyhow::Result<()> { record["pellis_spec_seal_hash"] = json!(h); } + if opts.weinberg { + let phi_inv_cubed = phi_inv.powi(3); + let delta_abs = (phi_inv_cubed - SIN2_THETA_W_REF).abs(); + let delta_rel = delta_abs / SIN2_THETA_W_REF; + + println!("=== Weinberg Angle Diagnostic (issue #295) ==="); + println!("phi^-3 = {:.10}", phi_inv_cubed); + println!("sin^2(theta_W) = {:.10} (PDG MS-bar)", SIN2_THETA_W_REF); + println!("delta_abs = {:.10}", delta_abs); + println!("delta_rel = {:.6} ({:.2}%)", delta_rel, delta_rel * 100.0); + + let bound = 0.005_f64; + if delta_abs < bound { + println!("golden test: |phi^-3 - sin^2(theta_W)| = {:.10} < {} PASS", delta_abs, bound); + } else { + println!("golden test: |phi^-3 - sin^2(theta_W)| = {:.10} >= {} NOT MET", delta_abs, bound); + } + + record["weinberg_enabled"] = json!(true); + record["phi_inv_cubed"] = json!(phi_inv_cubed); + record["sin2_theta_w_ref"] = json!(SIN2_THETA_W_REF); + record["delta_abs"] = json!(delta_abs); + record["delta_rel"] = json!(delta_rel); + } append_experience(repo_root, &record)?; println!( @@ -440,4 +472,25 @@ mod tests { theta ); } + + #[test] + fn test_weinberg_golden_bound() { + let phi_inv_cubed = (1.0 / phi()).powi(3); + let delta = (phi_inv_cubed - SIN2_THETA_W_REF).abs(); + assert!( + delta < 0.005, + "golden test: |phi^-3 - sin^2(theta_W)| = {:.10} >= 0.005", + delta + ); + } + + #[test] + fn test_phi_inv_cubed_approx() { + let phi_inv_cubed = (1.0 / phi()).powi(3); + assert!( + (phi_inv_cubed - 0.236068).abs() < 0.001, + "phi^-3 should be ~0.236, got {:.10}", + phi_inv_cubed + ); + } }