**STATUS: REJECTED** — moved to failed/ on 2026-07-04
**Reason:** Pipeline throughput numbers (256→128→64→...) are GUESSES, not measured; the chiral-invariance finding (C3 run 019f2f07) kills the core premise that chiral permutations yield distinct channels.
**Receipt:** C3 run 019f2f07 — all chiral configs identical; pipeline reductions collapse to a single channel.

---

# BraidStorm × TreeBraid × COUCH: Chiral Batch Pipeline

**Status:** DESIGN — connects existing SilverSight components to chiral batch encoding
**Date:** 2026-07-04
**Depends on:** `DUAL_QUATERNION_SIDON_FILTER.md`, `CHIRAL_BATCH_ENCODING.md`,
`BraidEigensolid.lean`, `GCCL.lean`, `braid_group_action.md`
**Components:**
- BraidStorm = `formal/CoreFormalism/BraidEigensolid.lean` (8-strand, Sidon labels)
- TreeBraid = tree-organized braid (factorizes crossing space)
- COUCH = `formal/SilverSight/GCCL.lean` `couchStable` gate (moving sofa constraint)

---

## 1. The Three Components

### 1.1 BraidStorm (BraidEigensolid.lean)

The 8-strand braid system:
```
BraidState = {
  strands: Fin 8 → BraidStrand,  -- 8 strands with Sidon labels
  step_count: Nat                 -- monotone counter
}
```

Sidon labels: {1, 2, 4, 8, 16, 32, 64, 128} (powers of 2, guaranteed Sidon).

Each crossing σ_i has chirality:
  σ_i⁺¹ = over-crossing (right-handed)
  σ_i⁻¹ = under-crossing (left-handed)

With k crossings in the braid word, there are 2^k chiral configurations.
For k=8 (one crossing per strand): 2^8 = 256 configurations in ONE braid structure.

### 1.2 TreeBraid (tree-organized braid)

From `ENHANCEMENT_PISSS_BRAID_INTEGRATION.md`:
  `BraidField.rgFlow` = fold of `betaStep` over spike train = tree braid
  `Mountain.merge` = tree node merge
  `MMR.append` = tree rebalancing

The TreeBraid factorizes the crossing space:
- Independent crossings = separate tree branches (can flip without affecting siblings)
- Dependent crossings = grouped in same subtree (must flip together)
- This means 256 configurations aren't flat — they're a TREE

Example: if crossings 1-4 are independent from crossings 5-8:
  Tree: [σ₁ σ₂ σ₃ σ₄] [σ₅ σ₆ σ₇ σ₈]
  Each group has 2^4 = 16 chiral variants
  Total: 16 × 16 = 256, but factorized as 16 + 16 instead of 256

This is the KEY to batch encoding: the TreeBraid lets us process
independent groups separately, reducing the search from exponential
to polynomial in each group.

### 1.3 COUCH (GCCL.lean)

The COUCH gate in the Admit pipeline:
```
structure CandidateX where
  ...
  couchStable : Bool   -- pressure/hysteresis stability
  ...

Admit(X) = ... && X.couchStable && ...
```

COUCH checks: "is the candidate's Omega in the stable range?"
= "can the shape navigate the corridor?" (moving sofa constraint)
= "apartment constraint x_i(t) ∈ Ω satisfied?"

COUCH IS the geometric filter: it rejects chiral configurations
where the sofa can't make the turn.

---

## 2. The Batch Pipeline

### 2.1 Flow

```
BraidStorm (8 strands, 256 chiral variants)
    ↓ generate all chiral configurations
TreeBraid (factorize into independent groups)
    ↓ process groups separately (polynomial, not exponential)
COUCH (geometric filter)
    ↓ reject configurations where sofa can't navigate
Sidon Filter (algebraic filter via dual quaternion products)
    ↓ select configurations with unique pairwise signatures
Output: structurally meaningful chiral configurations
```

### 2.2 What Each Stage Does

**Stage 1 — BraidStorm generates:**
- 8-strand braid with Sidon labels {1,2,4,8,16,32,64,128}
- Each crossing σ_i has chirality εᵢ ∈ {+1, -1}
- 2^8 = 256 chiral configurations encoded in ONE braid structure
- Each configuration = a different dual quaternion trajectory

**Stage 2 — TreeBraid factorizes:**
- Identifies independent crossing groups (tree branches)
- If crossings {1,2,3,4} are independent from {5,6,7,8}:
  - Process 2^4 = 16 variants per group separately
  - Total: 16 + 16 = 32 checks instead of 256
