# code/attack/: closing 48–50 and 53–60 (from the run's attack agent)

The heavy-reasoning agent's code, copied as it ran. Build with `c++ -O2 -o X X.cpp`.

- `split3c.cpp`: the exact per-split maximum M(a,b,c) for a cut that splits a
  layout a + b + c with a ≥ 22. Any layout with L ≥ t needs L1 ≥ t − g(a) − g(c)
  − min(ab,bc,ca) (likewise L2), so it lists those S1 (one per class under an
  affine map applied to all three slices at once, `cands3.cpp` + `canon.cpp`)
  and S2 (up to translation), and chooses S0 = H0 \ R optimally over every R.
  `./split3c a b c t [reps-file]`.
- `close.py n t`: reruns the counting feasibility (`deeper.py`, `bound.py`),
  takes the phantom's tightest split with a ≥ 22, computes M(p) with
  `split3c`, removes it if M(p) < t, and repeats until infeasible or stuck.
  Logs: `out/close_5*.txt`, `out/killed_*.txt`.
- `split3d.cpp` (from split3c, by the main session): two sharper facts for the
  kill decision. Every point of a third has at least b + c − 27 representations
  y + z, so the |R| missing points cost at least |R|(b + c − 27) crossing sets,
  which raises the thresholds on L1 and L2. And a pair whose best case (the |R|
  smallest r(−q)) can't reach t is skipped. `./split3d a b c t reps-file|- part parts`.
  `close3d.py n t` is close.py running split3d in 10 parallel parts. Logs:
  `out/close_52c.txt` (52 cards: at most 305) and `out/close_51c.txt`,
  `out/split3d_51_23_14_14.txt` (51 cards: at most 289).
- `split3e.cpp`, `close3d_shape.py`: the same, counting only layouts with no
  whole hyperplane, and with 27-card parts excluded from the counting. Log
  `out/shape_41_44.txt`: every best layout of 41–44 cards contains a whole
  hyperplane.
- `caps.cpp`: every cap (set-free layout) up to symmetry, by size
  (`out/caps_out.txt`).
- `ext.cpp`: the fewest sets in the 19-card cap plus t more cards, t = 1..8:
  0, 3, 6, 8, 10, 13, 16, 19. Since m cards with at most m − 19 sets contain a
  19-card cap, the fewest sets among m = 21..27 cards is m − 18.
- `ext2.cpp`: 28 cards with at most 14 sets would contain a largest cap C of
  14–20 cards with every other card on a set through two cards of C; it finds
  none (`out/ext2_m28_*.txt`), so 28 cards hold at least 15 sets.
- `bound2.py`, `identity_check.py`, `sa.cpp`, `verify_sa.py`: a pigeonhole
  strengthening of the crossing bound, the identities on random sets, and the
  agent's own annealing.
