Commit graph

2 commits

Author SHA1 Message Date
openresearch
62399d035d fix(pipeline): positional chirality — permutation, not negation
BREAKING FIX: chiral implementation was modeling negation (S-a vs a-S),
which is a ring automorphism and preserves all Sidon structure (proven
in CHIRAL_INVARIANCE_GENERALIZED.md).

The user's chiral implementation is POSITIONAL: the chiral config
permutes which label goes to which strand position. Each position
has its own modulus. A permutation is NOT a ring automorphism —
different label-to-modulus mappings CAN produce different Sidon
results.

Changed _embed_chiral → _embed_chiral_positional:
- chiral[j]=0: strand j stays in position j
- chiral[j]=1: strand j swaps with strand j+1
- Multiple swaps compose into a full permutation
- The permutation changes which label pairs with which modulus
- This BREAKS the chiral invariance (permutations ≠ ring automorphisms)

Both SidonFilter and DualQuaternionSidonFilter updated to use
positional chirality.
2026-07-04 20:51:39 +00:00
openresearch
d9e465fb91 feat: pipeline_core.py — module-swappable six-stage engine
Standard Filter interface: each stage is apply(configs, ctx) → configs.
Stages swappable without rewriting the pipeline. No floats (Q16_16 raw).
No native_decide.

Default stages:
  BraidStorm(k) → TreeBraid → AngrySphinx(budget) →
  MultisurfacePacker(surfaces) → COUCHFilter → SidonFilter

Swappable Sidon filters:
  - SidonFilter: CRT sum-based (chiral-invariant, proven)
  - DualQuaternionSidonFilter: dual quaternion product-based
    (chiral-discriminating — multiplication is NOT negation-invariant)

Usage:
  pipe = Pipeline([BraidStorm(k=8), TreeBraid(), ...,
                   DualQuaternionSidonFilter()])
  result = pipe.run(labels, S, moduli)

Or via CLI:
  python3 pipeline_core.py --filter crt   # CRT sum filter
  python3 pipeline_core.py --filter dq    # Dual quaternion filter

To add custom filter:
  class MyFilter(Filter):
      def apply(self, configs, ctx): ...
      @property
      def name(self): return 'MyFilter'
2026-07-04 20:43:27 +00:00