- The TreeBraid structure comes from the braid relations:
  - σ_i σ_j = σ_j σ_i when |i-j| ≥ 2 (independent)
  - σ_i σ_{i+1} σ_i = σ_{i+1} σ_i σ_{i+1} (dependent, Yang-Baxter)

**Stage 3 — COUCH filters:**
- For each factorized chiral configuration:
  - Check if the sofa shape can navigate the L-corridor
  - COUCH_stable = True if the motion is geometrically valid
  - COUCH_stable = False if the shape hits a wall
- This is the geometric filter from GCCL.lean

**Stage 4 — Sidon filter (dual quaternion):**
- For each COUCH-passing configuration:
  - Compute dual quaternion products q_i ⊛ q_j for all boundary pairs
  - Check Sidon: are all products distinct?
  - Sidon-clean = unique signatures (structurally meaningful)
  - Degenerate = collision (ambiguous, uninformative)
- This is the algebraic filter from DUAL_QUATERNION_SIDON_FILTER.md

### 2.3 Why This Is Hundreds per Run

The BraidStorm generates 256 configurations in ONE structure.
The TreeBraid factorizes them into independent groups.
COUCH + Sidon filter each group.

Total work: O(groups × 2^{group_size}) instead of O(2^k).
For 2 independent groups of 4: 2 × 16 = 32 instead of 256.
For 4 independent groups of 2: 4 × 4 = 16 instead of 256.

But we still TEST all 256 — the factorization just makes it faster.
The filter rate (what % pass COUCH + Sidon) is the research signal.

---

## 3. Connection to Dual Quaternions

### 3.1 Braid Crossing → Dual Quaternion

Each braid crossing σ_i^ε maps to a dual quaternion:
  σ_i⁺¹ → q_r rotation (poloidal, over-crossing)
  σ_i⁻¹ → q_r* conjugate rotation (poloidal, under-crossing)
  Translation along strand → q_d (toroidal)

The full braid word maps to a dual quaternion product:
  Q = q_{σ₁}^ε₁ · q_{σ₂}^ε₂ · ... · q_{σₖ}^εₖ

### 3.2 COUCH as Dual Quaternion Stability

COUCH_stable checks if the dual quaternion trajectory stays
within the "corridor" — i.e., the translation component q_d
doesn't push the shape outside the L-corridor.

In dual quaternion terms:
  COUCH_stable ⟺ |q_d(t)| < corridor_width for all t
  (the translation magnitude stays within the corridor)

### 3.3 Sidon Filter on Dual Quaternion Products

For each COUCH-passing configuration:
- Compute Q_{ij} = q_i ⊛ q_j for all boundary pairs (i,j)
- Sidon-clean: all Q_{ij} distinct (unique interaction signatures)
- Degenerate: some Q_{ij} = Q_{kl} (ambiguous interactions)

The dual quaternion product captures BOTH rotation and translation
simultaneously — no tolerance band needed (algebraic equality, not metric).

---

## 4. Implementation Plan

### Phase 1: BraidStorm Chiral Batch (Python)

```python
def braidstorm_chiral_batch(labels, S, moduli, braid_word):
    """Batch-test all chiral configurations of a braid word.
    
    labels: Sidon labels [1,2,4,8,16,32,64,128]
    S: reflection point
    moduli: [L0, L1, ..., L7] (8 moduli, one per strand)
    braid_word: [(strand_i, strand_j), ...] — which strands cross
    
    Returns: list of (chiral_config, is_sidon, sidon_score)
    """
    k = len(braid_word)
    configs = list(product([0, 1], repeat=k))  # 2^k configurations
    
    # Identity components (computed once)
    id_comps = [a % moduli[0] for a in labels]
    
    results = []
    for config in configs:
        embedded = []
        for a in labels:
            row = [a % moduli[0]]
            for j, (si, sj) in enumerate(braid_word):
                Lj = moduli[j + 1]
                if config[j] == 0:
                    row.append((S - a) % Lj)  # over
                else:
                    row.append((a - S) % Lj)  # under
            embedded.append(row)
        
        sidon = sidon_check(embedded, moduli)
        results.append((config, sidon["is_sidon"], sidon["sidon_score"]))
    
    return results
```

### Phase 2: TreeBraid Factorization

```python
def treebraid_factorize(braid_word):
    """Factorize braid word into independent groups.
    
    Uses braid relations: σ_i σ_j = σ_j σ_i when |i-j| >= 2.
    Returns list of groups, each group is a list of crossing indices.
    """
    groups = []
    remaining = list(range(len(braid_word)))
    
    while remaining:
        group = [remaining[0]]
        for i in remaining[1:]:
            si, sj = braid_word[i]
            # Check if crossing i is independent of all in group
            independent = True
            for j in group:
                gi, gj = braid_word[j]
                if abs(si - gi) < 2 or abs(si - gj) < 2 or \
                   abs(sj - gi) < 2 or abs(sj - gj) < 2:
                    independent = False
                    break
            if independent:
                group.append(i)
        for g in group:
            remaining.remove(g)
        groups.append(group)
    
    return groups
```

