# arcanelantern/a7iii-open-gate-test architecture

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

- Interactive diagram: https://gitdiagram.com/arcanelantern/a7iii-open-gate-test
- Repository: https://github.com/arcanelantern/a7iii-open-gate-test

## Overview

This repository is a collection of Sony A7 III firmware 4.04 camera test kits, not a general camera-management application. A tester launches a platform kit, which probes a camera over USB and records observations; the open-gate kit can additionally apply a firmware-specific test helper and collect a debug dump. Separate read-only kits check service-mode files and PMHOME visibility, while CT1 supports first-contact USB checks and offline comparison. The map follows shown references and README behavior; several implementation details are unsampled, so uncertain links are omitted.

Main entry points: [`windows/tools/camera_tests/K2_open_gate/m3og.py`](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/m3og.py) (Open-gate controller), [`windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py`](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py) (USB service stage), [`windows/tools/camera_tests/CT1_usb_first_contact/ct1_common.py`](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_common.py) (CT1 shared guards), [`windows/tools/camera_tests/CT1_usb_first_contact/ct1_compare.py`](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_compare.py) (Offline comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ct1["CT1 USB checks"]
  node_ctcommon["CT1 shared guards<br/>[ct1_common.py]"]
  node_ctstage["USB service stage"]
  node_ctsim["Camera simulator<br/>[ct1_sim.py]"]
  node_ctpredict["Frozen predictions<br/>[ct1_predict.py]"]
  node_ctcompare["Offline comparison<br/>[ct1_compare.py]"]
end

subgraph group_readonly["Read-only checks"]
  node_m3check["Service file check<br/>[m3_check.py]"]
  node_pmhome["PMHOME check<br/>[pmhome_check.py]"]
end

subgraph group_opengate["Open-gate tests"]
  node_openkit["Open-gate controller<br/>[m3og.py]"]
  node_emu["Helper emulator<br/>[emu_m3og.py]"]
end

subgraph group_helper["Helper runtime"]
  node_helperc["Firmware helper<br/>[m3og.c]"]
  node_design["Firmware design data<br/>[m3og_design.h]"]
end

node_tester(("Tester"))
node_camera(("A7 III camera"))
node_usb["USB transport"]

node_tester -->|"runs"| node_ctstage
node_ctstage -->|"uses guards"| node_ctcommon
node_ctstage -->|"evaluates backup"| node_ctcompare
node_ctstage -->|"exchanges data"| node_usb
node_usb -.->|"reaches"| node_camera
node_ctsim -->|"uses shared rules"| node_ctcommon
node_ctcompare -->|"uses shared parsers"| node_ctcommon
node_ctcompare -->|"reads predictions"| node_ctpredict
node_tester -->|"runs"| node_m3check
node_m3check -->|"uses shared guards"| node_ctcommon
node_tester -->|"runs"| node_pmhome
node_tester -->|"runs tests"| node_openkit
node_openkit -->|"uses shared utilities"| node_ctcommon
node_openkit -->|"uses comparison"| node_ctcompare
node_openkit -->|"uses service stage"| node_ctstage
node_openkit -->|"uses simulator"| node_ctsim
node_openkit -->|"sends helper"| node_helperc
node_helperc -->|"uses design data"| node_design
node_emu -->|"runs helper"| node_helperc

click node_ctcommon "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_common.py"
click node_ctstage "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py"
click node_ctsim "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_sim.py"
click node_ctpredict "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_predict.py"
click node_ctcompare "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_compare.py"
click node_m3check "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K1_readonly/m3_check.py"
click node_pmhome "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K1_readonly/pmhome_check.py"
click node_openkit "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/m3og.py"
click node_emu "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/helper/emu_m3og.py"
click node_helperc "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/helper/m3og.c"
click node_design "https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/helper/m3og_design.h"

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_ctcommon,node_ctstage,node_ctsim,node_ctpredict,node_ctcompare toneBlue
class node_m3check,node_pmhome toneAmber
class node_openkit,node_emu toneMint
class node_helperc,node_design toneRose
class node_tester,node_camera,node_usb toneIndigo
```

## Components

### CT1 USB checks

- [CT1 shared guards](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_common.py): `windows/tools/camera_tests/CT1_usb_first_contact/ct1_common.py`
- [USB service stage](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py): `windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py`
- [Camera simulator](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_sim.py): `windows/tools/camera_tests/CT1_usb_first_contact/ct1_sim.py`
- [Frozen predictions](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_predict.py): `windows/tools/camera_tests/CT1_usb_first_contact/ct1_predict.py`
- [Offline comparison](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/CT1_usb_first_contact/ct1_compare.py): `windows/tools/camera_tests/CT1_usb_first_contact/ct1_compare.py`

### Read-only checks

- [Service file check](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K1_readonly/m3_check.py): `windows/tools/camera_tests/K1_readonly/m3_check.py`
- [PMHOME check](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K1_readonly/pmhome_check.py): `windows/tools/camera_tests/K1_readonly/pmhome_check.py`

### Open-gate tests

- [Open-gate controller](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/m3og.py): `windows/tools/camera_tests/K2_open_gate/m3og.py`
- [Helper emulator](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/helper/emu_m3og.py): `windows/tools/camera_tests/K2_open_gate/helper/emu_m3og.py`

### Helper runtime

- [Firmware helper](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/helper/m3og.c): `windows/tools/camera_tests/K2_open_gate/helper/m3og.c`
- [Firmware design data](https://github.com/arcanelantern/a7iii-open-gate-test/blob/main/windows/tools/camera_tests/K2_open_gate/helper/m3og_design.h): `windows/tools/camera_tests/K2_open_gate/helper/m3og_design.h`

### Other components

- **Tester**
- **A7 III camera**
- **USB transport**

## Connections

- Tester → USB service stage: runs (evidence: `windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py`)
- USB service stage → CT1 shared guards: uses guards (evidence: `windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py`)
- USB service stage → Offline comparison: evaluates backup (evidence: `windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py`)
- USB service stage → USB transport: exchanges data (evidence: `windows/tools/camera_tests/CT1_usb_first_contact/ct1_stage2_service.py`)
- USB transport → A7 III camera: reaches
- Camera simulator → CT1 shared guards: uses shared rules (evidence: `windows/tools/camera_tests/CT1_usb_first_contact/ct1_sim.py`)
- Offline comparison → CT1 shared guards: uses shared parsers (evidence: `windows/tools/camera_tests/CT1_usb_first_contact/ct1_compare.py`)
- Offline comparison → Frozen predictions: reads predictions (evidence: `windows/tools/camera_tests/CT1_usb_first_contact/ct1_compare.py`)
- Tester → Service file check: runs (evidence: `windows/tools/camera_tests/K1_readonly/m3_check.py`)
- Service file check → CT1 shared guards: uses shared guards (evidence: `windows/tools/camera_tests/K1_readonly/m3_check.py`)
- Tester → PMHOME check: runs (evidence: `windows/tools/camera_tests/K1_readonly/pmhome_check.py`)
- Tester → Open-gate controller: runs tests (evidence: `windows/tools/camera_tests/K2_open_gate/m3og.py`)
- Open-gate controller → CT1 shared guards: uses shared utilities (evidence: `windows/tools/camera_tests/K2_open_gate/m3og.py`)
- Open-gate controller → Offline comparison: uses comparison (evidence: `windows/tools/camera_tests/K2_open_gate/m3og.py`)
- Open-gate controller → USB service stage: uses service stage (evidence: `windows/tools/camera_tests/K2_open_gate/m3og.py`)
- Open-gate controller → Camera simulator: uses simulator (evidence: `windows/tools/camera_tests/K2_open_gate/m3og.py`)
- Open-gate controller → Firmware helper: sends helper (evidence: `windows/tools/camera_tests/K2_open_gate/helper/m3og.c`)
- Firmware helper → Firmware design data: uses design data (evidence: `windows/tools/camera_tests/K2_open_gate/helper/m3og.c`)
- Helper emulator → Firmware helper: runs helper (evidence: `windows/tools/camera_tests/K2_open_gate/helper/emu_m3og.py`)
