{
 "artifacts": [
  {
   "name": "barrier_experiment.py",
   "url": "https://synthcore.org/code/1071/barrier_experiment.py"
  },
  {
   "name": "bench_report.json",
   "url": "https://synthcore.org/code/1071/bench_report.json"
  },
  {
   "name": "report.md",
   "url": "https://synthcore.org/code/1071/report.md"
  },
  {
   "name": "report_bench_2026-09-02T002000.md",
   "url": "https://synthcore.org/code/1071/report_bench_2026-09-02T002000.md"
  },
  {
   "name": "results.json",
   "url": "https://synthcore.org/code/1071/results.json"
  },
  {
   "name": "stage2_bench.py",
   "url": "https://synthcore.org/code/1071/stage2_bench.py"
  }
 ],
 "category": "dynamics",
 "description": "Train a neural barrier function that certifies a lower bound on the probability of reaching a target before entering an unsafe set, uniformly over an entire compact set of initial states. Add boundary and expected-drift penalties to a learned world model or policy, and enforce a positive slack margin rather than fitting only pointwise trajectories. The mechanism should improve safety under distribution shift because the certificate constrains one-step stochastic transitions throughout the reachable state region.",
 "download_zip": "https://synthcore.org/download/1071",
 "formulas_latex": [
  "$$x_{k+1}=F(x_k,\\pi_\\phi(x_k),w_k),\\qquad P_\\theta(x)=\\mathbb{E}_{w\\sim P(\\cdot\\mid x)}\\left[B_\\theta\\left(F(x,\\pi_\\phi(x),w)\\right)\\right],$$",
  "$$B_\\theta(x)\\le 1-p-\\delta\\ \\ (x\\in X_0),\\qquad B_\\theta(x)\\ge 1\\ \\ (x\\in U),\\qquad B_\\theta(x)=0\\ \\ (x\\in T),$$",
  "$$P_\\theta(x)-B_\\theta(x)\\le -\\delta\\quad (x\\in C),\\qquad \\Pr_x(\\tau_U\u003c\\tau_T)\\le B_\\theta(x),\\qquad \\Pr_x(\\tau_T\u003c\\tau_U)\\ge 1-B_\\theta(x),$$",
  "$$\\mathcal{L}(\\theta,\\phi)=\\mathcal{L}_{\\mathrm{task}}+\\lambda_0\\,\\mathbb{E}_{x\\in X_0}[\\operatorname{softplus}(B_\\theta(x)-(1-p-\\delta))]+\\lambda_U\\,\\mathbb{E}_{x\\in U}[\\operatorname{softplus}(1-B_\\theta(x))]+\\lambda_T\\,\\mathbb{E}_{x\\in T}[|B_\\theta(x)|]+\\lambda_C\\,\\mathbb{E}_{x\\in C}[\\operatorname{softplus}(P_\\theta(x)-B_\\theta(x)+\\delta)]$$"
 ],
 "id": 2884,
 "implementation": "1. Exact integration point: attach a scalar MLP $B_\\theta(x)$ to a stochastic policy, learned dynamics model, or model-based RL system. Use it as a safety regularizer during policy training and as a runtime monitor; the task loss remains the ordinary RL or imitation objective. Restrict evaluation to a compact safe envelope $S$ and explicitly define target $T$, unsafe $U$, continuation $C$, and initial set $X_0$.\n\n2. Pseudocode: sample minibatches from $X_0,U,T,C$; for each $x\\in C$, draw $M$ disturbances $w_j$ and compute $x'_j=F(x,\\pi_\\phi(x),w_j)$, then estimate $\\widehat P_\\theta(x)=M^{-1}\\sum_jB_\\theta(x'_j)$. Minimize the displayed loss, while adding an adversarial inner loop that maximizes each constraint violation over small perturbations of $x$. After each update, record the worst observed values of $B(x)-(1-p-\\delta)$, $1-B(x)$ on $U$, $|B(x)|$ on $T$, and $\\widehat P(x)-B(x)+\\delta$ on $C$.\n\n3. Computed versus estimated: the boundary inequalities are directly evaluated; the expectation is estimated by disturbance Monte Carlo, quadrature, or a learned noise sampler. If $F$ is differentiable, use gradient-based adversarial state search; otherwise use dense low-discrepancy sampling. The mathematical certificate assumes continuity and a uniform strict margin, while finite neural sampling only provides a falsification-oriented approximation, so retain a held-out disturbance set and optionally interval-bound $B_\\theta$ for a final certificate.\n\n4. First cheap experiment: use a 2D stochastic Dubins car or linear system $x_{k+1}=Ax_k+Bu_k+\\sigma w_k$, a small MLP policy, a circular target, and rectangular unsafe states. Compare ordinary policy optimization against the barrier-regularized version for $p\\in\\{0.7,0.8,0.9,0.95\\}$. Estimate the true reach-avoid probability with 10,000 rollouts and sweep $p$. The quantitative prediction is a feasibility cliff: when $p$ exceeds the empirical worst-case reach-avoid probability on $X_0$, the minimum constraint violation and barrier loss should rise sharply; below it, violations should decrease with sample count and the measured lower bound $1-\\sup_{x\\in X_0}B_\\theta(x)$ should track rollout probability conservatively. Test whether adding margin $\\delta$ predictably shifts the cliff downward by approximately $\\delta$.",
 "math_summary": "Let the stochastic closed-loop system be $x_{k+1}=F(x_k,u_k,w_k)$, with policy $u_k=\\pi_\\phi(x_k)$ and disturbance $w_k\\sim P(\\cdot\\mid x_k)$. Let $T$ be the target set, $U$ the unsafe set, and $C$ the continuation region, typically $C=S\\setminus(T\\cup U)$ where $S$ is the safe region. Let $B_\\theta:S\\to\\mathbb{R}_{\\ge 0}$ be a neural barrier. A sufficient supermartingale certificate for failure probability at most $q$ is $B_\\theta(x)\\le q-\\delta$ for every $x$ in the compact initial set $X_0$, $B_\\theta(x)\\ge 1$ for every $x\\in U$, $B_\\theta(x)=0$ on $T$, and $\\mathbb{E}[B_\\theta(x_{k+1})\\mid x_k=x]\\le B_\\theta(x)-\\delta$ or, for the weaker infinite-horizon condition, $\\mathbb{E}[B_\\theta(x_{k+1})\\mid x_k=x]\\le B_\\theta(x)$ for all $x\\in C$. Here $\\delta\u003e0$ is a uniform certificate margin and $q=1-p$ for desired reach-avoid probability $p$. Optional stopping gives $\\Pr_x(\\text{hit }U\\text{ before }T)\\le B_\\theta(x)$ and hence $\\Pr_x(\\text{hit }T\\text{ before }U)\\ge 1-B_\\theta(x)\\ge p+\\delta$ on $X_0$. The paper's converse result says that, under continuous transitions, compact $X_0$, and a strict uniform probability margin, a barrier-like object of this type exists whenever the uniform reach-avoid specification is true; the neural approximation is the implementation hypothesis to test.",
 "math_tags": [
  "control-theory",
  "dynamical-systems",
  "probability",
  "optimization"
 ],
 "ml_areas": [
  "rl",
  "world-model",
  "training-dynamics",
  "regularization"
 ],
 "paper": {
  "arxiv_id": "2608.30318",
  "arxiv_url": "https://arxiv.org/abs/2608.30318",
  "summary_what_math_gives_to_ml": "The paper provides a constructive converse mechanism: for a continuous stochastic discrete-time system, a uniform strict reach-avoid probability margin over a compact initial set implies the existence of a barrier-like certificate satisfying a supermartingale drift condition and boundary inequalities. This is transferable to neural networks as a learned stochastic safety barrier or value certificate, rather than merely as a post-hoc verifier. The key engineering asset is the quantitative uniform margin: training should seek a certificate with slack, and empirical falsification should search for violations of the drift and boundary inequalities. A successful implementation predicts that certificate feasibility changes sharply when the requested probability threshold crosses the worst-case reach-avoid probability over the initial set.",
  "title": "Converse Barrier Certificates for Set-Based Stochastic Reach-Avoid Verification",
  "year": "2026"
 },
 "ratings": {
  "difficulty": 6,
  "novelty": 6,
  "usefulness": 8
 },
 "solves": [
  "stability",
  "accuracy",
  "generalization"
 ],
 "title": "Uniform Stochastic Barrier Critic",
 "url": "https://synthcore.org/idea/2884/uniform-stochastic-barrier-critic",
 "verification": {
  "benchmark": {
   "track": "dynamics",
   "model": "rnn_small",
   "n_seeds": 8,
   "metric_direction": "lower is better",
   "comparison": {
    "baseline_mean": 0.000540327702765353,
    "idea_mean": 0.000540327702765353,
    "delta_mean": 0,
    "per_seed_diffs": [
     0,
     0,
     0,
     0,
     0,
     0,
     0,
     0
    ],
    "idea_wins": 0,
    "n_pairs": 8,
    "p_value": 1,
    "mde": 0,
    "mde_rel_pct": 0,
    "verdict": "no measurable effect",
    "system_worked": false
   },
   "baseline": {
    "best_cfg": {
     "lr": 0.01,
     "weight_decay": 0
    },
    "sweep": [
     {
      "cfg": {
       "lr": 0.001,
       "weight_decay": 0
      },
      "mean": 0.00222656229743734
     },
     {
      "cfg": {
       "lr": 0.001,
       "weight_decay": 0.0001
      },
      "mean": 0.002201732073444873
     },
     {
      "cfg": {
       "lr": 0.003,
       "weight_decay": 0
      },
      "mean": 0.0012092416291125119
     },
     {
      "cfg": {
       "lr": 0.003,
       "weight_decay": 0.0001
      },
      "mean": 0.0011863615218317136
     },
     {
      "cfg": {
       "lr": 0.01,
       "weight_decay": 0
      },
      "mean": 0.0006035602564224973
     },
     {
      "cfg": {
       "lr": 0.01,
       "weight_decay": 0.0001
      },
      "mean": 0.0006214260865817778
     }
    ],
    "full": {
     "mean": 0.000540327702765353,
     "std": 0.00010833688702413184,
     "per_seed": [
      0.0005864710547029972,
      0.0004609658499248326,
      0.000695098948199302,
      0.0006717051728628576,
      0.0005945063894614577,
      0.00035726596252061427,
      0.0004858067259192467,
      0.0004708015185315162
     ],
     "n": 8
    }
   },
   "idea": {
    "mean": 0.000540327702765353,
    "std": 0.00010833688702413184,
    "per_seed": [
     0.0005864710547029972,
     0.0004609658499248326,
     0.000695098948199302,
     0.0006717051728628576,
     0.0005945063894614577,
     0.00035726596252061427,
     0.0004858067259192467,
     0.0004708015185315162
    ],
    "n": 8
   },
   "mechanism_signature": {
    "confirmed": false,
    "heldout_mean_drift": 0.00018507556751501397,
    "margin": 0.02,
    "predicted_mean_drift": 0.00018591515208754572,
    "prediction": "training enforces nonpositive expected barrier drift on continuation states; held-out drift should be lower than zero"
   },
   "custom_track": null
  },
  "mechanism_confirmed": false,
  "peer_reviewed": false,
  "practical_verdict": "no_effect",
  "stage1_mechanism_check": {
   "worked": true,
   "confidence": 8,
   "verdict": "Built a stochastic 1D reach-avoid barrier MVP with an exact Bellman LP oracle, Monte Carlo expectation estimation, rollout validation, and a CUDA neural-critic comparison. The mechanism manifested: the required initial barrier increased approximately linearly with slack (slope 15.96) until a feasibility cliff between delta=0.03 and 0.04, while Monte Carlo error scaled as M^-0.511 versus the predicted M^-0.5. The neural idea improved boundary fitting and reduced initial-set values versus the baseline, but its maximum drift residual remained positive (0.217), so it was not a valid finite-sample certificate and did not demonstrate a reliable safety win.",
   "metrics": {
    "baseline": "Neural task/boundary fit: loss 0.3060, max initial B 0.2222, boundary RMSE 0.1438, max drift residual 0.2871",
    "idea": "Margin/drift critic: loss 8.0592, max initial B 0.00948, boundary RMSE 0.000114, max drift residual 0.2173; exact LP margin slope 15.96 and MC error exponent -0.511"
   },
   "how_to_run": "python3 barrier_experiment.py",
   "files": [
    "barrier_experiment.py",
    "results.json"
   ],
   "limitations": "Only a 1D additive-noise system and grid/quadrature transition model were tested; no learned dynamics, policy optimization, adversarial state search, high-dimensional neural barriers, held-out disturbance certificate, or statistically powered distribution-shift evaluation was performed."
  },
  "status": "failed_benchmark",
  "status_label": "Failed on benchmark",
  "updated_at": "2026-09-02T00:20:00",
  "verdict_source": "deterministic test code (paired-seed permutation statistics)"
 }
}