### Phase 3: COUCH + Sidon Pipeline

```python
def couch_sidon_pipeline(labels, S, moduli, braid_word, shape, motion):
    """Full pipeline: BraidStorm → TreeBraid → COUCH → Sidon.
    
    1. Generate all chiral configurations (BraidStorm)
    2. Factorize into independent groups (TreeBraid)
    3. Check COUCH stability (can shape navigate corridor?)
    4. Check Sidon property (unique dual quaternion products?)
    """
    # Stage 1+2: Batch + factorize
    groups = treebraid_factorize(braid_word)
    
    # Process each group independently
    all_results = []
    for group in groups:
        group_word = [braid_word[i] for i in group]
        group_configs = list(product([0, 1], repeat=len(group)))
        
        for config in group_configs:
            # Stage 3: COUCH — geometric filter
            # (check if shape can navigate with this chiral config)
            couch_ok = check_couch_stability(shape, motion, config)
            
            if not couch_ok:
                all_results.append({
                    "config": config, "group": group,
                    "couch_stable": False, "is_sidon": None,
                })
                continue
            
            # Stage 4: Sidon — algebraic filter
            sidon = check_sidon_chiral(labels, S, moduli, config)
            all_results.append({
                "config": config, "group": group,
                "couch_stable": True, "is_sidon": sidon["is_sidon"],
                "sidon_score": sidon["sidon_score"],
            })
    
    return all_results
```

---

## 5. What This Enables

### 5.1 Orders of Magnitude More Data

Current: 75 configurations per run (5 shapes × 3 n × 5 q)
With BraidStorm batch: 75 × 256 = 19,200 configurations per run
With TreeBraid factorization: process in 32-64 checks instead of 256
With COUCH pre-filter: only test Sidon on geometrically valid configs

### 5.2 The COUCH Gate as Pre-filter

COUCH is the CHEAP filter (geometric, O(1) per config).
Sidon is the EXPENSIVE filter (algebraic, O(n²) per config).

By running COUCH first:
- Reject geometrically invalid configs (sofa can't navigate)
- Only run Sidon check on COUCH-passing configs
- If 50% pass COUCH: 128 Sidon checks instead of 256

### 5.3 The TreeBraid as Search Space Reduction

The braid relations (σ_i σ_j = σ_j σ_i for |i-j| ≥ 2) mean many
chiral configurations are EQUIVALENT. The TreeBraid identifies
these equivalences and processes only unique configurations.

For a typical 8-strand braid:
- 256 raw configurations
- ~64-128 unique after TreeBraid factorization (estimated)
- ~32-64 pass COUCH
- ~10-20 pass Sidon

The final 10-20 configurations are the "structurally meaningful" ones.

---

## 6. Connection to the Moving Sofa

The COUCH gate's "apartment constraint" IS the moving sofa:
  x_i(t) ∈ Ω (shape stays in corridor)

The braid word describes the boundary point worldlines through the corner.
The chiral configurations describe different ways the boundary points
can cross (over/under) during the motion.

COUCH filters: which chiral configurations correspond to physically
realizable sofa motions (shape doesn't hit walls).

Sidon filters: which of those motions have unique boundary interactions
(no two pairs of boundary points produce the same dual quaternion product).

The COMBINED filter (COUCH ∧ Sidon) selects motions that are BOTH
geometrically valid AND structurally meaningful — these are the
configurations where the octagon principle could detect the sofa's
chromatic structure from the spectrum.

---

## 7. claim_boundary

```
braidstorm-treebraid-couch:batch-pipeline:design
```

This document connects three existing SilverSight components:
1. BraidStorm (8-strand, Sidon labels, chiral crossings) — generates 256 configs
2. TreeBraid (tree-organized, factorizes via braid relations) — reduces search
3. COUCH (GCCL gate, moving sofa constraint) — geometric pre-filter

Combined with the dual quaternion Sidon filter, this pipeline batch-processes
hundreds of chiral configurations per run, with COUCH as the cheap geometric
pre-filter and Sidon as the expensive algebraic filter.

The Hutter prize lesson applies: the batch doesn't COMPRESS 256 configs into 1
(conservation law blocks that). It FILTERS 256 configs down to the ~10-20
that are both geometrically valid and structurally meaningful.
