Sync bacp_20261130/REPORT.md (fd16a59)
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146# Bifurcation-Aware Counterfactual Physics (BACP)**Date:** November 30, 2026**Branch:** `feat/bifurcation-counterfactual-physics`**Formal Proofs:** [THEOREMS_AND_PROOFS.md](./THEOREMS_AND_PROOFS.md)**Machine-Readable Results:** [bacp_results.json](./bacp_results.json)## Executive SummaryAcross six consecutive experiments on JAIS (oracle mass-ratio, two-body $\Delta$state, second-impact ridge, multistep/JEPA, stationary-prefix gating, and `joint_h2_onset_velocity`), deterministic point-forecasting refinements repeatedly lowered average coordinate/velocity error while **slowing the struck body and destroying downstream third collisions**.We prove formally ([THEOREMS_AND_PROOFS.md](./THEOREMS_AND_PROOFS.md)) that this failure is **not an architectural quirk**, but a fundamental mathematical consequence of **Bifurcation Mean-Hedging under Prospective Mass Unidentifiability** (Theorems 1–2). Replacing deterministic rollouts with **Bifurcation-Aware Counterfactual Physics (BACP)** — an OpenMP-parallel momentum-conserving particle engine (`16,300` rollouts/sec), Bayesian factual-collision abduction, a heteroscedastic visual-state uncertainty bridge, and **Inverse JAIS Chance-Constrained Counterfactual Control (C4)** — delivers four major empirical breakthroughs across the official JAIS holdout splits and independent 3D PyBullet verification:1. **Theorem 1 Verified to Machine Precision:** Across all 131 official three-hit chains, the L2 risk-separation identity holds to **`4.86 × 10⁻¹⁷`** and the selection-conditioned velocity shrinkage identity holds to **`0.0`** (`+0.196 m/s` mandatory shrinkage across 106 bifurcating scenes). Mean-hedged trajectories cut 3D ADE by **`-1.79 cm`** (95% CI `[-2.52, -1.04] cm`) relative to Topology-Medoid while losing **`24/98`** chains reaching $D$.2. **Theorem 3 — Distributional Dominance:** On 431 official paired holdout scenes (containing all 29 true three-hit chain creations), BACP nearly **doubles causal-creation PR-AUC (`0.516` vs `0.287`)**, raises **AUROC by `+22.6 pp` (`0.908` vs `0.682`)**, and cuts **NLL by 3.3× (`0.236` vs `0.769`)**. On the 131 three-hit chains, BACP's Top-1 full-3-hit mode recovers **`125/131` (`95.4%`)** ordered paths vs. `106/131` (`80.9%`) deterministic, while Topology-Medoid improves strict all-3-hits-timed accuracy (`50/131` vs `44/131`).3. **Theorem 2 — Prospective-to-Retrospective Identifiability Curve:** Prefix free-motion deceleration has **`r² = 0.00149`** with $\log m$ (prospective unidentifiability). Bayesian factual-collision abduction across the unedited video cuts contact-graph entropy by **56.4%** (`0.730 → 0.318 bits`), raises posterior mass on the true 3-hit chain (`0.689 → 0.767`), lowers chain-body log-mass MAE (`0.463 → 0.410`), and boosts strict all-3-hits-timed accuracy from **`36.6% → 42.7%`** (`56/131`, beating the deterministic solver by `+12` chains).4. **Theorem 4 — Inverse JAIS (C4) Verified in True Hidden-Mass Physics AND Independent 3D PyBullet:** Hiding both the true command and true physical attributes (`attrs`), **BACP C4** achieves **`127/131` (`96.9%`)** true-mass 3-hop chain creation vs. **`105/131` (`80.2%`)** Deterministic Min-Effort (`+16.8 pp`, 95% CI `[+10.7, +23.7] pp`) and **`115/131` (`87.8%`)** Deterministic Midpoint (`+9.2 pp`, 95% CI `[+4.6, +14.5] pp`), with **`100.0%` PAC lower-confidence bound coverage**. In an **independent 3D PyBullet physics engine** (zero inverse crime, all `131` scenes), BACP C4 achieves **`98/131` (`74.8%`)** prospective and **`100/131` (`76.3%`)** retrospective vs. **`77/131` (`58.8%`)** Deterministic Min-Effort (`+16.0 pp`, 95% CI `[+8.4, +23.7] pp`) and **`95/131` (`72.5%`)** Deterministic Midpoint.---## Experiment 1 — Theorem 1: Bifurcation Mean-Hedging Collapse (n = 131 Official Three-Hit Chains)All empirical physics priors (`log_mass`, `floor_scale`) were fitted strictly on `400` official training scenes (zero test leakage). Every method starts from identical pre-intervention simulator prefixes ($K = 64$ particles for BACP).| Method | 3D ADE (cm) ↓ | Outgoing C Speed (m/s) | Reaches D (/131) ↑ | Ordered H3 (/131) ↑ | All 3 Timed ±2 (/131) ↑ | Mode NLL ↓ | Mode ECE ↓ || --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: || Simulator Truth | 0.00 | **1.012** | 131 | 131 | 131 | — | — || Deterministic Solver (Point Prior) | 15.99 | 0.737 | — | 106 | 44 | 2.657 | 0.192 || **Mean-Hedged Rollout (Bayes L2)** | **16.73** | **0.721** | **74** | — | — | — | — || **BACP Topology-Medoid (MAP Mode)** | 18.53 | **0.874** | **98** | **106** | **50** | — | — || **BACP Distributional (Top-1 Full / Ensemble)** | — | — | — | **125** (`95.4%`) | — | **0.874** | **0.060** || Oracle True-Mass Solver (Upper Bound) | 12.78 | — | — | 113 | 70 | — | — |- **Mean-Hedged vs. Topology-Medoid Paired ADE Difference:** **`-1.79 cm`** (95% bootstrap CI `[-2.52, -1.04] cm`), while losing **24/98** chains reaching $D$.- **Theorem 1a Algebraic Identity Max Residual:** `4.86 × 10⁻¹⁷`.- **Theorem 1b Selection-Conditioned Speed Shrinkage (106 bifurcating scenes):** Exact identity residual `0.0`, mean mandatory downward bias **`+0.196 m/s`**.---## Experiment 1B — Theorem 3: Paired Causal Chain Creation on Official Holdout (n = 431)Evaluated on `431` paired v2 holdout scenes (`131` three-hit chains + `300` sampled holdout scenes, containing all `29` true causal three-hit chain creations), using Common Random Numbers (identical physical particles on factual $a=0$ and edited $a\ne 0$ branches, $K=48$).| Metric (n = 431 paired holdout) | Deterministic Solver | BACP Distributional (K = 48) | Gain || --- | ---: | ---: | ---: || **Causal Creation PR-AUC ↑** | 0.287 | **0.516** | **+22.9 pp (1.8×)** || **Causal Creation AUROC ↑** | 0.682 | **0.908** | **+22.6 pp** || **Causal Creation Brier ↓** | 0.0557 | **0.0433** | **-22.2%** || **Causal Creation NLL ↓** | 0.769 | **0.236** | **3.3× lower** || **Causal Creation ECE ↓** | 0.0557 | **0.0340** | **-39.0%** || **H3 Existence PR-AUC ↑** | 0.824 | **0.947** | **+12.3 pp** || **H3 Existence NLL ↓** | 0.994 | **0.315** | **3.2× lower** |---## Experiment 2 — Theorem 2: Prospective vs. Retrospective Causal Identifiability (n = 131)Bayesian likelihood-weighted factual abduction (`K = 96`, ESS-tempered) evaluated at post-cutoff factual horizons $h \in \{0, 4, 8, 16, 48\}$ frames:| Factual Horizon Observed | Contact-Graph Entropy (bits) ↓ | $P(\text{true 3-hit})$ ↑ | All 3 Timed ±2 (%) ↑ | Chain-Body Log-Mass MAE ↓ || --- | ---: | ---: | ---: | ---: || **Prefix only ($t = c$, Prospective)** | 0.730 | 0.689 | 36.6% (`48/131`) | 0.463 || $+4$ frames (`0.17 s`) | 0.628 | 0.703 | 37.4% (`49/131`) | 0.453 || $+8$ frames (`0.33 s`) | 0.504 | 0.734 | 39.7% (`52/131`) | 0.436 || $+16$ frames (`0.67 s`) | 0.371 | 0.753 | 41.2% (`54/131`) | 0.422 || **Full factual ($t = 48$, Retrospective)** | **0.318 (-56.4%)** | **0.767 (+7.8 pp)** | **42.7% (`56/131`)** | **0.410** |- **Prospective Mass Unidentifiability (Theorem 2a):** Across `329` moving training subjects, prefix deceleration vs. true $\log m$ yields **`r = 0.0385` (`r² = 0.00149`)**.---## Experiment 3 — Theorem 4: Inverse JAIS Chance-Constrained Control (C4, n = 131)Given **only** the pre-intervention prefix (hiding both the simulator's executed turn and the objects' true masses, frictions, and restitutions), each controller searches $M = 73$ candidate headings in $[-45^\circ, +45^\circ]$ to trigger the target 3-hop chain $A \to B \to C \to D$ while penalizing bystander disruption ($\lambda = 0.05$). Every synthesized heading is evaluated in **both** the true-hidden-mass rigid-body physics and an **independent 3D PyBullet simulation** across all 131 scenes.| Inverse Controller | True-Mass Success (/131) ↑ | Paired Gain vs. Det Min-Effort [95% CI] | Independent 3D PyBullet (/131) ↑ | PyBullet Gain vs. Det Min-Effort [95% CI] | Mean Posterior Reliability ↑ || --- | ---: | ---: | ---: | ---: | ---: || Deterministic Min-Effort | 105 (`80.2%`) | — | 77 (`58.8%`) | — | 69.6% || Deterministic Midpoint | 115 (`87.8%`) | `+7.6 pp` | 95 (`72.5%`) | `+13.7 pp` | — || **BACP C4 (Prospective, K=48)** | **127 (`96.9%`)** | **`+16.8 pp` `[+10.7, +23.7]`** | **98 (`74.8%`)** | **`+16.0 pp` `[+8.4, +23.7]`** | **82.8%** (`+13.3 pp`) || **BACP C4 (Retrospective-Abduced)** | **126 (`96.2%`)** | **`+16.0 pp` `[+9.9, +22.9]`** | **100 (`76.3%`)** | **`+17.6 pp`** | — |- **BACP C4 Prospective vs. Deterministic Midpoint (True-Mass):** **`+9.2 pp`** (95% bootstrap CI **`[+4.6, +14.5] pp`**).- **Theorem 4a PAC 95% Lower-Confidence Bound Empirical Coverage:** **`100.0%` (`131/131` $\ge 95\%$ theoretical guarantee)** with $\varepsilon_{48, 73, 0.05} = 0.288$.---## Experiment 4 — Heteroscedastic Visual-State Uncertainty Bridge on Camera-Projected Prefixes (n = 131)Fitted strictly on `150` official training scenes (`HeteroscedasticRGBBridge`) using camera-ray support-plane backprojection of 2D boxes with calibrated segmentation jitter (`1.5 px` on `512×512`) and visual spin noise:| Visual Prefix Forecaster | 3D ADE (cm) ↓ | Ordered H3 (/131) ↑ | All 3 Timed ±2 (/131) ↑ | Brier ↓ | NLL ↓ | ECE ↓ || --- | ---: | ---: | ---: | ---: | ---: | ---: || Raw Visual → Deterministic Solver | 54.8 | 54 (`41.2%`) | 11 | — | — | — || Calibrated Visual → Deterministic Solver | 35.1 | 57 (`43.5%`) | 17 | 0.565 | 7.804 | 0.565 || **BACP-RGB (Joint Visual + Physics Uncertainty)** | **35.0** (mean) | **106 (`80.9%` Top-1 Full)** / **102 Top-3** | **18** (medoid) | **0.532** | **3.409** | **0.510** |---## Experiment 5 — End-to-End Counterfactual Video Generation (Wan 2.2-Fun-5B-Control)To validate the complete pipeline from **observed RGB video → BACP C4 inverse control → 3D-to-2D silhouette control masks → counterfactual RGB video**, we ran [run_bacp_video_pipeline.py](../../scripts/run_bacp_video_pipeline.py) (`bacp/video_pipeline.py`) on three held-out JAIS v2 scenes (`006144`, `008367`, `008760`) where Deterministic Min-Effort fails and BACP C4 succeeds in **both** true hidden-mass physics and independent 3D PyBullet.- **Video Backbone:** Pinned `alibaba-pai/Wan2.2-Fun-5B-Control` (`b8bc1a65ab71d054ba4636dc0dac104aa4df2686`) + `VideoX-Fun` (`98fffa929bb373edcbfa3620e9aa05cd65a53103`) + trained 7,200-step JAIS LoRA adapter (`wan22_fun5b_control_7200_20261127/training/model/terminal.pt`).- **Protocol:** `48` frames @ `24 fps`, `256×256`, `30` Euler steps, matched diffusion seeds across all three arms per scene (`Det Min PyBullet`, `BACP C4 Planned Medoid`, `BACP C4 PyBullet Verified`). Total wall time for all 9 Wan 2.2 rollouts + 3 labeled 4-panel comparison MP4s + 3 filmstrips: **`92.4 s`** on RTX PRO 6000.- **Machine-Readable Video Metrics:** [video_pipeline_results.json](./videos/video_pipeline_results.json)- **Hugging Face Backup:** [`pineapplechoco/jais-physical-graph-cache/bacp_20261130/videos`](https://huggingface.co/datasets/pineapplechoco/jais-physical-graph-cache/tree/main/bacp_20261130/videos)| Scene | Cut | Target Chain | Det Min Angle → PyBullet | BACP C4 Angle (Rel.) → Plan / PyBullet | Prefix RGB MAE ↓ | Mask-Ablation RMS ↑ | Comparison Video || --- | ---: | --- | --- | --- | ---: | ---: | --- || `006144` | 1 | `→1→3→2` | `+0.0°` → `[1]` (**MISS**) | **`-7.5°`** (`97.9%`) → `[1,3,2]` / `[1,3,2]` (**HIT**) | `1.00–1.01` | `0.218–0.273` | [006144_bacp_comparison.mp4](./videos/006144_bacp_comparison.mp4) || `008367` | 2 | `→2→3→1` | `+0.0°` → `[2,3]` (**MISS**) | **`+17.5°`** (`89.6%`) → `[2,3,1]` / `[2,3,1]` (**HIT**) | `0.96–0.98` | `0.327–0.344` | [008367_bacp_comparison.mp4](./videos/008367_bacp_comparison.mp4) || `008760` | 3 | `→3→2→1` | `+1.25°` → `[3,2]` (**MISS**) | **`+10.0°`** (`79.2%`) → `[3,2,1]` / `[3,2,1]` (**HIT**) | `1.30` | `0.207–0.227` | [008760_bacp_comparison.mp4](./videos/008760_bacp_comparison.mp4) |All three arms preserve the observed pre-intervention prefix (`0.96–1.30 / 255` pixel MAE) while responding strongly to the counterfactual control masks (`0.207–0.344` mask-ablation RMS). Visually, BACP C4's planned medoid video closely tracks the independent 3D PyBullet-verified counterfactual trajectory across all three scenes, clearly showing the controlled divergence from the missed Deterministic Min-Effort path (with only minor faint vacated-floor disocclusion ghosts inherited from the baseline `terminal.pt` Wan 2.2 adapter).---## Reproduction```bash# Run formal unit & theorem verification testspytest tests/test_bacp_formal.py# Run full JAIS holdout + PyBullet experimental suite (Linux/macOS with g++ & pybullet)python scripts/run_bacp_experiments.py# Regenerate all 5 publication figurespython scripts/make_bacp_figures.py report/2026-11-30-bifurcation-counterfactual-physics/bacp_results.json report/2026-11-30-bifurcation-counterfactual-physics/figures# Run full end-to-end Wan 2.2-Fun-5B-Control counterfactual video generation pipeline (GPU)python scripts/run_bacp_video_pipeline.py```123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201# Bifurcation-Aware Counterfactual Physics (BACP)**Date:** November 30, 2026**Branch:** `feat/bifurcation-counterfactual-physics`**Formal Proofs:** [THEOREMS_AND_PROOFS.md](./THEOREMS_AND_PROOFS.md)**Machine-Readable Results:** [bacp_results.json](./bacp_results.json)## Executive SummaryAcross six consecutive experiments on JAIS (oracle mass-ratio, two-body $\Delta$state, second-impact ridge, multistep/JEPA, stationary-prefix gating, and `joint_h2_onset_velocity`), deterministic point-forecasting refinements repeatedly lowered average coordinate/velocity error while **slowing the struck body and destroying downstream third collisions**.We prove formally ([THEOREMS_AND_PROOFS.md](./THEOREMS_AND_PROOFS.md)) that this failure is **not an architectural quirk**, but a fundamental mathematical consequence of **Bifurcation Mean-Hedging under Prospective Mass Unidentifiability** (Theorems 1–2). Replacing deterministic rollouts with **Bifurcation-Aware Counterfactual Physics (BACP)** — an OpenMP-parallel momentum-conserving particle engine (`16,300` rollouts/sec), Bayesian factual-collision abduction, a heteroscedastic visual-state uncertainty bridge, and **Inverse JAIS Chance-Constrained Counterfactual Control (C4)** — delivers four major empirical breakthroughs across the official JAIS holdout splits and independent 3D PyBullet verification:1. **Theorem 1 Verified to Machine Precision:** Across all 131 official three-hit chains, the L2 risk-separation identity holds to **`4.86 × 10⁻¹⁷`** and the selection-conditioned velocity shrinkage identity holds to **`0.0`** (`+0.196 m/s` mandatory shrinkage across 106 bifurcating scenes). Mean-hedged trajectories cut 3D ADE by **`-1.79 cm`** (95% CI `[-2.52, -1.04] cm`) relative to Topology-Medoid while losing **`24/98`** chains reaching $D$.2. **Theorem 3 — Distributional Dominance:** On 431 official paired holdout scenes (containing all 29 true three-hit chain creations), BACP nearly **doubles causal-creation PR-AUC (`0.516` vs `0.287`)**, raises **AUROC by `+22.6 pp` (`0.908` vs `0.682`)**, and cuts **NLL by 3.3× (`0.236` vs `0.769`)**. On the 131 three-hit chains, BACP's Top-1 full-3-hit mode recovers **`125/131` (`95.4%`)** ordered paths vs. `106/131` (`80.9%`) deterministic, while Topology-Medoid improves strict all-3-hits-timed accuracy (`50/131` vs `44/131`).3. **Theorem 2 — Prospective-to-Retrospective Identifiability Curve:** Prefix free-motion deceleration has **`r² = 0.00149`** with $\log m$ (prospective unidentifiability). Bayesian factual-collision abduction across the unedited video cuts contact-graph entropy by **56.4%** (`0.730 → 0.318 bits`), raises posterior mass on the true 3-hit chain (`0.689 → 0.767`), lowers chain-body log-mass MAE (`0.463 → 0.410`), and boosts strict all-3-hits-timed accuracy from **`36.6% → 42.7%`** (`56/131`, beating the deterministic solver by `+12` chains).4. **Theorem 4 — Inverse JAIS (C4) Verified in True Hidden-Mass Physics AND Independent 3D PyBullet:** Hiding both the true command and true physical attributes (`attrs`), **BACP C4** achieves **`127/131` (`96.9%`)** true-mass 3-hop chain creation vs. **`105/131` (`80.2%`)** Deterministic Min-Effort (`+16.8 pp`, 95% CI `[+10.7, +23.7] pp`) and **`115/131` (`87.8%`)** Deterministic Midpoint (`+9.2 pp`, 95% CI `[+4.6, +14.5] pp`), with **`100.0%` PAC lower-confidence bound coverage**. In an **independent 3D PyBullet physics engine** (zero inverse crime, all `131` scenes), BACP C4 achieves **`98/131` (`74.8%`)** prospective and **`100/131` (`76.3%`)** retrospective vs. **`77/131` (`58.8%`)** Deterministic Min-Effort (`+16.0 pp`, 95% CI `[+8.4, +23.7] pp`) and **`95/131` (`72.5%`)** Deterministic Midpoint.---## Experiment 1 — Theorem 1: Bifurcation Mean-Hedging Collapse (n = 131 Official Three-Hit Chains)All empirical physics priors (`log_mass`, `floor_scale`) were fitted strictly on `400` official training scenes (zero test leakage). Every method starts from identical pre-intervention simulator prefixes ($K = 64$ particles for BACP).| Method | 3D ADE (cm) ↓ | Outgoing C Speed (m/s) | Reaches D (/131) ↑ | Ordered H3 (/131) ↑ | All 3 Timed ±2 (/131) ↑ | Mode NLL ↓ | Mode ECE ↓ || --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: || Simulator Truth | 0.00 | **1.012** | 131 | 131 | 131 | — | — || Deterministic Solver (Point Prior) | 15.99 | 0.737 | — | 106 | 44 | 2.657 | 0.192 || **Mean-Hedged Rollout (Bayes L2)** | **16.73** | **0.721** | **74** | — | — | — | — || **BACP Topology-Medoid (MAP Mode)** | 18.53 | **0.874** | **98** | **106** | **50** | — | — || **BACP Distributional (Top-1 Full / Ensemble)** | — | — | — | **125** (`95.4%`) | — | **0.874** | **0.060** || Oracle True-Mass Solver (Upper Bound) | 12.78 | — | — | 113 | 70 | — | — |- **Mean-Hedged vs. Topology-Medoid Paired ADE Difference:** **`-1.79 cm`** (95% bootstrap CI `[-2.52, -1.04] cm`), while losing **24/98** chains reaching $D$.- **Theorem 1a Algebraic Identity Max Residual:** `4.86 × 10⁻¹⁷`.- **Theorem 1b Selection-Conditioned Speed Shrinkage (106 bifurcating scenes):** Exact identity residual `0.0`, mean mandatory downward bias **`+0.196 m/s`**.---## Experiment 1B — Theorem 3: Paired Causal Chain Creation on Official Holdout (n = 431)Evaluated on `431` paired v2 holdout scenes (`131` three-hit chains + `300` sampled holdout scenes, containing all `29` true causal three-hit chain creations), using Common Random Numbers (identical physical particles on factual $a=0$ and edited $a\ne 0$ branches, $K=48$).| Metric (n = 431 paired holdout) | Deterministic Solver | BACP Distributional (K = 48) | Gain || --- | ---: | ---: | ---: || **Causal Creation PR-AUC ↑** | 0.287 | **0.516** | **+22.9 pp (1.8×)** || **Causal Creation AUROC ↑** | 0.682 | **0.908** | **+22.6 pp** || **Causal Creation Brier ↓** | 0.0557 | **0.0433** | **-22.2%** || **Causal Creation NLL ↓** | 0.769 | **0.236** | **3.3× lower** || **Causal Creation ECE ↓** | 0.0557 | **0.0340** | **-39.0%** || **H3 Existence PR-AUC ↑** | 0.824 | **0.947** | **+12.3 pp** || **H3 Existence NLL ↓** | 0.994 | **0.315** | **3.2× lower** |---## Experiment 2 — Theorem 2: Prospective vs. Retrospective Causal Identifiability (n = 131)Bayesian likelihood-weighted factual abduction (`K = 96`, ESS-tempered) evaluated at post-cutoff factual horizons $h \in \{0, 4, 8, 16, 48\}$ frames:| Factual Horizon Observed | Contact-Graph Entropy (bits) ↓ | $P(\text{true 3-hit})$ ↑ | All 3 Timed ±2 (%) ↑ | Chain-Body Log-Mass MAE ↓ || --- | ---: | ---: | ---: | ---: || **Prefix only ($t = c$, Prospective)** | 0.730 | 0.689 | 36.6% (`48/131`) | 0.463 || $+4$ frames (`0.17 s`) | 0.628 | 0.703 | 37.4% (`49/131`) | 0.453 || $+8$ frames (`0.33 s`) | 0.504 | 0.734 | 39.7% (`52/131`) | 0.436 || $+16$ frames (`0.67 s`) | 0.371 | 0.753 | 41.2% (`54/131`) | 0.422 || **Full factual ($t = 48$, Retrospective)** | **0.318 (-56.4%)** | **0.767 (+7.8 pp)** | **42.7% (`56/131`)** | **0.410** |- **Prospective Mass Unidentifiability (Theorem 2a):** Across `329` moving training subjects, prefix deceleration vs. true $\log m$ yields **`r = 0.0385` (`r² = 0.00149`)**.### Complete Propagator Comparison (H1 / H2 / H3 + Trajectory & Timing Metrics)Direct apples-to-apples comparison of the updated BACP propagator against the Nov 24 released hybrid/attention propagator (`n = 127`) and the deterministic point-prior rigid-body solver across all `n = 131` official three-hit chains:| Propagator Variant | Split (`n`) | 3D ADE (m) ↓ | 3D MSE (m²) ↓ | 3D FDE (m) ↓ | Ordered H1 / H2 / H3 ↑ | Timed ±2 H1 / H2 / H3 ↑ | Timing MAE H1 / H2 / H3 (fr) ↓ || --- | :---: | ---: | ---: | ---: | :---: | :---: | :---: || Released Hybrid/Attention (Nov 24) | 127 | 0.1870 | 0.04115 | — | `127 / 124 / 90` (`70.9%`) | — | `0.47 / 1.43 / 5.12` || Deterministic Solver (Point Prior) | 131 | 0.1599 | 0.03326 | 0.3184 | `131 / 129 / 106` (`80.9%`) | `131 / 116 / 44` (`33.6%`) | `0.21 / 1.10 / 4.88` || **BACP Prospective ($K=64$, prefix-only)** | 131 | `0.1646` (mean) / `0.1766` (medoid) | `0.03326` | `0.3184` | **`131 / 130 / 125` (`95.4%` Top-1 Full)** | **`131 / 116 / 50` (`38.2%` medoid)** | `0.21 / 1.10 / 4.88` || **BACP Retro Pearl-Abduced ($h=16$ fr)** | 131 | **`0.0964`** (`-48.4%`) | **`0.01189`** (`3.5×` ↓) | **`0.2015`** | **`131 / 130 / 126` (`96.2%` Top-1 Full)** (`108` medoid) | **`131 / 121 / 66` (`50.4%`)** | **`0.21 / 0.85 / 2.89`** || **BACP Retro Pearl-Abduced ($h=48$ fr)** | 131 | **`0.0882`** (`-52.8%`) | **`0.00989`** (`4.2×` ↓) | **`0.1683`** (`-47.1%`) | **`131 / 130 / 126` (`96.2%` Top-1 Full)** | `131 / 121 / 56–66` | **`0.21 / 0.85 / 2.89`** || Oracle True-Mass Solver (Upper Bound) | 131 | 0.1278 | — | — | `131 / 130 / 113` (`86.3%`) | `131 / 123 / 70` (`53.4%`) | — |Throughput: **`16,300` rollouts/sec** via OpenMP C++17 (`~3.9 ms` per 64-particle counterfactual forecast).---## Experiment 3 — Theorem 4: Inverse JAIS Chance-Constrained Control (C4, n = 131)Given **only** the pre-intervention prefix (hiding both the simulator's executed turn and the objects' true masses, frictions, and restitutions), each controller searches $M = 73$ candidate headings in $[-45^\circ, +45^\circ]$ to trigger the target 3-hop chain $A \to B \to C \to D$ while penalizing bystander disruption ($\lambda = 0.05$). Every synthesized heading is evaluated in **both** the true-hidden-mass rigid-body physics and an **independent 3D PyBullet simulation** across all 131 scenes.| Inverse Controller | True-Mass Success (/131) ↑ | Paired Gain vs. Det Min-Effort [95% CI] | Independent 3D PyBullet (/131) ↑ | PyBullet Gain vs. Det Min-Effort [95% CI] | Mean Posterior Reliability ↑ || --- | ---: | ---: | ---: | ---: | ---: || Deterministic Min-Effort | 105 (`80.2%`) | — | 77 (`58.8%`) | — | 69.6% || Deterministic Midpoint | 115 (`87.8%`) | `+7.6 pp` | 95 (`72.5%`) | `+13.7 pp` | — || **BACP C4 (Prospective, K=48)** | **127 (`96.9%`)** | **`+16.8 pp` `[+10.7, +23.7]`** | **98 (`74.8%`)** | **`+16.0 pp` `[+8.4, +23.7]`** | **82.8%** (`+13.3 pp`) || **BACP C4 (Retrospective-Abduced)** | **126 (`96.2%`)** | **`+16.0 pp` `[+9.9, +22.9]`** | **100 (`76.3%`)** | **`+17.6 pp`** | — |- **BACP C4 Prospective vs. Deterministic Midpoint (True-Mass):** **`+9.2 pp`** (95% bootstrap CI **`[+4.6, +14.5] pp`**).- **Theorem 4a PAC 95% Lower-Confidence Bound Empirical Coverage:** **`100.0%` (`131/131` $\ge 95\%$ theoretical guarantee)** with $\varepsilon_{48, 73, 0.05} = 0.288$.---## Experiment 4 — Heteroscedastic Visual-State Uncertainty Bridge on Camera-Projected Prefixes (n = 131)Fitted strictly on `150` official training scenes (`HeteroscedasticRGBBridge`) using camera-ray support-plane backprojection of 2D boxes with calibrated segmentation jitter (`1.5 px` on `512×512`) and visual spin noise:| Visual Prefix Forecaster | 3D ADE (cm) ↓ | Ordered H3 (/131) ↑ | All 3 Timed ±2 (/131) ↑ | Brier ↓ | NLL ↓ | ECE ↓ || --- | ---: | ---: | ---: | ---: | ---: | ---: || Raw Visual → Deterministic Solver | 54.8 | 54 (`41.2%`) | 11 | — | — | — || Calibrated Visual → Deterministic Solver | 35.1 | 57 (`43.5%`) | 17 | 0.565 | 7.804 | 0.565 || **BACP-RGB (Joint Visual + Physics Uncertainty)** | **35.0** (mean) | **106 (`80.9%` Top-1 Full)** / **102 Top-3** | **18** (medoid) | **0.532** | **3.409** | **0.510** |---## Experiment 5 — End-to-End Counterfactual Video Generation (Wan 2.2-Fun-5B-Control)To validate the complete pipeline from **observed RGB video → BACP C4 inverse control → 3D-to-2D silhouette control masks → counterfactual RGB video**, we ran [run_bacp_video_pipeline.py](../../scripts/run_bacp_video_pipeline.py) (`bacp/video_pipeline.py`) on three held-out JAIS v2 scenes (`006144`, `008367`, `008760`) where Deterministic Min-Effort fails and BACP C4 succeeds in **both** true hidden-mass physics and independent 3D PyBullet.- **Video Backbone:** Pinned `alibaba-pai/Wan2.2-Fun-5B-Control` (`b8bc1a65ab71d054ba4636dc0dac104aa4df2686`) + `VideoX-Fun` (`98fffa929bb373edcbfa3620e9aa05cd65a53103`) + trained 7,200-step JAIS LoRA adapter (`wan22_fun5b_control_7200_20261127/training/model/terminal.pt`).- **Protocol:** `48` frames @ `24 fps`, `256×256`, `30` Euler steps, matched diffusion seeds across all three arms per scene (`Det Min PyBullet`, `BACP C4 Planned Medoid`, `BACP C4 PyBullet Verified`). Total wall time for all 9 Wan 2.2 rollouts + 3 labeled 4-panel comparison MP4s + 3 filmstrips: **`92.4 s`** on RTX PRO 6000.- **Machine-Readable Video Metrics:** [video_pipeline_results.json](./videos/video_pipeline_results.json)- **Hugging Face Backup:** [`pineapplechoco/jais-physical-graph-cache/bacp_20261130/videos`](https://huggingface.co/datasets/pineapplechoco/jais-physical-graph-cache/tree/main/bacp_20261130/videos)| Scene | Cut | Target Chain | Det Min Angle → PyBullet | BACP C4 Angle (Rel.) → Plan / PyBullet | Prefix RGB MAE ↓ | Mask-Ablation RMS ↑ | Comparison Video || --- | ---: | --- | --- | --- | ---: | ---: | --- || `006144` | 1 | `→1→3→2` | `+0.0°` → `[1]` (**MISS**) | **`-7.5°`** (`97.9%`) → `[1,3,2]` / `[1,3,2]` (**HIT**) | `1.00–1.01` | `0.218–0.273` | [006144_bacp_comparison.mp4](./videos/006144_bacp_comparison.mp4) || `008367` | 2 | `→2→3→1` | `+0.0°` → `[2,3]` (**MISS**) | **`+17.5°`** (`89.6%`) → `[2,3,1]` / `[2,3,1]` (**HIT**) | `0.96–0.98` | `0.327–0.344` | [008367_bacp_comparison.mp4](./videos/008367_bacp_comparison.mp4) || `008760` | 3 | `→3→2→1` | `+1.25°` → `[3,2]` (**MISS**) | **`+10.0°`** (`79.2%`) → `[3,2,1]` / `[3,2,1]` (**HIT**) | `1.30` | `0.207–0.227` | [008760_bacp_comparison.mp4](./videos/008760_bacp_comparison.mp4) |All three arms preserve the observed pre-intervention prefix (`0.96–1.30 / 255` pixel MAE) while responding strongly to the counterfactual control masks (`0.207–0.344` mask-ablation RMS). Visually, BACP C4's planned medoid video closely tracks the independent 3D PyBullet-verified counterfactual trajectory across all three scenes, clearly showing the controlled divergence from the missed Deterministic Min-Effort path (with only minor faint vacated-floor disocclusion ghosts inherited from the baseline `terminal.pt` Wan 2.2 adapter).### Experiment 5B — Real-RGB Disocclusion-Weighted Wan 2.2 Fine-Tuning (`bacp_wan22_disocc_ema.pt`)**Root-Cause Diagnosis:** Inspection of the initial Wan 2.2 renders revealed faint vacated-floor ghosting and dull shading. Auditing `wan22_model.py` (`train_row`) and `wan22_experiment.py` showed that the frozen Nov 27 checkpoint (`terminal.pt`) was **never supervised on real 48-frame Blender RGB videos**—it trained solely on synthetic copy-paste `prefix_proxy` targets stitched from 2–4 prefix frames with **zero loss weight on vacated-floor pixels** and no real 3D shadows or lighting.**Zero-Leakage Real-RGB Fine-Tuning ([finetune_wan22_disocc.py](../../scripts/finetune_wan22_disocc.py)):** Starting from `terminal.pt`, we fine-tuned LoRA + `patch_embedding` delta parameters for `900` steps (`batch_size = 2`, cosine LR `8e-5 → 8e-6` LoRA / `1.6e-4` PatchDelta, EMA `0.992`, `626.0 s` total including pre-encoding & full evaluation on RTX PRO 6000) on **560 real 48-frame Blender videos** (`280` strictly `catalog['train']` scenes × counterfactual & factual branches, zero overlap with `val`/`test`) using a **4-region Disocclusion-Weighted Flow-Matching Loss** (`0.35` Vacated Floor, `0.35` Foreground Objects, `0.15` Stable Floor, `0.15` Global Anchor).- **Fine-Tuned Checkpoint (99.4 MB, HF):** [`bacp_wan22_disocc_ema.pt`](https://huggingface.co/datasets/pineapplechoco/jais-physical-graph-cache/resolve/main/bacp_20261130/wan22_disocc_ft/bacp_wan22_disocc_ema.pt)- **Machine-Readable Metrics:** [disocc_ft_results.json](./videos_disocc/disocc_ft_results.json)- **Hugging Face Videos Backup:** [`pineapplechoco/jais-physical-graph-cache/bacp_20261130/videos_disocc`](https://huggingface.co/datasets/pineapplechoco/jais-physical-graph-cache/tree/main/bacp_20261130/videos_disocc)#### Before vs. After on 8 Completely Unseen Validation Scenes (including `001936`, 0–255 RGB MAE)| Metric (8 unseen `val` scenes) | Frozen `terminal.pt` (Nov 27) | **Disocclusion-FT (`bacp_wan22_disocc_ema.pt`)** | Improvement || --- | ---: | ---: | ---: || **Vacated Floor MAE (ghosting) ↓** | 9.915 | **3.166** | **`-68.1%` (`3.1×` lower)** || **Scene `001936` Frame-29 Spot MAE ↓** | 6.768 | **2.139** | **`-68.4%` (`3.2×` lower)** || **Stable Floor MAE ↓** | 2.487 | **1.530** | **`-38.5%`** || **Static Object MAE ↓** | 5.681 | **4.740** | **`-16.6%`** || **Moved Object MAE ↓** | 13.390 | **10.973** | **`-18.1%`** || **Whole-Frame MAE ↓** | 3.004 | **1.841** | **`-38.7%`** || **Whole-Frame PSNR (dB) ↑** | 33.09 | **37.07** | **`+3.98 dB`** || **Prefix Preservation MAE ↓** | 2.156 | **1.692** | **`-21.5%`** || **Mask-Ablation RMS ↑** | 0.378 | **0.515** | **`+36.2%` stronger control** |#### Re-Rendered BACP C4 Showcase Scenes (`test` split, Disocclusion-FT)| Scene | Cut | Target Chain | Prefix RGB MAE ↓ | Mask-Ablation RMS (Before → **After**) ↑ | Updated Comparison Video || --- | ---: | --- | ---: | :---: | --- || `001936` (Val) | 4 | Before vs. After | `2.26 → 1.64` | `0.223 → 0.221` (spot `6.77 → 2.14`) | [001936_before_after_comparison.mp4](./videos_disocc/001936_before_after_comparison.mp4) || `006144` (Test) | 1 | `→1→3→2` | **`0.90–0.92`** | `0.222` → **`0.394–0.396`** | [006144_bacp_comparison_disocc.mp4](./videos_disocc/006144_bacp_comparison_disocc.mp4) || `008367` (Test) | 2 | `→2→3→1` | **`0.75–0.76`** | `0.327` → **`0.396–0.407`** | [008367_bacp_comparison_disocc.mp4](./videos_disocc/008367_bacp_comparison_disocc.mp4) || `008760` (Test) | 3 | `→3→2→1` | **`0.98`** | `0.208` → **`0.263–0.276`** | [008760_bacp_comparison_disocc.mp4](./videos_disocc/008760_bacp_comparison_disocc.mp4) |---## Reproduction```bash# Run formal unit & theorem verification testspytest tests/test_bacp_formal.py# Run full JAIS holdout + PyBullet experimental suite (Linux/macOS with g++ & pybullet)python scripts/run_bacp_experiments.py# Regenerate all 5 publication figurespython scripts/make_bacp_figures.py report/2026-11-30-bifurcation-counterfactual-physics/bacp_results.json report/2026-11-30-bifurcation-counterfactual-physics/figures# Run full end-to-end Wan 2.2-Fun-5B-Control counterfactual video generation pipeline (GPU)python scripts/run_bacp_video_pipeline.py# Run zero-leakage Real-RGB Disocclusion-Weighted Wan 2.2 fine-tuning + val & showcase eval (GPU)python scripts/finetune_wan22_disocc.py```
bacp_20261130/REPORT.md+201-146