{
 "artifacts": [
  {
   "name": "bench_farkas.py",
   "url": "https://synthcore.org/code/1053/bench_farkas.py"
  },
  {
   "name": "bench_report.json",
   "url": "https://synthcore.org/code/1053/bench_report.json"
  },
  {
   "name": "report.md",
   "url": "https://synthcore.org/code/1053/report.md"
  },
  {
   "name": "report_bench_2026-09-01T231554.md",
   "url": "https://synthcore.org/code/1053/report_bench_2026-09-01T231554.md"
  },
  {
   "name": "results.json",
   "url": "https://synthcore.org/code/1053/results.json"
  },
  {
   "name": "shield_experiment.py",
   "url": "https://synthcore.org/code/1053/shield_experiment.py"
  }
 ],
 "category": "architecture",
 "description": "Insert a constraint-reduction layer between a policy network and its executed action. The policy proposes an action, while the layer retains only geometrically extreme collision and obstacle constraints and verifies that every discarded halfspace is implied by the retained ones through nonnegative conic multipliers. The reduced projection or quadratic program is therefore equivalent to the full tightened safety filter whenever certification succeeds, but uses substantially fewer constraints.",
 "download_zip": "https://synthcore.org/download/1053",
 "formulas_latex": [
  "$$\\mathcal{U}_{\\mathrm{full}}=\\bigcap_{j=1}^{M}\\{u:a_j^\\top u\\le b_j\\},\\qquad \\mathcal{U}_{R}=\\bigcap_{k\\in R}\\{u:a_k^\\top u\\le b_k\\}.$$",
  "$$a_j=\\sum_{k\\in R}\\lambda_{jk}a_k,\\quad \\lambda_{jk}\\ge0,\\quad b_j\\ge\\sum_{k\\in R}\\lambda_{jk}b_k\\ \\Longrightarrow\\ \\mathcal{U}_{R}\\subseteq H_j.$$",
  "$$z=u-u_{\\mathrm{nom}},\\qquad \\beta_j=b_j-a_j^\\top u_{\\mathrm{nom}},\\qquad a_j^\\top z\\le\\beta_j.$$",
  "$$\\Delta_R=\\max_r(\\theta_{r+1}-\\theta_r),\\quad \\theta_{m+1}=\\theta_1+2\\pi;\\qquad \\text{use two extremes if }\\Delta_R\u003c\\pi,\\text{ otherwise initialize with three constraints.}$$"
 ],
 "id": 2736,
 "implementation": "1. Exact integration point: use this as an action-shield module after a policy network in multi-agent reinforcement learning, or as the final safety projection for a graph neural network controller. At each state, construct pairwise agent-agent and agent-obstacle linearized safety inequalities in the action $u$ and include a tube margin representing bounded model error or disturbance. Keep the neural policy output $u_{\\mathrm{nom}}$ whenever it satisfies the full inequalities; otherwise solve $\\min_u\\|u-u_{\\mathrm{nom}}\\|_2^2$ subject only to retained constraints. 2. Pseudocode: build $(a_j,b_j)$; normalize each $a_j$ and sort its angle; initialize $R$ with angular extremes, or three constraints if the circular angular gap is not strictly below $\\pi$; for every $j\\notin R$, solve for nonnegative $\\lambda_{jk}$ using a closed-form two-vector representation in two dimensions or nonnegative least squares in higher dimensions; if the residual $\\|a_j-\\sum_k\\lambda_{jk}a_k\\|$ or offset violation $\\sum_k\\lambda_{jk}b_k-b_j$ exceeds tolerance, add $j$ to $R$ and repeat. 3. Computed from the paper: halfspace containment, cone coverage, nominal preservation, and the certification logic. Estimated empirically: model-error or tube radius, numerical tolerances, and average retained count. 4. First cheap experiment: use a two-dimensional point-mass or double-integrator simulator with 10 agents and 4 obstacles, comparing a full quadratic-program shield, the reduced shield, and an uncertified policy. Sweep constraint count and prediction horizon. The quantitative prediction is that every certified reduced feasible set is contained in the full set, so the reduced shield must produce zero false-safe actions relative to the full shield; nominal accept/reject decisions should match up to solver tolerance. The retained constraint fraction should decrease as the number of constraints or horizon increases, and runtime should scale with retained rather than total constraints. Measure certification failure, action disagreement, safety violations, and runtime; target disagreement and violation rates below $10^{-6}$ in deterministic arithmetic and at least a twofold speedup at 100 or more constraints.",
 "math_summary": "At one state and prediction stage, represent every tightened safety condition as a halfspace $H_j=\\{u\\in\\mathbb{R}^d:a_j^\\top u\\le b_j\\}$, where $u$ is the neural action, $a_j$ is the constraint normal, and $b_j$ includes nominal dynamics and tube-tightening margins. Let $R$ be the retained index set. An omitted constraint $j\\notin R$ is certified redundant if there exist multipliers $\\lambda_{jk}\\ge0$ for $k\\in R$ such that $a_j=\\sum_{k\\in R}\\lambda_{jk}a_k$ and $b_j\\ge\\sum_{k\\in R}\\lambda_{jk}b_k$. Any action satisfying all retained inequalities then satisfies the omitted inequality, proving $\\mathcal{U}_R\\subseteq\\mathcal{U}_{\\mathrm{full}}$. For a nominal-aware implementation, define $z=u-u_{\\mathrm{nom}}$ and $\\beta_j=b_j-a_j^\\top u_{\\mathrm{nom}}$; certify $a_j^\\top z\\le\\beta_j$. If $u_{\\mathrm{nom}}$ satisfies every full constraint, then $z=0$ remains feasible in the reduced layer. In two dimensions, sort normalized normals by angle; begin with two extreme directions when all normals lie in a strict half-plane, otherwise begin with three directions and add candidates until all omitted constraints pass the certificate.",
 "math_tags": [
  "control-theory",
  "convex-analysis",
  "geometry",
  "linear-algebra",
  "optimization"
 ],
 "ml_areas": [
  "rl",
  "moe-routing",
  "graph-nn",
  "training-dynamics"
 ],
 "paper": {
  "arxiv_id": "2608.25323",
  "arxiv_url": "https://arxiv.org/abs/2608.25323",
  "summary_what_math_gives_to_ml": "The paper offers a constructive mechanism for reducing large collections of linear safety constraints while preserving a certified admissible control set: omitted halfspaces are proved redundant by nonnegative conic combinations of retained halfspaces using Farkas certificates. In planar input spaces, the retained set can be selected from extreme constraint directions using the largest angular gap, with escalation from two to three or more constraints when certification fails. The transferable neural-network design is a certified action-shield or differentiable safety layer for multi-agent reinforcement learning and learned controllers that prunes pairwise collision constraints before solving the final projection or quadratic program, while guaranteeing that the reduced layer accepts no unsafe action accepted by the full tightened layer.",
  "title": "Scalable Tube-Tightened Multi-Agent Safety via Certified Constraint Reduction",
  "year": "2026"
 },
 "ratings": {
  "difficulty": 5,
  "novelty": 7,
  "usefulness": 8
 },
 "solves": [
  "speedup",
  "stability",
  "accuracy"
 ],
 "title": "Farkas-Certified Neural Safety Shield",
 "url": "https://synthcore.org/idea/2736/farkas-certified-neural-safety-shield",
 "verification": {
  "benchmark": {
   "track": "dynamics",
   "model": "rnn_small",
   "n_seeds": 8,
   "metric_direction": "lower is better",
   "comparison": {
    "baseline_mean": 0.0001147401,
    "idea_mean": 0.0523780384,
    "delta_mean": 0.0522632983,
    "per_seed_diffs": [
     0.0408673346,
     0.0579108229,
     0.0539044855,
     0.0680913626,
     0.0551863386,
     0.0379699931,
     0.0531283936,
     0.0510476558
    ],
    "idea_wins": 0,
    "n_pairs": 8,
    "p_value": 0.0081,
    "mde": 0.007932782,
    "mde_rel_pct": 6913.6975,
    "verdict": "idea worse (significant)",
    "system_worked": false
   },
   "baseline": {
    "best_cfg": {
     "lr": 0.00665
    },
    "sweep": [
     {
      "cfg": {
       "lr": 0.001
      },
      "mean": 0.0009722943
     },
     {
      "cfg": {
       "lr": 0.002
      },
      "mean": 0.0006509074
     },
     {
      "cfg": {
       "lr": 0.003
      },
      "mean": 0.0004595853
     },
     {
      "cfg": {
       "lr": 0.004
      },
      "mean": 0.0003482927
     },
     {
      "cfg": {
       "lr": 0.005
      },
      "mean": 0.0002485937
     },
     {
      "cfg": {
       "lr": 0.00067
      },
      "mean": 0.0011799606
     },
     {
      "cfg": {
       "lr": 0.00134
      },
      "mean": 0.0008329209
     },
     {
      "cfg": {
       "lr": 0.00268
      },
      "mean": 0.0005083114
     },
     {
      "cfg": {
       "lr": 0.00402
      },
      "mean": 0.0003466854
     },
     {
      "cfg": {
       "lr": 0.00536
      },
      "mean": 0.0002244893
     },
     {
      "cfg": {
       "lr": 0.00665
      },
      "mean": 0.0001395188
     }
    ],
    "full": {
     "mean": 0.0001147401,
     "std": 0.000040269,
     "per_seed": [
      0.0001932993,
      0.000143844,
      0.0000801379,
      0.0001407938,
      0.0001187587,
      0.0000825471,
      0.000063313,
      0.0000952268
     ],
     "n": 8
    }
   },
   "idea": {
    "mean": 0.0523780384,
    "std": 0.008875649,
    "per_seed": [
     0.041060634,
     0.058054667,
     0.0539846234,
     0.0682321563,
     0.0553050973,
     0.0380525403,
     0.0531917065,
     0.0511428826
    ],
    "n": 8
   },
   "mechanism_signature": {
    "certificate_max_offset_violation": 0,
    "certificate_max_residual": 0,
    "confirmed": true,
    "constraint_count_full": 64,
    "constraint_count_retained": 2,
    "full_reduced_decision_disagreement": 0,
    "full_reduced_max_output_difference": 0,
    "predicted_zero_disagreement_observed": true,
    "retained_fraction": 0.03125,
    "trained_test_samples": 400
   },
   "custom_track": null
  },
  "mechanism_confirmed": true,
  "peer_reviewed": false,
  "practical_verdict": "harms",
  "stage1_mechanism_check": {
   "worked": true,
   "confidence": 8,
   "verdict": "Built a readable 2-D Farkas-certified constraint reducer and Euclidean safety projection in shield_experiment.py. The mechanism manifested: for pointed cones, retained constraints stayed at 2 as M increased from 4 to 64, projection error and nominal decision disagreement were both 0, and 10,000 random containment checks found 0 false-safe samples with certificate residual below 7e-16. The angular sweep showed reduced compression as normals approached or spanned a half-plane boundary, while full-circle constraints retained all facets. Reduced projection was 33x–1848x faster in this toy projection benchmark, although certification cost and realistic QP solver overhead were not included.",
   "metrics": {
    "baseline": "Full 2-D projection over M constraints retained all M constraints. Runtime for M=16,32,64,128 was 0.0965, 0.3375, 1.3994, and 7.6960 seconds.",
    "idea": "Certified reduction on pointed cones retained 2/4, 2/8, 2/16, 2/32, and 2/64 constraints with zero sampled projection error and 100% decision agreement. Reduced runtimes were 0.00295, 0.00260, 0.00274, and 0.00417 seconds, giving speedups of 32.7x, 129.8x, 511.0x, and 1847.5x. The half-plane sweep retained 2/32 at spreads 0.5 and 1.2, 21/32 at 1.55, 28/32 at 1.7, and 32/32 at 2.4."
   },
   "how_to_run": "python3 shield_experiment.py \u003e results.json",
   "files": [
    "shield_experiment.py",
    "results.json"
   ],
   "limitations": "This is a deterministic 2-D synthetic halfspace experiment, not a neural policy, multi-agent simulator, double-integrator, or learned RL benchmark. The projection solver is a small active-set enumerator rather than a production QP solver; timing excludes reduction and certification overhead and uses deliberately redundant offsets, so the speedups are mechanism-level rather than end-to-end claims."
  },
  "status": "mech_ok_no_baseline",
  "status_label": "Mechanism confirmed, baseline not beaten",
  "updated_at": "2026-09-01T23:15:54",
  "verdict_source": "deterministic test code (paired-seed permutation statistics)"
 }
}
