# furkankirat/structforge architecture

> Architecture diagram of the GitHub repository furkankirat/structforge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/furkankirat/structforge
- Repository: https://github.com/furkankirat/structforge

## Overview

StructForge is a .NET/Unity runtime library of allocation-conscious collections, spatial containers, and supporting enumeration and comparison utilities. Consumers use its collection APIs to store, query, traverse, and transform data; the README highlights zero-allocation enumeration, span access, packed bit arrays, and cache-friendly grids. The graph preserves the documented collection families and the sampled implementation links. Several capabilities are represented by their exact source files but were not inspected; their internal call relationships are therefore omitted.

Main entry points: [`StructForge/Extensions/SfEnumerableExtensions.cs`](https://github.com/furkankirat/structforge/blob/main/StructForge/Extensions/SfEnumerableExtensions.cs) (Enumerable conversions), [`StructForge/Collections/SfList.cs`](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfList.cs) (Dynamic list), [`StructForge/Collections/SfAvlTree.cs`](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfAvlTree.cs) (AVL tree), [`StructForge/Collections/SfDictionary.cs`](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfDictionary.cs) (Dictionary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_linear["Linear Collections"]
  node_list["Dynamic list<br/>[SfList.cs]"]
  node_linked["Linked list<br/>[SfLinkedList.cs]"]
  node_stack["Stack<br/>[SfStack.cs]"]
  node_queue["Queue<br/>[SfQueue.cs]"]
  node_ring["Ring buffer<br/>[SfRingBuffer.cs]"]
  node_dictionary["Dictionary<br/>[SfDictionary.cs]"]
  node_graph["Adjacency graph<br/>[SfGraph.cs]"]
end

subgraph group_spatial["Spatial Data"]
  node_grid2d["2D grid<br/>[SfGrid2D.cs]"]
  node_grid3d["3D grid<br/>[SfGrid3D.cs]"]
  node_bits["Bit array<br/>[SfBitArray.cs]"]
  node_bits2d["2D bit array<br/>[SfBitArray2D.cs]"]
  node_bits3d["3D bit array<br/>[SfBitArray3D.cs]"]
end

subgraph group_ordered["Trees and Sets"]
  node_avl["AVL tree<br/>[SfAvlTree.cs]"]
  node_sorted["Sorted set<br/>[SfSortedSet.cs]"]
  node_heap["Binary heap<br/>[SfBinaryHeap.cs]"]
  node_priority["Priority queue<br/>[SfPriorityQueue.cs]"]
  node_hashset["Hash set<br/>[SfHashSet.cs]"]
  node_enumset["Enum set<br/>[SfEnumSet.cs]"]
end

subgraph group_shared["Shared Runtime"]
  node_comparers["Comparer utilities<br/>[SfComparers.cs]"]
  node_equality["Equality comparers"]
  node_arrayenum["Array enumerator"]
  node_circenum["Circular enumerator"]
  node_extensions["Enumerable conversions"]
  node_throwhelper["Exception helpers<br/>[SfThrowHelper.cs]"]
end

node_consumer(("Library consumer"))

node_consumer -->|"uses collections"| node_list
node_stack -->|"stores in"| node_list
node_graph -->|"uses"| node_dictionary
node_graph -->|"uses"| node_list
node_bits3d -->|"uses"| node_bits
node_sorted -->|"backed by"| node_avl
node_priority -->|"wraps"| node_heap
node_enumset -->|"uses"| node_bits
node_avl -->|"compares with"| node_comparers
node_heap -->|"compares with"| node_comparers
node_sorted -->|"compares with"| node_comparers
node_dictionary -->|"uses"| node_equality
node_hashset -->|"uses"| node_equality
node_bits -->|"uses"| node_equality
node_list -->|"enumerates with"| node_arrayenum
node_queue -->|"enumerates with"| node_circenum
node_extensions -->|"converts to"| node_list
node_extensions -->|"converts to"| node_linked
node_extensions -->|"converts to"| node_queue
node_extensions -->|"converts to"| node_stack
node_extensions -->|"converts to"| node_avl
node_extensions -->|"converts to"| node_heap
node_extensions -->|"converts to"| node_sorted
node_avl -->|"throws via"| node_throwhelper
node_list -->|"throws via"| node_throwhelper
node_dictionary -->|"throws via"| node_throwhelper

click node_list "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfList.cs"
click node_linked "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfLinkedList.cs"
click node_stack "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfStack.cs"
click node_queue "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfQueue.cs"
click node_ring "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfRingBuffer.cs"
click node_dictionary "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfDictionary.cs"
click node_graph "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfGraph.cs"
click node_grid2d "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfGrid2D.cs"
click node_grid3d "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfGrid3D.cs"
click node_bits "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfBitArray.cs"
click node_bits2d "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfBitArray2D.cs"
click node_bits3d "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfBitArray3D.cs"
click node_avl "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfAvlTree.cs"
click node_sorted "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfSortedSet.cs"
click node_heap "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfBinaryHeap.cs"
click node_priority "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfPriorityQueue.cs"
click node_hashset "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfHashSet.cs"
click node_enumset "https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfEnumSet.cs"
click node_comparers "https://github.com/furkankirat/structforge/blob/main/StructForge/Comparers/SfComparers.cs"
click node_equality "https://github.com/furkankirat/structforge/blob/main/StructForge/Comparers/SfEqualityComparers.cs"
click node_arrayenum "https://github.com/furkankirat/structforge/blob/main/StructForge/Enumerators/SfArrayEnumerator.cs"
click node_circenum "https://github.com/furkankirat/structforge/blob/main/StructForge/Enumerators/SfCircularQueueEnumerator.cs"
click node_extensions "https://github.com/furkankirat/structforge/blob/main/StructForge/Extensions/SfEnumerableExtensions.cs"
click node_throwhelper "https://github.com/furkankirat/structforge/blob/main/StructForge/Helpers/SfThrowHelper.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_list,node_linked,node_stack,node_queue,node_ring,node_dictionary,node_graph toneBlue
class node_grid2d,node_grid3d,node_bits,node_bits2d,node_bits3d toneAmber
class node_avl,node_sorted,node_heap,node_priority,node_hashset,node_enumset toneMint
class node_comparers,node_equality,node_arrayenum,node_circenum,node_extensions,node_throwhelper toneRose
class node_consumer toneIndigo
```

## Components

### Linear Collections

- [Dynamic list](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfList.cs): `StructForge/Collections/SfList.cs`
- [Linked list](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfLinkedList.cs): `StructForge/Collections/SfLinkedList.cs`
- [Stack](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfStack.cs): `StructForge/Collections/SfStack.cs`
- [Queue](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfQueue.cs): `StructForge/Collections/SfQueue.cs`
- [Ring buffer](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfRingBuffer.cs): `StructForge/Collections/SfRingBuffer.cs`
- [Dictionary](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfDictionary.cs): `StructForge/Collections/SfDictionary.cs`
- [Adjacency graph](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfGraph.cs): `StructForge/Collections/SfGraph.cs`

### Spatial Data

- [2D grid](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfGrid2D.cs): `StructForge/Collections/SfGrid2D.cs`
- [3D grid](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfGrid3D.cs): `StructForge/Collections/SfGrid3D.cs`
- [Bit array](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfBitArray.cs): `StructForge/Collections/SfBitArray.cs`
- [2D bit array](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfBitArray2D.cs): `StructForge/Collections/SfBitArray2D.cs`
- [3D bit array](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfBitArray3D.cs): `StructForge/Collections/SfBitArray3D.cs`

### Trees and Sets

- [AVL tree](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfAvlTree.cs): `StructForge/Collections/SfAvlTree.cs`
- [Sorted set](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfSortedSet.cs): `StructForge/Collections/SfSortedSet.cs`
- [Binary heap](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfBinaryHeap.cs): `StructForge/Collections/SfBinaryHeap.cs`
- [Priority queue](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfPriorityQueue.cs): `StructForge/Collections/SfPriorityQueue.cs`
- [Hash set](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfHashSet.cs): `StructForge/Collections/SfHashSet.cs`
- [Enum set](https://github.com/furkankirat/structforge/blob/main/StructForge/Collections/SfEnumSet.cs): `StructForge/Collections/SfEnumSet.cs`

### Shared Runtime

- [Comparer utilities](https://github.com/furkankirat/structforge/blob/main/StructForge/Comparers/SfComparers.cs): `StructForge/Comparers/SfComparers.cs`
- [Equality comparers](https://github.com/furkankirat/structforge/blob/main/StructForge/Comparers/SfEqualityComparers.cs): `StructForge/Comparers/SfEqualityComparers.cs`
- [Array enumerator](https://github.com/furkankirat/structforge/blob/main/StructForge/Enumerators/SfArrayEnumerator.cs): `StructForge/Enumerators/SfArrayEnumerator.cs`
- [Circular enumerator](https://github.com/furkankirat/structforge/blob/main/StructForge/Enumerators/SfCircularQueueEnumerator.cs): `StructForge/Enumerators/SfCircularQueueEnumerator.cs`
- [Enumerable conversions](https://github.com/furkankirat/structforge/blob/main/StructForge/Extensions/SfEnumerableExtensions.cs): `StructForge/Extensions/SfEnumerableExtensions.cs`
- [Exception helpers](https://github.com/furkankirat/structforge/blob/main/StructForge/Helpers/SfThrowHelper.cs): `StructForge/Helpers/SfThrowHelper.cs`

### Other components

- **Library consumer**

## Connections

- Library consumer → Dynamic list: uses collections (evidence: `README.md`)
- Stack → Dynamic list: stores in (evidence: `StructForge/Collections/SfStack.cs`)
- Adjacency graph → Dictionary: uses (evidence: `StructForge/Collections/SfGraph.cs`)
- Adjacency graph → Dynamic list: uses (evidence: `StructForge/Collections/SfGraph.cs`)
- 3D bit array → Bit array: uses (evidence: `StructForge/Collections/SfBitArray3D.cs`)
- Sorted set → AVL tree: backed by (evidence: `README.md`)
- Priority queue → Binary heap: wraps (evidence: `README.md`)
- Enum set → Bit array: uses (evidence: `StructForge/Collections/SfEnumSet.cs`)
- AVL tree → Comparer utilities: compares with (evidence: `StructForge/Collections/SfAvlTree.cs`)
- Binary heap → Comparer utilities: compares with (evidence: `StructForge/Collections/SfBinaryHeap.cs`)
- Sorted set → Comparer utilities: compares with (evidence: `StructForge/Collections/SfSortedSet.cs`)
- Dictionary → Equality comparers: uses (evidence: `StructForge/Collections/SfDictionary.cs`)
- Hash set → Equality comparers: uses (evidence: `StructForge/Collections/SfHashSet.cs`)
- Bit array → Equality comparers: uses (evidence: `StructForge/Collections/SfBitArray.cs`)
- Dynamic list → Array enumerator: enumerates with (evidence: `StructForge/Collections/SfList.cs`)
- Queue → Circular enumerator: enumerates with (evidence: `StructForge/Collections/SfQueue.cs`)
- Enumerable conversions → Dynamic list: converts to (evidence: `StructForge/Extensions/SfEnumerableExtensions.cs`)
- Enumerable conversions → Linked list: converts to (evidence: `StructForge/Extensions/SfEnumerableExtensions.cs`)
- Enumerable conversions → Queue: converts to (evidence: `StructForge/Extensions/SfEnumerableExtensions.cs`)
- Enumerable conversions → Stack: converts to (evidence: `StructForge/Extensions/SfEnumerableExtensions.cs`)
- Enumerable conversions → AVL tree: converts to (evidence: `StructForge/Extensions/SfEnumerableExtensions.cs`)
- Enumerable conversions → Binary heap: converts to (evidence: `StructForge/Extensions/SfEnumerableExtensions.cs`)
- Enumerable conversions → Sorted set: converts to (evidence: `StructForge/Extensions/SfEnumerableExtensions.cs`)
- AVL tree → Exception helpers: throws via (evidence: `StructForge/Collections/SfAvlTree.cs`)
- Dynamic list → Exception helpers: throws via (evidence: `StructForge/Collections/SfList.cs`)
- Dictionary → Exception helpers: throws via (evidence: `StructForge/Collections/SfDictionary.cs`)
