# spectralsequences/sseq architecture

> Architecture diagram of the GitHub repository spectralsequences/sseq, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/spectralsequences/sseq
- Repository: https://github.com/spectralsequences/sseq

## Overview

Main Components to Include:

##### Core Libraries Layer
- `ext`: The foundational library for Ext computations over Fp algebra
- `fp`: Core finite field computations
- `algebra`: Mathematical algebra implementations
- `sseq`: Spectral sequence computations
- `bivec`: Supporting vector operations

##### Language Bindings Layer
- Python bindings (`python_ext`)
- WebAssembly bindings (for web interfaces)

##### Web Interface Layer
- `web_ext/sseq_gui`: Interactive GUI for Adams spectral sequence
- `web_ext/steenrod_calculator`: Steenrod algebra calculator
- `chart`: General spectral sequence interface

##### Supporting Components
- Message passing system (`message_passing_tree`)
- REPL interface
- WebSocket-based communication

##### Use a layered architecture approach
- [Web Interfaces Layer]
- ↑
- [Language Bindings Layer]
- ↑
- [Core Libraries Layer]

##### Component Relationships
- WebAssembly compilation paths
- WebSocket connections for real-time updates

Key Elements to Highlight:

##### Mathematical Core
- [ext] ← → [algebra] ← → [fp]
- ↓
- [sseq]

##### Web Interface Stack
- [Browser] ← → [WebAssembly] ← → [Core Libraries]
- ↓
- [WebSocket] ← → [Python REPL]

##### Integration Points
- How Python bindings interface with core libraries
- WebAssembly compilation pipeline
- Demonstrate message passing architecture

Special Considerations:

##### Mathematical Processing
- Flow of algebraic computations
- Where Steenrod algebra calculations occur
- Spectral sequence computation paths

##### Real-time Interaction
- WebSocket communication for live updates
- How user interactions propagate through the system
- Demonstrate differential propagation paths

##### Data Flow
- Serialization points between components
- Where mathematical results are transformed for display
- Caching and optimization points

Implementation Details:

##### Use standardized symbols
- Rectangles: Major components

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef core fill:#b3d1ff,stroke:#333
    classDef web fill:#90EE90,stroke:#333
    classDef binding fill:#FFB347,stroke:#333
    classDef support fill:#D3D3D3,stroke:#333
    classDef display fill:#E6E6FA,stroke:#333
    classDef test fill:#FFE4E1,stroke:#333

    subgraph CoreLibraries["Core Libraries Layer"]
        ExtLib["Ext Library"]:::core
        FPLib["Finite Field Library"]:::core
        AlgLib["Algebra Library"]:::core
        SSLib["Spectral Sequence Library"]:::core
        BVLib["Vector Operations"]:::core

        ExtLib --> AlgLib
        AlgLib --> FPLib
        AlgLib --> SSLib
        BVLib --> SSLib
    end

    subgraph LanguageBindings["Language Bindings Layer"]
        PyBind["Python Bindings"]:::binding
        WasmBind["WebAssembly Bindings"]:::binding
    end

    subgraph WebInterface["Web Interface Layer"]
        SSGUI["Spectral Sequence GUI"]:::web
        SteenCalc["Steenrod Calculator"]:::web
        ChartInt["Chart Interface"]:::web
    end

    subgraph SupportComponents["Supporting Components"]
        MsgPass["Message Passing System"]:::support
        REPL["REPL Interface"]:::support
        WSComm["WebSocket Communication"]:::support
    end

    subgraph DisplayComponents["Display Components"]
        ChartDisp["Chart Display"]:::display
        DispBack["Display Backend"]:::display
        JSInt["JavaScript Interface"]:::display
    end

    subgraph TestInfra["Testing Infrastructure"]
        PyTest["Python Tests"]:::test
        CoreTest["Core Tests"]:::test
        WebTest["Web Tests"]:::test
    end

    %% Inter-component relationships
    CoreLibraries --> LanguageBindings
    LanguageBindings --> WebInterface
    LanguageBindings --> SupportComponents
    WebInterface --> DisplayComponents
    SupportComponents --> DisplayComponents
    
    %% Click events for component mapping
    click ExtLib "https://github.com/SpectralSequences/sseq/tree/master/ext/crates/algebra/"
    click FPLib "https://github.com/SpectralSequences/sseq/tree/master/ext/crates/fp/"
    click AlgLib "https://github.com/SpectralSequences/sseq/tree/master/ext/crates/algebra/"
    click SSLib "https://github.com/SpectralSequences/sseq/tree/master/ext/crates/sseq/"
    click BVLib "https://github.com/SpectralSequences/sseq/tree/master/ext/crates/bivec/"
    click PyBind "https://github.com/SpectralSequences/sseq/tree/master/python_ext/"
    click WasmBind "https://github.com/SpectralSequences/sseq/tree/master/web_ext/"
    click SSGUI "https://github.com/SpectralSequences/sseq/tree/master/web_ext/sseq_gui/"
    click SteenCalc "https://github.com/SpectralSequences/sseq/tree/master/web_ext/steenrod_calculator/"
    click ChartInt "https://github.com/SpectralSequences/sseq/tree/master/chart/chart/"
    click MsgPass "https://github.com/SpectralSequences/sseq/tree/master/chart/message_passing_tree/"
    click REPL "https://github.com/SpectralSequences/sseq/tree/master/chart/repl/"
    click WSComm "https://github.com/SpectralSequences/sseq/blob/master/chart/message_passing_tree/message_passing_tree/socket_channel.py"
    click ChartDisp "https://github.com/SpectralSequences/sseq/tree/master/chart/chart/display/"
    click DispBack "https://github.com/SpectralSequences/sseq/tree/master/chart/chart/display_backend/"
    click JSInt "https://github.com/SpectralSequences/sseq/tree/master/chart/chart/javascript/"
    click PyTest "https://github.com/SpectralSequences/sseq/tree/master/python_ext/test/"
    click CoreTest "https://github.com/SpectralSequences/sseq/tree/master/ext/tests/"
    click WebTest "https://github.com/SpectralSequences/sseq/tree/master/web_ext/sseq_gui/tests/"

    %% Legend
    subgraph Legend
        CoreComp["Core Component"]:::core
        WebComp["Web Component"]:::web
        BindComp["Binding Component"]:::binding
        SuppComp["Support Component"]:::support
        DispComp["Display Component"]:::display
        TestComp["Test Component"]:::test
    end
```
