diff --git a/docs/OBSERVATORY_REALTIME_PROFILES_EXECPLAN.md b/docs/OBSERVATORY_REALTIME_PROFILES_EXECPLAN.md index 814ca46..c8b6164 100644 --- a/docs/OBSERVATORY_REALTIME_PROFILES_EXECPLAN.md +++ b/docs/OBSERVATORY_REALTIME_PROFILES_EXECPLAN.md @@ -1,6 +1,10 @@ # Observatory: четыре этапа создания полного real-time Perception-профиля -Дата: 2026-09-01; обновлено 2026-09-02 22:06 МСК. **Этап1 закрыт; этап2 продолжается. Инкремент17: непрерывность короткого LAN-прогона32/32 PASS; latency FAIL.** Код `59a74a3` добавляет только bounded clock-only диагностику. CPU A/B/A без моделей и scene: SSH/Tailscale48/96 ready → проверенный LAN94/96, непрерывно после warmup → Tailscale53/96. Все288 обменов независимо пересчитаны; ~100ms хвосты RPC остаются и без scene. Это не доказательство DERP relay, универсального ускорения LAN или конкретной причины transport tails. +Дата: 2026-09-01; обновлено 2026-09-02 22:35 МСК. **Этап1 закрыт; этап2 продолжается. Инкремент18: существенный транспортный хвост локализован ниже Perception-приложения; full-profile latency не пересчитывалась.** Код `6af4c20`: bounded TLS-record witnesses в CPU-only diagnostic. A/B/A без/с/без свидетелей сохраняет RPC p95 96.093/93.895/95.145ms.424/424 encrypted records и192/192 RPC сопоставлены;288 raw clock exchanges пересчитаны. Из13 post-start tails >50ms восемь приходятся на request transit, пять на response transit; начальный TLS/startup sample не получает выдуманного clock mapping. + +Прямой TCP к подтверждённому SSH22 Worker без gRPC/Docker/forwarding тоже даёт67.921–91.142ms пики (7/16 >50ms). Native Worker loopback после первого sample0.240–0.299ms; первый8.229ms сохранён. Оба сетевых интерфейса — Wi-Fi: Mac en0 и Worker Realtek8812BU USB. Конкретная причина среди radio/AP/OS/driver/power policy не доказана; Wi-Fi и866.7Mbps link rate сами по себе не определяют ни usable throughput, ни latency.82 local/82 Worker tests PASS;142 staged files/132 Python exact. [Отчёт](../experiments/perception/PERCEPTION_STREAM_STAGE2_TLS_ATTRIBUTION_2026-09-02.md),43 artifacts, manifest `abc3ac677b81e0d78f8d5891517022e33ac7fa962166bc399b4009ee48d87d8e`. + +Предыдущий инкремент17: непрерывность короткого LAN-прогона32/32 PASS; latency FAIL. Код `59a74a3` добавляет только bounded clock-only диагностику. CPU A/B/A без моделей и scene: SSH/Tailscale48/96 ready → проверенный LAN94/96, непрерывно после warmup → Tailscale53/96. Все288 обменов независимо пересчитаны; ~100ms хвосты RPC остаются и без scene. Это не доказательство DERP relay, универсального ускорения LAN или конкретной причины transport tails. Один полный32-кадровый1× LAN-canary:32/32 byte-exact/reference-exact результата, без WAIT, drops, sync skips и reconnect. Все50 обменов часов пересчитаны; после двух начальных warmup48 ready, uncertainty публикаций3.645–4.771ms при прежнем пределе5ms. p95/p99 source→consumer-ready205.864/213.751ms при бюджете125ms — FAIL. Полностью свежих scene12, доступных sensor pairs17;30 результатов до EOF. PeakVRAM2357MiB, не предел24GiB. Модели/effective config и129 прежних runtime/test source files не менялись; маршрут выбран только для этого запуска, не зашит в Docker и не назначен продуктовым default.245 local/202 Worker tests PASS,2 Worker-only skip локально,131 source hashes совпадают. [Отчёт](../experiments/perception/PERCEPTION_STREAM_STAGE2_LAN_ROUTE_2026-09-02.md),67 artifacts, manifest `2645a0faacb89b5af5d3756feea05550a12cc64820be926d32f2103b5f225caf`. @@ -22,7 +26,7 @@ CPU-only Mac↔Worker006 proof:72/72 timestamp-наблюдения незави Граница доказательства: два контейнера одного Worker с проверенным общим Linux monotonic clock, временные штатные частоты2610/10251MHz; **не Mac↔Worker full-graph, не radio/live и не standalone**. История зависимых слоёв после gap закономерно отличается от uninterrupted reference. Все230 опубликованных scene/масок проверены на стороне приёмника и повторно сверены. [Подробный отчёт](../experiments/perception/PERCEPTION_STREAM_STAGE2_NETWORK_2026-09-02.md). Evidence236 artifacts: `.runtime/perception-stage2-network-graph-20260902T1541Z/manifest.json`, SHA-256 `d1bc7e26850a2d9050ee1d8f8a5ece2e6b8c53e2e7dba381cbd4445d68a5ec17`. -Следующий проверяемый результат этапа2: per-frame границы source packing/write → Worker ingress/decode/queue/publication → result read/parse и пересечение с control requests. Начать с bounded CPU transport checks, отделить очереди/сериализацию от оставшихся ~100ms хвостов завершения RPC, затем оптимизировать измеренную причину и выполнить один короткий full-graph recheck. CPU A/B/A уже показал, что общая обработка scene не является необходимой причиной clock WAIT; точный слой задержки пока не установлен. Пороги5ms/125ms и source1× не ослаблять, source clock после старта не переносить, backlog не догонять; не заменять модели ради неподтверждённой транспортной причины. Далее внутри этапа2 — controlled cross-host gap/slow-consumer, длинный поток и standalone без developer/model mounts. Измерительный latency FAIL не превращается в PASS, но сам по себе не запрещает разработку упаковки/общего runtime согласно принятому экспериментальному scope. Этапы3–4/registry/UI cutover не открыты. Временные контейнеры/lease/collector/tunnel18561/key/bootstrap удалены, сервисы и GPU auto mode восстановлены; Ollama/Frigate exited/restart=no. Mac8000/Worker telemetry работают. +Следующий проверяемый результат этапа2: per-frame source packing/write → ingress/decode/admission → GPU/CPU queues → publication/result read/parse. В исходнике найден отдельный10ms polling готовых ответов: сначала измерить фактическую цену и bounded lifecycle/backpressure, затем проверить event-driven замену. CPU transport attribution уже доказала существенный tail за границами приложения; не менять модели/VRAM ради этого симптома и не вычитать p95 разных выборок. При доступном Ethernet выполнить контроль без обоих Wi-Fi участков; это не блокирует оптимизацию и упаковку runtime при честном network-specific FAIL. Пороги5ms/125ms/source1× прежние, backlog не догонять. Затем controlled gap/slow-consumer, длинный поток и standalone без developer/model mounts внутри этапа2. Этапы3–4/registry/UI cutover не открыты. Временные CPU containers/relays/tunnel18561/key/bootstrap удалены; GPU/сервисные настройки в инкременте18 не менялись. Ollama/Frigate exited/restart=no; Mac8000/Worker telemetry работают. Предыдущий инкремент12 (`0310592`, `1916122`): CPU-only gRPC/TLS proof Mac↔Worker,16/16 payload/reply; синтетический source clock и CPU sentinel, моделей0. Same-Mac RTT14.360/23.919/120.815ms min/median/max — не one-way age/FPS.105 local и20 Worker tests PASS, проверены bounded slow-reader/quarantine. Evidence `.runtime/perception-stage2-grpc-20260902T1500Z/manifest.json`, SHA-256 `adf5eaf092feaed6721f66e2adaceded0cdbf55754e1f9953f54623bfb52d331`. @@ -253,6 +257,8 @@ EoMT — семейство ViT-моделей сегментации изобр ## Progress +- 2026-09-02 22:35 МСК: `6af4c20`, инкремент18. CPU-only TLS A/B/A:96 обменов/192 RPC на case, p95 96.093/93.895/95.145ms; relay не устранил tail.424/424 ciphertext records exact,192 RPC matched,288 clocks reconstructed.13 post-start B tails >50ms локализованы к inter-edge request8/response5; startup mapping unknown сохранён. Прямой TCP SSH22 без forwarding/gRPC/Docker:16/16 успех,7 скачков67.921–91.142ms; Worker loopback после первого0.240–0.299ms. Mac en0 и Worker Realtek8812BU USB — оба Wi-Fi.82 local/82 Worker PASS,142 staged files/132 Python exact,43 artifacts/manifest `abc3ac677b81e0d78f8d5891517022e33ac7fa962166bc399b4009ee48d87d8e`. Нет новых GPU/full-profile запусков или runtime fix; следующий шаг — per-frame timing/10ms reply polling и доступный wired comparison. Временные ресурсы удалены, durable IDs/policies сохранены; два прежних сервиса автономно увеличили restart counts, не объявлены починенными. + - 2026-09-02 22:06 МСК: `59a74a3`, инкремент17. Bounded clock-only probe +10ms scheduling witness, без lease/grant/source/model authority. CPU A/B/A ready48/96 →94/96 →53/96; LAN после warmup непрерывен, ~100ms RPC tails сохраняются. Один полный LAN-canary32/32 exact без WAIT/drop/reconnect,30 результатов до EOF,12 полностью fresh из17 доступных sensor pairs. p95/p99 205.864/213.751ms —125ms FAIL; четыре resident PID/lease1 сохранены. Все338 raw clock exchanges (288 CPU +50 full) независимо пересчитаны.245 local/202 Worker tests PASS,2 Worker-only skip локально;131 source hashes, прежние129 без изменений.67 artifacts/manifest `2645a0faacb89b5af5d3756feea05550a12cc64820be926d32f2103b5f225caf`. Результат не standalone и не изменение постоянного маршрута. Ресурсы освобождены, сервисы/auto clocks восстановлены. - 2026-09-02 21:12 МСК: `48835a0`, инкремент16. Joint startup PASS; 1× source начинается с0, anchor принят обеими сторонами. Full canary8/32 FAIL: compute discard6, source WAIT7–15, sync16–29, результаты0–5/30–31. Raw receipt exact8/8; до EOF6, полностью fresh5. Clock exchanges55/55 пересчитаны, readiness41/55; running uncertainty5.031–5.667ms, host telemetry33/33 без ошибок. Lease1/4PID пережили WAIT, после End всё освобождено.241 local/198 Worker PASS;129 source hashes.53 artifacts/manifest `9cb369fe7ae185d1a92f6050bc1018a878483f5eec169267f100843245428691`. Следующий gate — CPU-only control/data scheduling attribution, не ещё один слепой GPU retry. @@ -308,6 +314,8 @@ EoMT — семейство ViT-моделей сегментации изобр ## Surprises / открытые вопросы +- Инкремент18: «LAN» не означал Ethernet — обе стороны работают по Wi-Fi, Worker через USB Realtek8812BU. Прямой TCP connect воспроизводит большой tail без нашего pipeline; reported866.7Mbps link rate не квалифицирует latency. Это не доказательство вины конкретного адаптера/AWDL/роутера или отсутствия других затрат в коде. Независимое clock/record evidence локализует контрольный tail, но не измеряет ещё крупные camera/scene buffers. First TLS startup без mapping сохранён отдельно; ICMP no-reply не выдан за общую потерю пакетов. + - Инкремент17: clock readiness срывается в A/A2 даже при0 моделях/scene, поэтому общий scene event loop не является единственным достаточным объяснением. LAN улучшил короткий интервал ready, но не все RPC tails: Poll p95 A/B/A2 88.838/92.403/89.950ms, LAN ACK p95 98.266ms. Tailscale preflight показал direct LAN endpoint, а не доказанный DERP. Выбор маршрута относится к connection configuration, не к весам/профилю.32/32 выходов не равны32 свежим scene; локальные Worker accounting gates остаются unknown/false для внешнего источника, отдельный joined verifier доказывает отсутствие потерь. Нельзя складывать/вычитать p95 разных timing boundaries как стоимости независимых стадий. - Инкремент16: согласованный старт и отсутствие RPC errors не означают непрерывную готовность часов. Running bounds вышли за5ms без GPU/owner failure; это условная uncertainty при500ppm budget, не измеренный физический drift. Offline добавление всех probes в прежних2s всё ещё даёт FAIL на тех же девяти samples. Для следующего изменения нужен timing trace scheduling/control/data, а не автоматическое расширение history или бюджета. @@ -368,6 +376,6 @@ EoMT — семейство ViT-моделей сегментации изобр ## Outcomes / retrospective -Этап1 завершён; этап2 продолжается. Инкремент17 подтвердил короткую непрерывную Mac↔Worker обработку полного профиля через проверенный LAN-маршрут:32/32 byte-exact/reference-exact, без WAIT/потерь/reconnect. Это не real-time qualification: p95/p99 205.864/213.751ms выше125ms, полностью fresh только12 scene, два результата после EOF. CPU-only A/B/A отделил clock readiness от наличия моделей/scene;338 raw clock exchanges пересчитаны, конкретная причина оставшихся ~100ms RPC tails пока не установлена. Следующий участок — инструментирование упаковки/очередей/сериализации/входа-выхода и оптимизация подтверждённой задержки, без расширения бюджетов.245 local/202 Worker tests PASS;131 source hashes,67 artifacts. Одна GPU-проба без повторов; профиль/веса/config и129 прежних source files неизменны, постоянный маршрут не менялся. Standalone/native-host inventory/radio/live не квалифицированы. Batch/registry/UI и этапы3–4 не начаты, actuation=false. Mac8000/telemetry работают,8765/temporary18561 закрыты, Ollama/Frigate exited/restart=no. Временные ресурсы удалены, lease released, четыре точных service IDs и GPU auto mode восстановлены; прежние service defects не объявлены исправленными. +Этап1 завершён; этап2 продолжается. Инкремент18 локализовал один существенный источник длинных задержек ниже Perception-приложения: между TLS edges, с независимым воспроизведением при TCP connect без gRPC/Docker/SSH forwarding. Оба конца на Wi-Fi; конкретный radio/AP/driver/OS механизм остаётся неизвестным, Ethernet comparison возможен при физическом подключении.424 encrypted records/192 RPC exact,288 clocks reconstructed;82 local/82 Worker tests PASS,142 staged files exact,43 artifacts. Модели/GPU/production runtime не запускались и не менялись; full-graph статус по-прежнему из инкремента17:32/32 continuous, p95/p99 205.864/213.751ms FAIL,12 fresh scene. Весь runtime не объявляется невиновным: далее per-frame очереди/сериализация/выдача, отдельный10ms polling и bounded lifecycle. Отсутствие Ethernet не блокирует экспериментальную разработку runtime/standalone. Этапы3–4/registry/UI/actuation не открыты. Временные ресурсы закрыты, IDs/restart policies сохранены; существующие autonomous service restarts отмечены отдельно, не исправлены. Mac8000 PID33360/telemetry работают,8765/18561 отсутствуют; Ollama/Frigate exited/restart=no. После этапа 4 здесь будут перечислены digest самостоятельного полного образа, измеренные статусы и ошибки по recordings, реально проверенные source/hardware/config комбинации, состояние сохранённого EoMT-варианта и оставшиеся physical-live/quality/vehicle-integration ограничения. Готовый Docker и готовая автономия не отождествляются. diff --git a/docs/adr/0049-stream-first-perception-profiles.md b/docs/adr/0049-stream-first-perception-profiles.md index a8a5d11..dc0e868 100644 --- a/docs/adr/0049-stream-first-perception-profiles.md +++ b/docs/adr/0049-stream-first-perception-profiles.md @@ -904,3 +904,23 @@ Do not equate complete output accounting with usable geometry/policy or autonomo readiness. Next instrument data-plane stage boundaries before optimizing remaining tails; no gate widening.245 local/202 Worker tests PASS,131 source hashes matched. [Detailed route and full-profile evidence](../../experiments/perception/PERCEPTION_STREAM_STAGE2_LAN_ROUTE_2026-09-02.md). + +## Stage 2 increment 18: application-edge transport attribution (2026-09-02) + +Optional bounded TLS-record witnesses belong to isolated diagnostic tooling, not +the runtime route or model profile. A/B/A keeps the~100ms tail with and without +the witnesses;424 ciphertext records match between edges and192 serial RPCs +match their handlers.13 post-start long calls localize to request(8)/response(5) +inter-edge transit, not local JSON/handler work. Startup without admitted clock +mapping stays unqualified; timestamps are application receipt/drain, not wire ACKs. + +Direct TCP connects to the known Worker SSH port reproduce67.9–91.1ms peaks without +gRPC, Docker or SSH forwarding. Both active links are Wi-Fi; native Worker loopback +after startup is0.240–0.299ms. The specific radio/AP/OS/driver mechanism is unproved. +Do not weaken5ms/125ms gates or replace models to address an external transport +symptom. Conversely, this does not exonerate all application costs or qualify +large scene buffers. Continue per-frame queue/serialization/publication attribution; +an available wired comparison should remove both radio legs but is not a prerequisite +for experimental runtime/standalone work. No product transport or GPU workload changed. +82 local/82 Worker tests PASS;142 staged files exact; previous full-graph latency FAIL +stands. [Detailed evidence](../../experiments/perception/PERCEPTION_STREAM_STAGE2_TLS_ATTRIBUTION_2026-09-02.md). diff --git a/experiments/perception/PERCEPTION_STREAM_STAGE2_TLS_ATTRIBUTION_2026-09-02.md b/experiments/perception/PERCEPTION_STREAM_STAGE2_TLS_ATTRIBUTION_2026-09-02.md new file mode 100644 index 0000000..141e5ee --- /dev/null +++ b/experiments/perception/PERCEPTION_STREAM_STAGE2_TLS_ATTRIBUTION_2026-09-02.md @@ -0,0 +1,120 @@ +# Stage 2 increment 18 — localization below the perception application + +2026-09-02,22:35 MSK. Code `6af4c20`. **One substantial transport tail localized; +no runtime optimization or new full-profile real-time qualification claimed.** +Stage2 remains open; Stage3/4, standalone and actuation remain unqualified/disabled. + +## Question and bounded method + +The preceding full LAN canary returned32/32 reference-exact scenes, but consumer +p95/p99 was205.864/213.751ms and only12 scenes were fully fresh. Its clocks stayed +ready while small control requests still sometimes took~100ms. This increment +isolates that independently reproduced tail before changing models or data queues. + +Added optional encrypted TLS-record witnesses around the existing CPU clock probe: +one relay at the Mac application edge, one inside the Worker diagnostic container. +They record monotonic receipt/drain times, offsets, lengths and SHA256 of ciphertext +records; they neither decrypt nor log payloads, TLS keys or capability tokens. +RPC invocation/completion and Worker handler entry/return bind the observations by +nonce. At most2 connections,8MiB/direction,4096 records/direction, bounded I/O and +overall deadlines. This is diagnostic tooling, **not a replacement runtime route**. + +The relays can perturb buffering/segmentation/scheduling. Therefore three sequential +cases used the SAME strict-host-key-pinned LAN SSH route and unchanged dependency +image: A without relays, B with both, A2 without them again. Each case96 Poll/Report +pairs, no recording/scene payloads, data grant, source anchor, GPU lease or model work. +One1CPU/512MiB runc container at a time; only sparse control requests on the Mac. +No service stop/restart, GPU-clock setter, Docker build or network configuration edit. + +## A/B/A retained the observed tail + +| Case | RPC count | Median | p95 | Max | RPCs >50ms | Clock ready | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| A: no relay |192|9.789ms|96.093ms|116.939ms|13|95/96| +| B: two witnesses |192|9.904ms|93.895ms|98.966ms|14|94/96| +| A2: no relay |192|10.062ms|95.145ms|137.224ms|13|94/96| + +Readiness stays continuous after initial warmup in all three short cases. All288 +raw t1–t6 exchanges and both clock windows/readiness decisions were independently +reconstructed. No5ms/2s/500ppm/50us gate was widened. The small difference between +case quantiles is not a demonstrated optimization or an equivalence/non-inferiority test. + +B has211 request +213 response TLS records, **424/424 matching offsets/lengths/hashes** +at both ends, no partial records or relay errors;192/192 RPCs match their handlers. + +| B local application boundary | p95 | Max including startup | +| --- | ---: | ---: | +| Mac RPC invocation → request TLS record |1.013ms|56.609ms| +| Worker request TLS record → handler entry |0.473ms|2.692ms| +| Worker handler execution |0.190ms|0.319ms| +| Worker handler return → response TLS record |0.121ms|0.713ms| +| Mac response TLS record → RPC completion |0.649ms|0.995ms| + +The first long B call includes connection/TLS startup and lacks admitted clock +mapping; it is retained as unqualified for directional attribution. Of the other13 +calls >50ms,8 have an inter-edge request delay lower bound >40ms;5 have an inter-edge +response delay lower bound >40ms. Examples: request84.236–93.023ms, response88.172– +95.374ms, under the existing conditional clock envelope. Local relay drain maxima +are0.215ms on Mac and0.113ms on Worker. No scheduler-lag subtraction is applied. + +These are application-edge timestamps, not packet departure, ACK or hardware-clock +measurements. TLS-record/RPC association is for this one serial control exchange, +not an asserted universal per-frame tracer. Do not sum/subtract unrelated p95s or +claim that this measures large scene serialization, decoder queues or model speed. + +## Independent TCP check narrows it below gRPC/Docker/forwarding + +Sixteen sparse direct connections to the already-confirmed Worker SSH port22 used +no SSH authentication, forwarding, gRPC or Docker. All16 connected and returned a +valid SSH banner. TCP-connect times: min6.380ms, median25.338ms, max91.142ms;7/16 +exceeded50ms, with67.921–91.142ms peaks. This uses one Mac monotonic clock and does +not depend on cross-host clock mapping.32 ICMP echo requests had no replies; this +is not evidence of general packet loss or a dead Worker, and no firewall was changed. + +Sixteen native Worker loopback connections to its same SSH port: first8.229ms; +remaining15:0.240–0.299ms, median0.264ms. The startup value is not hidden. This is +an unpaired short diagnostic, not a promise of future LAN latency or proof that +SSH forwarding contributes zero overhead to large data transfers. + +Read-only adapter inspection found **both ends on Wi-Fi**: Mac route uses en0; +Worker192.168.68.50 belongs to Realtek8812BU Wireless LAN802.11ac USB NIC. Reported +link866.7Mbps is not measured throughput, a low-jitter guarantee or the source's +future300–500Mbps qualification. No specific radio/AP/driver/power-saving mechanism +has been identified. In particular, do not infer an AWDL cause or a defective NIC +from periodicity alone. A comparative Ethernet run should remove both Wi-Fi legs; +it needs the operator's available physical connection, not a hidden config change. + +## Decision within the existing four stages + +One major observed control tail occurs below the perception application and also +appears during direct TCP connect. Do not replace DDRNet/RF-DETR, increase VRAM, widen +clock/latency budgets or tune JSON blindly to fix that symptom. This does **not** +exonerate all runtime costs or establish that the entire previous206ms p95 is network. + +Continue Stage2 with per-frame source pack/write, ingress/decode/admission, GPU/CPU +queues, publication and result parse timing. A separate code finding is the10ms +polling loop for ready replies in `streaming_grpc.py`; its actual contribution and +an event-driven replacement need their own bounded tests. It was not modified here. +Ethernet comparison can further split external jitter when available, but is not +a prerequisite for optimizing/packaging the runtime under the accepted experimental +scope. No long GPU run, new profile, standalone claim or Stage3 UI cutover was made. + +## Verification and retained evidence + +82 focused local tests and82 Worker tests PASS; Ruff/check-format and diff check PASS. +All142 staged files, including132 Python files, match the local code, remote snapshot +and archive. Production transport/clock implementations, graph, models, weights and +effective profile config are unchanged; only isolated diagnostic code/tests changed. + +Session `.runtime/perception-stage2-tls-attribution-20260902T1923Z`;43 artifacts. +Archive SHA256 `94affc1d74a6835880f76145cc4245d29e6ab559025a8bcdb8c11762642ca793`. +Manifest SHA256 `abc3ac677b81e0d78f8d5891517022e33ac7fa962166bc399b4009ee48d87d8e`. +`analyze.py` independently reconstructs clocks and links every ciphertext record; +`finalize.py` checks code hashes, tests, exact resources, direct/native TCP evidence. + +All temporary containers, relays, tunnel PID52687, bootstrap files and private key +are gone. No GPU workload/clocks or durable service settings were changed. Container +IDs/restart policies match preflight; existing autonomous restart counts changed +for m49 agent2→3 and perception worker18→23, not a claimed repair. Ollama/Frigate +remain exited/restart=no. Canonical Mac8000 PID33360 and identity-matched Worker +telemetry work;8765/18561 absent. No physical K1, vehicle/motor or external deployment.