# VACT (Vector Agent Context Transport) — Architectural Specification > **Protocol Version**: 1.0.0 > **Architecture**: Direct3D 11 Compute Shader Pipeline & Win32 IPC Transport > **Repository**: https://github.com/fy2ne/VACT > **Documentation**: https://vact.fy2ne.me > **License**: Apache License 2.0 --- ## 1. Executive Summary & Design Rationale Autonomous desktop agents running on computer-use models have historically relied on brute-force screenshot polling. A multimodal model receives periodic high-resolution images of the desktop, attempts to visually identify interface elements, and infers click coordinates. This design introduces three severe failure modes: 1. **Latency Bottleneck (800ms - 2500ms)**: Capturing, PNG-encoding, transmitting, and ingesting high-resolution images cripples real-time reactive behavior. 2. **Spatial Coordinate Drift**: Multimodal vision models approximate spatial layout from 2D pixel grids, leading to frequent misses on small targets (buttons, menu items, close icons). 3. **Token & Bandwidth Cost**: Sending ~2,200 tokens per action step across 50 steps rapidly consumes context windows and accumulates substantial inference costs. **VACT (Vector Agent Context Transport)** solves this by moving perception to the local GPU framebuffer. Using Direct3D 11 compute shaders, VACT converts raw pixels into structured vector bounding geometry in 4.8ms at native 60 FPS. Agents receive mathematically grounded sub-pixel centroids and differential DAG mutations over a local Win32 named pipe (`\\.\pipe\VACT`), achieving a 99.8% token reduction and zero coordinate drift. --- ## 2. Technical Pipeline Specification ### Stage 1: Zero-Copy Desktop Duplication (DXGI 1.6) Acquires the desktop swapchain surface directly into a Direct3D 11 GPU texture (`DXGI_FORMAT_B8G8R8A8_UNORM`) without crossing the PCIe bus to host system memory. ### Stage 2: Bilateral Range Filtering (HLSL CS 5.0) Applies a combined domain and range filter to remove high-frequency texture noise (sub-pixel font anti-aliasing, wallpaper gradients) while preserving crisp element boundaries: $$I_{\text{filtered}}(p) = \frac{1}{W_p} \sum_{q \in \Omega} I(q) \cdot g_s(\|p - q\|) \cdot g_r(|I(p) - I(q)|)$$ ### Stage 3: Spatial Gradient Derivative Tensor (Sobel CS 5.0) Calculates discrete spatial intensity gradients to isolate rectangular UI borders, input boxes, and clickable boundaries: $$G_x = \begin{bmatrix} -1 & 0 & 1 \\ -2 & 0 & 2 \\ -1 & 0 & 1 \end{bmatrix} * I, \quad G_y = \begin{bmatrix} -1 & -2 & -1 \\ 0 & 0 & 0 \\ 1 & 2 & 1 \end{bmatrix} * I$$ $$\|\nabla I\| = \sqrt{G_x^2 + G_y^2}$$ ### Stage 4: Parallel Connected Component Labeling (CCL CS 5.0) A two-pass GPU compute shader groups contiguous gradient edges into discrete bounding rectangles, computing the spatial centroid for each interactable element: $$c_x = \frac{x_{\min} + x_{\max}}{2}, \quad c_y = \frac{y_{\min} + y_{\max}}{2}$$ ### Stage 5: Monotonic Differential DAG & IPC Streaming Instead of retransmitting full desktop state, VACT tracks a state DAG and emits incremental mutations (`INSERT`, `UPDATE`, `REMOVE`) over a local Win32 named pipe (`\\.\pipe\VACT`). --- ## 3. Wire Protocol Format Differential frames are serialized as lightweight JSON or zero-copy binary: ```json { "protocol": "VACT/1.0", "sequence": 41209, "timestamp_ns": 1757089421092834, "tree_state": "DIFF", "frame_metrics": { "dt_ms": 4.82, "fps": 60.1, "gpu_vram_mb": 31.4 }, "mutations": [ { "op": "UPDATE", "id": "btn_deploy", "role": "button", "bbox": [920.0, 412.0, 1140.0, 456.0], "center": [1030.0, 434.0], "label": "Deploy Worker", "confidence": 0.998 } ] } ``` --- ## 4. Benchmark Comparison | Metric | Screenshot VLM | VACT Protocol | |---|---|---| | Latency per Step | 800 - 2,500 ms | 4.8 ms (60 FPS) | | Token Usage per Step | ~2,200 tokens | 80 - 180 tokens | | Target Accuracy | ~15-40px drift | Sub-pixel exact | | Payload Size | ~1.8 MB PNG | Sub-2 KB JSON/Binary | | Network Privacy | Transmits desktop to cloud | 100% local, air-gapped | --- ## 5. Technical FAQ ### What does VACT stand for? VACT stands for **Vector Agent Context Transport**. It defines a high-frequency perceptual transport layer that translates raw graphical desktop pixels into structured vector context for AI agents. ### How does an agent consume VACT? Agents connect to the local named pipe `\\.\pipe\VACT` using the official Rust, TypeScript, or Python SDKs. The SDK fires event callbacks on each differential frame, giving the agent live UI coordinates. ### Is VACT cloud-dependent? No. VACT is entirely local and air-gapped. Frame capture, GPU shaders, and named pipe IPC run entirely on the host machine.