aurasync-engine 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aurasync/__init__.py +0 -0
- aurasync/conditions.py +84 -0
- aurasync/controller.py +36 -0
- aurasync/estimator.py +251 -0
- aurasync/event_camera.py +196 -0
- aurasync/frame_camera.py +163 -0
- aurasync/imu.py +98 -0
- aurasync/monitor.py +80 -0
- aurasync/physics.py +62 -0
- aurasync/safety.py +173 -0
- aurasync/scheduler.py +191 -0
- aurasync/simulate.py +168 -0
- aurasync/v4/__init__.py +0 -0
- aurasync/v4/geo_pipeline.py +61 -0
- aurasync/v4/geometry.py +97 -0
- aurasync/v4/pipeline.py +274 -0
- aurasync/v41/__init__.py +0 -0
- aurasync/v41/pipeline.py +269 -0
- aurasync_engine-0.4.1.dist-info/METADATA +132 -0
- aurasync_engine-0.4.1.dist-info/RECORD +23 -0
- aurasync_engine-0.4.1.dist-info/WHEEL +5 -0
- aurasync_engine-0.4.1.dist-info/licenses/LICENSE +21 -0
- aurasync_engine-0.4.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aurasync-engine
|
|
3
|
+
Version: 0.4.1
|
|
4
|
+
Summary: Event-camera state estimator and controller for a cart-pole (simulation prototype)
|
|
5
|
+
Author: Sahil Kundu
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/sahil03kundu-code/AuraSync-Engine
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: numpy
|
|
12
|
+
Requires-Dist: scipy
|
|
13
|
+
Requires-Dist: torch
|
|
14
|
+
Requires-Dist: matplotlib
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# AuraSync-Engine V4 — Detect → Correct → Recover (simulation prototype)
|
|
18
|
+
|
|
19
|
+
An event-camera state estimator and controller for an inverted pendulum (cart-pole) that
|
|
20
|
+
is hit by sudden impulses. V4 adds a way to **detect** when the learned observer is
|
|
21
|
+
confidently wrong, **correct** it from independent event geometry, and **recover** with
|
|
22
|
+
an uncertainty-aware safety supervisor.
|
|
23
|
+
|
|
24
|
+
**Everything here runs in simulation on a 2-core CPU.** No hardware result is claimed.
|
|
25
|
+
The V3 README is in `docs/V3_README.md`.
|
|
26
|
+
|
|
27
|
+
## V4.1 update: geometry-first, evidence-aware, selective neural assistance
|
|
28
|
+
|
|
29
|
+
**Result (held-out seeds 4000+, 272 paired stress trials):**
|
|
30
|
+
- **Adding the network did not help.** V4.1 against the same pipeline without the network
|
|
31
|
+
(D-ev): survival −1.8 points [−7, +3], safe recovery −0.4 [−6, +5].
|
|
32
|
+
- **The evidence fix is the real gain.** D-ev against Baseline D: survival
|
|
33
|
+
**+7.7 [+2, +13]**, safe recovery **+9.2 [+4, +14]**, and occlusion survival 45% → **84%**.
|
|
34
|
+
- **Recommended default:** D-ev, which needs no network and 0.73 cores (V4: 1.83).
|
|
35
|
+
|
|
36
|
+
Details: [`docs/V41_REPORT.md`](docs/V41_REPORT.md) · audit: [`docs/V41_AUDIT.md`](docs/V41_AUDIT.md) ·
|
|
37
|
+
code: `aurasync/v41/pipeline.py`, `benchmark_v41.py`, `analyze_v41.py`, `v41/` · tests: `tests/test_v41.py`.
|
|
38
|
+
|
|
39
|
+

