Commit graph

4 commits

Author SHA1 Message Date
Maximus Gorog
c51e3274f9 Stage 2 complete: Construction 17 validated on real 3D data
Zigzag engine (6802 lines, 184 tests):
- Construction 17 normalisation: working through dimension 3+
- Import from homotopy-rs JSON: working (scalar, two_scalars, half_braid)
- Piece extraction via Embedding/restrict_diagram: working
- Type checking pipeline: working (Eckmann-Hilton half_braid passes)
- Essential identity detection: validated with full 2-diagram test

Bugs found and fixed:
- assemble_factorisations losing cospan legs during reassembly
- RewriteN::slice() using source offsets instead of target indices
- singular_preimage() not handling passthrough heights
- restrict_rewrite() not accounting for accumulated cone offsets
- Embedding::preimage() using regular_preimage for Singular case

Added vis-engine-spec.md: visualization engine specification
- 6-layer architecture from math primitives to scene graph
- SVG renderer for 2D, WebGL2 for 3D, custom hit testing
- Spring constraint integration point for semiotic rendering
- No external dependencies - game engine approach

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-09 05:26:15 -06:00
Maximus Gorog
5454c02328 Fix explosion.rs over-approximation: use cospan rewrite data for correct covering relations
- Replace all-to-all sub-poset connection with rewrite-based correspondence
- Add compute_subpoint_correspondence() using cone structure for 3 cases:
  identity (1-to-1), contraction (many-to-one), insertion (index shift)
- Add compute_height_maps() for singular and regular height tracking
- Covering relations reduced from 114 to 35 for half_braid (69% reduction)
- Surface 3 (r0,s0,r0): 9 spurious successors → 3 correct successors
- 175 tests passing, 0 failures
- Regenerated fixtures/half_braid_geometry.json with corrected boundaries

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-08 00:54:18 -06:00
Maximus Gorog
02d23cf554 Implement normalisation algorithm (Construction 17)
Complete implementation of the zigzag normalisation algorithm from the
LICS 2022 paper "Zigzag normalisation for associative n-categories".

Key changes:
- diagram.rs: Add DiagramMap composition, singular_map extraction
- degeneracy.rs: Add extract_singular_map() and height checking functions
- normalise.rs: Complete Construction 17 with essential identity detection

The algorithm:
1. Recursively normalise at each regular height
2. Recursively normalise at each singular height with cospan leg composites
3. Assemble into intermediate diagram P
4. Remove trivial cospans (ONLY if identity AND not in sink image)
5. Compose degeneracies: d = dP ∘ dS

Critical: In dimension >= 4, some identity cospans are ESSENTIAL and must
be preserved if they are in the image of any sink map.

All 57 tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 03:24:30 -06:00
Maximus Gorog
cd4b951f78 Scaffold zigzag-engine library
Initial structure implementing the zigzag construction for associative
n-categories (LICS 2022 paper). Includes:

- monotone.rs: MonotoneMap with Wraith's R equivalence (complete)
- zigzag.rs: Zigzag<T>, ZigzagMap<S> with composition
- diagram.rs: Diagram, DiagramN, Cospan, Rewrite, Cone types
- signature.rs: Generator, Signature (complete)
- degeneracy.rs: Degeneracy detection stubs
- normalise.rs: Construction 17 algorithm structure
- typecheck.rs: Type checking against signatures
- explosion.rs: k-points and Poset for layout
- layout.rs: SpringConstraint API surface

All 33 unit tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-07 02:42:06 -06:00