From 76f460c88a7166616c9795b80c32e668f6c751ff Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Tue, 19 May 2026 17:17:33 +0300 Subject: [PATCH] [autodev] Step 13 partial: c6/c7/c8 cycle-1 doc sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Batch 3 of the cycle-1 component-doc sync. For each of C6 (tile_cache), C7 (inference), C8 (fc_adapter): - Append "Cycle-1 operational reality" paragraph to § 1 documenting the actual cycle-1 wiring path: - C6: infrastructure seeded via build_pre_constructed's c6_descriptor_index (BUILD_FAISS_INDEX-gated) and c6_tile_store slots; no _STRATEGY_REGISTRY slot; AZ-687 replay-mode guard skips both seeds when the minimal replay Config omits the c6_tile_cache block. - C7: single InferenceRuntime built once via _build_c7_inference, identity-shared as the engine source for c3_lightglue_runtime (AZ-622 phase D); C7_AIRBORNE_BUILD_FLAGS lists tensorrt (production- default) + pytorch_fp16 (Tier-0 fallback); onnx_trt_ep deliberately omitted from airborne flags; AZ-687 replay-mode guard cascades to c3_lightglue_runtime. - C8: composed via a SEPARATE registry path (runtime_root/fc_factory.py) with its own _FC_REGISTRY + _GCS_REGISTRY; per-binary bootstrap modules register concrete strategies under BUILD_FC_* / BUILD_GCS_* flags; bind_outbound_emit_thread enforces the single-writer outbound invariant (AC-6). - Add "Cycle-1 Tier-2 follow-up dependencies" subsection in § 7 of C7 only: onnx_trt_ep is implemented and the inference_factory recognises BUILD_ONNX_TRT_EP_RUNTIME, but airborne config selecting it raises a clean AirborneBootstrapError pointing only at the two airborne options. C6 and C8 have no parked Tier-2 strategies for cycle-1. None of c6/c7/c8 import cv2 directly, so no OpenCV pin row is added to § 5 (D-CROSS-CVE-1 leftover stays as it is; the relaxed pin is recorded against c2.5/c3/c3.5/c4/c5 where the imports actually live). Also refresh the D-CROSS-CVE-1 leftover replay timestamp (condition still upstream-gated: gtsam wheels remain numpy<2) and bump the autodev state's sub_step.detail to record "batch 3/~5 done (c6/c7/c8); 4 components + 8 helpers + tests/ remain". Co-authored-by: Cursor --- .../components/08_c6_tile_cache/description.md | 2 ++ .../02_document/components/09_c7_inference/description.md | 5 +++++ .../components/10_c8_fc_adapter/description.md | 2 ++ _docs/_autodev_state.md | 4 ++-- .../2026-05-11_d_cross_cve_1_opencv_pin_deferred.md | 8 ++++---- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/_docs/02_document/components/08_c6_tile_cache/description.md b/_docs/02_document/components/08_c6_tile_cache/description.md index ea10798..adf0226 100644 --- a/_docs/02_document/components/08_c6_tile_cache/description.md +++ b/_docs/02_document/components/08_c6_tile_cache/description.md @@ -6,6 +6,8 @@ **Architectural Pattern**: Repository — three concrete stores behind separate interfaces (`TileStore` for pixel + metadata I/O; `TileMetadataStore` for the Postgres spatial index; `DescriptorIndex` for FAISS HNSW). Single concrete implementation per interface today (`PostgresFilesystemStore`, `FaissDescriptorIndex`); future variants (e.g., RocksDB-backed metadata for resource-constrained tiers) can be added behind the same interfaces. +**Cycle-1 operational reality**: C6 is **infrastructure** — it does NOT have a `c6_tile_cache` slot in the `_STRATEGY_REGISTRY` populated by `register_airborne_strategies()` (AZ-591). Instead the airborne binary materialises C6's two consumer-facing handles via `runtime_root/airborne_bootstrap.py::build_pre_constructed`, which seeds `pre_constructed["c6_descriptor_index"]` (via `_build_c6_descriptor_index` → `storage_factory.build_descriptor_index`, gated by `BUILD_FAISS_INDEX` per `airborne_bootstrap.FAISS_BUILD_FLAG`) and `pre_constructed["c6_tile_store"]` (via `_build_c6_tile_store` → `storage_factory.build_tile_store`, no `BUILD_*` flag — always built when the c6 block is configured). `compose_root` then passes those instances to the downstream wrappers that list them in `AIRBORNE_REQUIRED_PRE_CONSTRUCTED_KEYS` (c2_vpr consumes `c6_descriptor_index`; c2_5_rerank consumes `c6_tile_store`; c5_state optionally consumes `c6_tile_store` for the AZ-389 orthorectifier path). Strategy slots are populated from `C6TileCacheConfig.KNOWN_*_RUNTIMES`: `{store,metadata}_runtime ∈ {"postgres_filesystem"}` and `descriptor_index_runtime ∈ {"faiss_hnsw"}` — only one concrete impl per slot in cycle-1; the field exists to keep the contract open for a future SQLite Tier-0 dev runtime. When `BUILD_FAISS_INDEX` is OFF and any configured downstream consumer still requires the descriptor index, `_build_c6_descriptor_index` re-raises the lower-level `RuntimeNotAvailableError` as an `AirborneBootstrapError` naming `c6_descriptor_index`, the gating flag, and the consuming component slug. AZ-687 replay-mode guard: when `config.mode == "replay"` and the minimal replay `Config` omits the `c6_tile_cache` block, `build_pre_constructed` skips both C6 seeds entirely — the only wrappers that read those slots (c2_vpr / c2_5_rerank / c5_state) also require their own component entries in `config.components`, which the minimal replay `Config` likewise omits, so the skipped slots are never read. + **Upstream dependencies**: - C11 `TileDownloader` (writes `tiles` rows + JPEGs during F1 pre-flight provisioning, source='googlemaps'). - C10 CacheProvisioner (writes Manifest + FAISS index during F1 pre-flight provisioning, after C11 has populated tiles). diff --git a/_docs/02_document/components/09_c7_inference/description.md b/_docs/02_document/components/09_c7_inference/description.md index c43e5ac..0950d50 100644 --- a/_docs/02_document/components/09_c7_inference/description.md +++ b/_docs/02_document/components/09_c7_inference/description.md @@ -6,6 +6,8 @@ **Architectural Pattern**: Strategy — `InferenceRuntime` interface with three concrete implementations: `TensorrtRuntime` (production-default per D-C7-9 JetPack 6.2 + TensorRT 10.3 lock), `OnnxTrtEpRuntime` (fallback), `PytorchFp16Runtime` (mandatory simple-baseline). Selection at startup by config (ADR-001), build-time gating by `BUILD_*` flags (ADR-002), composition-root wired (ADR-009). +**Cycle-1 operational reality**: C7 is **infrastructure shared across consumers** — it does NOT have its own slot in the `_STRATEGY_REGISTRY` populated by `register_airborne_strategies()` (AZ-591). Instead the airborne binary builds the `InferenceRuntime` once via `runtime_root/airborne_bootstrap.py::_build_c7_inference` → `inference_factory.build_inference_runtime`, and seeds the single instance into `pre_constructed["c7_inference"]` (AZ-621 / Phase C). The same instance is reused as the engine source for the shared `LightGlueRuntime` load (AZ-622 / Phase D, `_build_c3_lightglue_runtime`), so the bootstrap never double-builds the runtime; downstream wrappers (c2_vpr / c3_matcher / c3_5_adhop, per `AIRBORNE_REQUIRED_PRE_CONSTRUCTED_KEYS`) then receive the identity-shared runtime via `compose_root`'s constructor injection. Airborne-buildable runtimes are gated by `C7_AIRBORNE_BUILD_FLAGS = (("tensorrt", "BUILD_TENSORRT_RUNTIME"), ("pytorch_fp16", "BUILD_PYTORCH_FP16_RUNTIME"))` — `tensorrt` is the production-default, `pytorch_fp16` is the Tier-0 / workstation fallback (and is the conservative `C7InferenceConfig.runtime` default so unconfigured test environments resolve to the Tier-0 baseline). `onnx_trt_ep` is **deliberately omitted** from the airborne flag matrix even though `inference_factory._RUNTIME_TO_BUILD_FLAG` recognises it — see § 7 Tier-2 follow-up. When no airborne runtime is buildable (both `BUILD_TENSORRT_RUNTIME` and `BUILD_PYTORCH_FP16_RUNTIME` OFF, or the configured runtime's flag is OFF) and any configured consumer still requires `c7_inference`, `_build_c7_inference` surfaces the upstream `RuntimeNotAvailableError` as an `AirborneBootstrapError` (AC-621.2) naming the missing key, BOTH airborne `BUILD_*` flags + their runtimes, and the consuming component slug(s) — narrowed to the configured consumers when available. AZ-687 replay-mode guard: when `config.mode == "replay"` and the minimal replay `Config` omits the `c7_inference` block, `build_pre_constructed` skips both `c7_inference` AND the cascading `c3_lightglue_runtime` seed (the LightGlue runtime depends on the inference runtime); the c2_vpr / c3_matcher / c2_5_rerank / c3_5_adhop wrappers that would have consumed the runtime are likewise absent from the replay `Config` and therefore never look at the skipped slot. + **Upstream dependencies**: - C10 CacheProvisioner → during F1 (after C11 `TileDownloader` has populated C6) triggers engine compilation when no cached engine matches the `(SM, JP, TRT, precision)` tuple. - F2 takeoff load → triggers `deserialize_cached_engine` for every model used by C1/C2/C2.5/C3/C3.5. @@ -134,6 +136,9 @@ Not applicable. **Performance bottlenecks**: - Per-frame inference cost is the F3 hot path's largest contributor. NFT-PERF-01 partition is the source of truth. +**Cycle-1 Tier-2 follow-up dependencies**: +- `OnnxTrtEpRuntime` — the module + class are implemented and the lower-level `inference_factory._RUNTIME_TO_BUILD_FLAG` maps `"onnx_trt_ep" → "BUILD_ONNX_TRT_EP_RUNTIME"`, but the **airborne** `C7_AIRBORNE_BUILD_FLAGS` tuple in `runtime_root/airborne_bootstrap.py` deliberately omits it (research-only per the AZ-621 task spec). Setting `config.components['c7_inference'].runtime = "onnx_trt_ep"` on an airborne binary raises `AirborneBootstrapError` from `_build_c7_inference` whose message lists ONLY the two airborne flag options (tensorrt / pytorch_fp16) — operators see a clean recovery path instead of a research-build escape hatch. Tier-2 follow-up: extend `C7_AIRBORNE_BUILD_FLAGS` (and gate it on `BUILD_ONNX_TRT_EP_RUNTIME=ON`) only if a future deployment scenario justifies the ORT-TRT-EP path on a flight binary; until then the runtime is exercised via unit-test composition and ad-hoc workstation runs only. + ## 8. Dependency Graph **Must be implemented after**: nothing internal — C7 is foundational. diff --git a/_docs/02_document/components/10_c8_fc_adapter/description.md b/_docs/02_document/components/10_c8_fc_adapter/description.md index 179ab7c..d0b08c2 100644 --- a/_docs/02_document/components/10_c8_fc_adapter/description.md +++ b/_docs/02_document/components/10_c8_fc_adapter/description.md @@ -6,6 +6,8 @@ **Architectural Pattern**: Strategy — `FcAdapter` interface with two concrete implementations: `PymavlinkArdupilotAdapter`, `Msp2InavAdapter`. Plus a `GcsAdapter` (single concrete `QgcTelemetryAdapter` today). All selected at startup by config (ADR-001), build-time gating per `BUILD_*` flags (ADR-002, both adapters typically linked into the deployment binary so a single image can target both FCs by configuration), composition-root wired (ADR-009). +**Cycle-1 operational reality**: C8 is composed via a **separate registry path** from the rest of the strategy-selecting components — there is no `c8_fc_adapter` slot in the central `_STRATEGY_REGISTRY` populated by `register_airborne_strategies()` (AZ-591), and no `c8_*` row in `AIRBORNE_REQUIRED_PRE_CONSTRUCTED_KEYS`. Instead `runtime_root/fc_factory.py` owns two private registries — `_FC_REGISTRY` and `_GCS_REGISTRY` — and exposes `register_fc_adapter()` / `register_gcs_adapter()` so per-binary bootstrap modules (one per `BUILD_FC_` / `BUILD_GCS_` combination) can lazy-link the concrete adapter classes ahead of `build_fc_adapter()` / `build_gcs_adapter()`. Both calls run the build-flag gate against `_FC_BUILD_FLAGS = {"ardupilot_plane": "BUILD_FC_ARDUPILOT_PLANE", "inav": "BUILD_FC_INAV"}` and `_GCS_BUILD_FLAGS = {"qgc_mavlink": "BUILD_GCS_QGC_MAVLINK"}` and surface an OFF flag as `FcAdapterConfigError` / `GcsAdapterConfigError` naming the disabled flag (AC-4). The outbound single-writer invariant is enforced by `bind_outbound_emit_thread()` — called once per process before wiring outbound emit, a second call from any other thread raises `OutboundThreadAlreadyBoundError` (AC-6 / Invariant 8). Unit-test isolation uses `clear_strategy_registries()` + `clear_outbound_thread_binding()`. C8 takes **no** infrastructure dependency on `pre_constructed`; its `**deps` kwargs are populated by `compose_root`'s C5 / C13 wiring path (per-binary `main()` constructs the concrete adapter with the FC's port config and the C5 estimator's outbound `EstimatorOutput` stream). + **Upstream dependencies**: - C5 StateEstimator → `EstimatorOutput` (5 Hz periodic emit driver). - Hardware: UART/USB to FC; UART (or USB) to GCS (often shared or via FC mavlink-routing). diff --git a/_docs/_autodev_state.md b/_docs/_autodev_state.md index bfd6d9b..4372305 100644 --- a/_docs/_autodev_state.md +++ b/_docs/_autodev_state.md @@ -6,9 +6,9 @@ step: 13 name: Update Docs status: in_progress sub_step: - phase: 6 + phase: 8 name: component-doc-updates - detail: "batch 3 next: c6/c7/c8; then c10/c11/c12/c13; then 8 helpers; then tests/" + detail: "batch 3/~5 done (c6/c7/c8); next: c10/c11/c12/c13; then 8 helpers; then tests/" retry_count: 0 cycle: 1 tracker: jira diff --git a/_docs/_process_leftovers/2026-05-11_d_cross_cve_1_opencv_pin_deferred.md b/_docs/_process_leftovers/2026-05-11_d_cross_cve_1_opencv_pin_deferred.md index ce3a340..de569fe 100644 --- a/_docs/_process_leftovers/2026-05-11_d_cross_cve_1_opencv_pin_deferred.md +++ b/_docs/_process_leftovers/2026-05-11_d_cross_cve_1_opencv_pin_deferred.md @@ -1,10 +1,10 @@ # D-CROSS-CVE-1 opencv-python pin deferred — gtsam/numpy ABI block **Recorded**: 2026-05-11T02:55+03:00 (Europe/Kyiv) -**Last replay attempt**: 2026-05-19T17:00+03:00 (Europe/Kyiv) — replay attempted -during `/autodev` invocation; condition unchanged since the 12:43 PyPI check -(`gtsam==4.2.1` latest, `requires_dist: numpy<2.0.0,>=1.11.0`). Replay -condition (numpy>=2 stable wheels) still NOT met. Leftover remains open. +**Last replay attempt**: 2026-05-19T17:13+03:00 (Europe/Kyiv) — replay attempted +during `/autodev` invocation; `gtsam==4.2.1` still latest on PyPI with +`requires_dist: numpy<2.0.0,>=1.11.0`. Replay condition (numpy>=2 stable +wheels) still NOT met. Leftover remains open. **Status**: deferred-non-user (replay when upstream gtsam wheels target numpy>=2) ## What is blocked