Commit 95c1b2a
fer
Merge optimization/phase-3: 3.7× validation speedup + TNFR-aligned caching
PERFORMANCE ACHIEVEMENTS (73% reduction, 6.138s → 1.670s):
- Fast diameter approximation: 46-111× speedup (O(N+M) vs O(N³))
- Cached eccentricity: 10× first call + ∞× cached (topological invariant)
- Vectorized phase operations: NumPy broadcasting (2-3× faster)
- Field caching: Perfect cache coherence (0.000s repeated calls)
- Grammar early exit: 10-30% speedup on invalid sequences (optional)
PARADIGM ALIGNMENT (All optimizations respect TNFR physics):
- Eccentricity = structural invariant → automatic cache invalidation
- Cache dependencies = structural coupling (graph_topology tracking)
- Vectorization = coherent batch operations (circular topology preserved)
- Read-only telemetry = no state mutation (all invariants preserved)
IMPLEMENTATION (8 major optimizations):
1. UTC timestamp migration (future-proof)
2. Centralized field caching (TNFRHierarchicalCache integration)
3. Performance guardrails (5.8% overhead, < 8% target)
4. Validation aggregator (unified grammar + fields)
5. Fast diameter (2-sweep BFS heuristic)
6. Cached eccentricity (dependencies={'graph_topology'})
7. Vectorized phases (NumPy broadcasting)
8. Grammar early exit (stop_on_first_error parameter)
TESTING: 23/23 tests passing (fields, validation, grammar)
DOCUMENTATION: Complete (OPTIMIZATION_PROGRESS.md, PROFILING_RESULTS.md)
COMMITS: 8 commits (2cf122b...7ee5e1d)
Physics: All optimizations preserve nodal equation semantics and
canonical invariants. Cache respects ∂EPI/∂t = 0 when topology frozen.
Refs: #phase-3, docs/OPTIMIZATION_PROGRESS.mdFile tree
58 files changed
+14469
-283
lines changed- .vscode
- docs
- examples
- notebooks/examples/output
- scripts
- src/tnfr
- backends
- mathematics
- math
- metrics
- operators
- performance
- physics
- tutorials
- utils
- validation
- visualization
- tests/unit
- mathematics
- metrics
- operators
- performance
- validation
- tools
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
58 files changed
+14469
-283
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
129 | 152 | | |
130 | 153 | | |
131 | 154 | | |
| |||
241 | 264 | | |
242 | 265 | | |
243 | 266 | | |
| 267 | + | |
244 | 268 | | |
245 | 269 | | |
246 | 270 | | |
247 | 271 | | |
248 | 272 | | |
| 273 | + | |
249 | 274 | | |
250 | 275 | | |
251 | 276 | | |
252 | 277 | | |
| 278 | + | |
253 | 279 | | |
254 | 280 | | |
255 | 281 | | |
256 | 282 | | |
| 283 | + | |
257 | 284 | | |
258 | 285 | | |
259 | 286 | | |
260 | 287 | | |
261 | 288 | | |
262 | 289 | | |
| 290 | + | |
263 | 291 | | |
264 | 292 | | |
265 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
4 | 10 | | |
5 | 11 | | |
6 | 12 | | |
| |||
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
15 | | - | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
21 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
0 commit comments