|
|
40
|
+
|
|
41
|
+
## The idea in one analogy
|
|
42
|
+
The V3 neural observer is a ship's navigator who dead-reckons. After a big wave he is
|
|
43
|
+
sure of his position, and wrong. In V3, that was the cause of every fall.
|
|
44
|
+
|
|
45
|
+
V4 adds three things:
|
|
46
|
+
- **a lookout** who takes direct bearings on the mast: a RANSAC line fit on events less
|
|
47
|
+
than 3 ms old;
|
|
48
|
+
- **a rule for when to believe him:** a CUSUM consistency detector plus a gated Kalman
|
|
49
|
+
update, with re-initialisation only after several consistent bearings;
|
|
50
|
+
- **a way to warn the captain** (the supervisor) when nobody is sure.
|
|
51
|
+
|
|
52
|
+
## Headline results (test seeds, never used for any choice)
|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
| Nominal, 112 trials/seed | Survival [95% CI] | Safe (≤ 12°) | Tilt error |
|
|
57
|
+
|---|---|---|---|
|
|
58
|
+
| **V4 proposed** (3 seeds) | **96.4 [93, 99]** | **62.5** | 1.22° |
|
|
59
|
+
| C: V3 + uncertainty + shield (3 seeds) | 54.8 [47, 62] | 32.1 | 6.38° |
|
|
60
|
+
| B: V3 triggered (3 seeds) | 73.8 [68, 79] | 16.7 | 4.96° |
|
|
61
|
+
| E: learned frame camera 120 fps (3 seeds) | 84.5 [79, 90] | 45.8 | 1.41° |
|
|
62
|
+
| **D: event geometry + supervisor, no network** | **99.1 [97, 100]** | **69.6** | 1.59° |
|
|
63
|
+
| F: IMU + encoder | 100 | 57.1 | 0.06° |
|
|
64
|
+
|
|
65
|
+
**What holds up:**
|
|
66
|
+
- **V4 vs V3 + shield:** survival +41.7 points [+34, +49], safe recovery +30.4
|
|
67
|
+
[+23, +37].
|
|
68
|
+
- **Faults V3 cannot survive:** V4 survives the injected sign flip and the confident
|
|
69
|
+
15° error on 16/16 trials (V3 + shield: 44% and 38%). Its alarm fires a median 4 ms
|
|
70
|
+
after the fault.
|
|
71
|
+
- **HDR:** 100% survival, where V3 and the frame camera get 0%.
|
|
72
|
+
|
|
73
|
+
**What does not:**
|
|
74
|
+
- **Baseline D**, the same detect-and-correct idea without the neural network, is level
|
|
75
|
+
with or better than V4 in 14 of 15 non-nominal conditions. In nominal conditions its
|
|
76
|
+
safe recovery is 7.1 points higher [2, 13], at a sixth of the compute.
|
|
77
|
+
- **Occlusion** is the only condition where V4 is clearly ahead (69% vs 44% survival).
|
|
78
|
+
- **Correction is essential.** Detection plus uncertainty inflation without it is worse
|
|
79
|
+
than V3: 8% nominal survival.
|
|
80
|
+
- **Uncertainty inflation** showed no benefit.
|
|
81
|
+
- **The first V4 design** (the network overwrites the state) had the lowest error and
|
|
82
|
+
27% survival.
|
|
83
|
+
- **Compute:** default V4 needs about 1.5 CPU cores of compute per second of control.
|
|
84
|
+
|
|
85
|
+
Full report with CIs, ablations, failure analyses and limitations:
|
|
86
|
+
**[`docs/V4_REPORT.md`](docs/V4_REPORT.md)**.
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
## Repository map
|
|
91
|
+
|
|
92
|
+
| Path | What it is |
|
|
93
|
+
|---|---|
|
|
94
|
+
| `aurasync/v4/geometry.py` | Module A: EventGeometry, the RANSAC pole-line measurement |
|
|
95
|
+
| `aurasync/v4/pipeline.py` | Modules A–C, E: `ConsistencyDetector`, `V4Pipeline` (gated fusion, confirmed re-init, inflation, position-only neural fusion, compute budget) |
|
|
96
|
+
| `aurasync/v4/geo_pipeline.py` | Baseline D: physics + gated geometry, no network |
|
|
97
|
+
| `aurasync/safety.py` | Module D: CBF supervisor, delay compensation, stale fallback (from V3) |
|
|
98
|
+
| `benchmark_v4.py` | Test benchmark: baselines A–F, V4, ablations, 9 stress conditions, 6 new fault scenarios |
|
|
99
|
+
| `analyze_v4.py` | Statistics (paired bootstrap CIs, Cohen's h) and figures → `results/v4/v4_report.json` |
|
|
100
|
+
| `v4/repro_v3.py` | Step 2: bit-exact V3 reproduction |
|
|
101
|
+
| `v4/collect_dev.py`, `v4/eval_dev.py` | Steps 3–5: validation failure catalogue and open-loop detector/correction evaluation |
|
|
102
|
+
| `v4/select_v4.py`, `v4/tune_v4.py` | Step 6: design selection and supervisor tuning (validation seeds 300–315 only) |
|
|
103
|
+
| `v4/latency_v4.py` | Module E: per-stage timings |
|
|
104
|
+
| `v4/plot_failures.py`, `v4/plot_test_cases.py` | Failure visualisations (validation and test) plus per-tick CSV logs |
|
|
105
|
+
| `tests/test_v4.py` | Unit and integration tests |
|
|
106
|
+
| `docs/` | V3 audit, V4 design, latency report, technical report, hardware-validation plan |
|
|
107
|
+
|
|
108
|
+
## Reproduce
|
|
109
|
+
```bash
|
|
110
|
+
pip install torch numpy scipy matplotlib --break-system-packages
|
|
111
|
+
python3 -m unittest discover -s tests -v # 12 tests; 4 need the V3 checkpoints + dev set
|
|
112
|
+
python3 v4/repro_v3.py # V3 reproduction check
|
|
113
|
+
python3 v4/collect_dev.py && python3 v4/eval_dev.py # validation set (about 3.4 GB in data/)
|
|
114
|
+
python3 v4/select_v4.py && python3 v4/tune_v4.py # selection and tuning (validation only)
|
|
115
|
+
WHICH=all python3 benchmark_v4.py # test benchmark, resumable (about 2 h on 2 cores)
|
|
116
|
+
python3 analyze_v4.py # tables, CIs, figures
|
|
117
|
+
python3 v4/latency_v4.py # timings (run on an idle CPU)
|
|
118
|
+
```
|
|
119
|
+
Runs are deterministic (fixed seeds, 1 thread per worker), and the V3 checkpoints in
|
|
120
|
+
`checkpoints/v3/` are reused unchanged. Rules that hold throughout:
|
|
121
|
+
- **Ground truth:** estimators never read it. Replay tests pass `s_true=None`.
|
|
122
|
+
- **Configuration:** stored in `results/v4/tuning_v4.json` (supervisor),
|
|
123
|
+
`checkpoints/v3/calibration.json` and `results/v3/tuning.json` (inherited).
|
|
124
|
+
|
|
125
|
+
## Integrity notes
|
|
126
|
+
- **Simulation only.** No real event sensor, actuator or timing hardware.
|
|
127
|
+
- **Latency.** The 1 kHz control loop is not a demonstrated 1 ms sensor-to-actuator
|
|
128
|
+
latency. See `docs/V4_LATENCY.md`.
|
|
129
|
+
- **No priority claims.** No prior-art search was done, and nothing here is claimed as
|
|
130
|
+
first of its kind, formally safe or patentable.
|
|
131
|
+
- **Sample size.** Stress and scenario cells use 16 trials and mostly one seed, so
|
|
132
|
+
differences below about 20 points there are not established.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
aurasync/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
aurasync/conditions.py,sha256=gy0M6pzs8guXEt_XzGFl626mGx7sZlyyfNK-Ap_Mo70,3756
|
|
3
|
+
aurasync/controller.py,sha256=k1Dx63vL04CzavCjFzI3BD6Qr-1iDIcMTUNscPvYTzY,1230
|
|
4
|
+
aurasync/estimator.py,sha256=6IM5RmJKo9kB4MFFIFzpypHT5cLKA9n4UCsuJ5Drigo,12390
|
|
5
|
+
aurasync/event_camera.py,sha256=NeEsZFRPlM0H8VhfgzK5AjPFD3JSxugTYwdI_K2YlwE,8415
|
|
6
|
+
aurasync/frame_camera.py,sha256=lDNiNVH1CBe99DVVVbhe61oUtJ5uB_FikX2HY6w8jso,8254
|
|
7
|
+
aurasync/imu.py,sha256=qSU8bI3N3AH1tkQAxTlnBNKNl0NcJuUAytMU5U8gP54,4322
|
|
8
|
+
aurasync/monitor.py,sha256=33vVypk1CzMh2jpEJTbARtmR7x23Lm7mSrty52YcmTA,3844
|
|
9
|
+
aurasync/physics.py,sha256=-W6_IJTwcWnDyC8jUVjpPGInlv67G18I2A79knin8Cs,2372
|
|
10
|
+
aurasync/safety.py,sha256=ACOH2upJ4hF-lcI43_L8KkzEGzRvWtRMJkaafJNAL8M,9057
|
|
11
|
+
aurasync/scheduler.py,sha256=c4nCm6d-j1NeCr0p2AXvAbzF83jJ3THZWnI9cusHa84,9146
|
|
12
|
+
aurasync/simulate.py,sha256=e5mJgh0sSqiNs1PqBN9hMMrX0OSVbfWag0sFfLMg3-8,6893
|
|
13
|
+
aurasync/v4/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
aurasync/v4/geo_pipeline.py,sha256=NfpfBDIib0dAFrIe4nUZ6wLc9G9LdZw1Aq4vt_a8RAI,2325
|
|
15
|
+
aurasync/v4/geometry.py,sha256=bae72m0c42koTHxhQZaflzIo9tgwF6L8E3K-fD_0wyA,5007
|
|
16
|
+
aurasync/v4/pipeline.py,sha256=s94ezJMBDPtWmyjXJNFgS6oceeNPA7raCDG4kW3-fnU,14565
|
|
17
|
+
aurasync/v41/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
aurasync/v41/pipeline.py,sha256=FP287c6E2F7Rh3Jjz5HdJcVzaopizY4yjV6RLYU8e0g,13926
|
|
19
|
+
aurasync_engine-0.4.1.dist-info/licenses/LICENSE,sha256=NdrPQ4QWLflSRb_CFdu8o6eN-AC6ufXnXI4lgYaye3k,1067
|
|
20
|
+
aurasync_engine-0.4.1.dist-info/METADATA,sha256=17BokzAEQCOhvgN4d7RT1InCzVTLlaxSmMSw9cXd9mU,7260
|
|
21
|
+
aurasync_engine-0.4.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
22
|
+
aurasync_engine-0.4.1.dist-info/top_level.txt,sha256=lsy2ckuU5PdfNw69mMtVlO3l2YfVNZ90D9riYy_4JO0,9
|
|
23
|
+
aurasync_engine-0.4.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sahil Kundu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aurasync
|