A Real-Time Sub-Pixel Vector Scene Graph Protocol & Hardware Action Dispatch Engine for Autonomous AI Agents
Architected & Created by fy2ne
Author & Attribution • Abstract • Mathematical Formulation • Latency Budget • Benchmarks • Architecture • Quick Start • Google AI Setup Guide
VACT (Vector Agent Context Transport) was conceived, architected, and engineered by fy2ne (fy2ne.me, hello@fy2ne.me).
- Primary Creator & Lead Architect: fy2ne
- Official Repository: https://github.com/fy2ne/VACT
- Author Website: https://fy2ne.me
- Specification: VACT/1.0 Open Protocol Specification
Traditional vision-based desktop automation relies on brute-force raster ingestion: periodically capturing full-screen bitmapped images (
-
High Ingestion Latency: Capturing, encoding, uploading, and processing full raster bitmaps requires
$1,000\text{–}1,800\text{ ms}$ per decision cycle. -
Context Window Saturation: High token footprints (
$1,600\text{–}2,400\text{ tokens}$ per screen state) exhaust LLM context windows during multi-turn workflows. - Spatial Misalignment: Sub-pixel discretization noise and UI anti-aliasing artifacts trigger click hallucination and target drift.
VACT replaces raster transmission with a continuous GPU-accelerated Vector Semantic Scene Graph DAG (Directed Acyclic Graph). Using zero-copy Windows DXGI Desktop Duplication, Direct3D11/WGSL bilateral saliency compute kernels, two-pass connected-component labeling (CCL), and hardware WinRT OCR, VACT extracts structured UI elements directly in GPU VRAM and streams incremental topological mutations (
VACT models the operating system display surface as a bounded two-dimensional Riemannian manifold
To eliminate wallpaper gradients and high-frequency textural noise while preserving non-linear UI boundaries, the GPU compute kernel implements an edge-preserving bilateral filter:
where:
-
$\Omega_r(p) = {q \in \mathbb{Z}^2 \mid |p - q|_\infty \le r}$ denotes the spatial neighborhood window of radius$r = 3$ . -
$G_{\sigma_s}(d) = \exp\left(-\frac{d^2}{2\sigma_s^2}\right)$ is the spatial Euclidean distance Gaussian weight ($\sigma_s = 2.5$ ). -
$G_{\sigma_r}(\delta) = \exp\left(-\frac{\delta^2}{2\sigma_r^2}\right)$ is the photometric range Gaussian weight ($\sigma_r = 0.15$ ). -
$W_p = \sum_{q \in \Omega_r(p)} G_{\sigma_s}(|p - q|) \cdot G_{\sigma_r}(|I(p) - I(q)|)$ is the partition function ensuring conservation of local energy.
The spatial saliency field
The local gradient energy magnitude and orientation are computed as:
A pixel
To close micro-discontinuities across UI borders while eliminating isolated stroke noise, mathematical morphology operators are applied via GPU compute passes:
where
Connected edge regions are partitioned into disjoint equivalence classes
Each component
To ensure absolute resolution independence across arbitrary display scaling factors (
Let
Only
Every stage of the VACT pipeline is bounded by deterministic sub-millisecond execution times on standard consumer GPU and CPU hardware:
| Pipeline Stage | Mathematical Operator | Algorithmic Complexity | Execution Unit | Mean Latency | Memory Footprint |
|---|---|---|---|---|---|
| 01. Frame Duplication | Direct surface mapping | DirectX 11 / DXGI |
|
||
| 02. Bilateral Saliency | Spatial-range convolution | wgpu / WGSL Compute |
|
||
| 03. Gradient Tensor | Sobel convolution |
wgpu / WGSL Compute |
|
||
| 04. Morphology | Opening |
wgpu / WGSL Compute |
|
||
| 05. CCL Extraction | Two-pass union-find | CPU AVX2 Vectorized |
|
||
| 06. Optical Recognition | Hardware neural OCR | Windows WinRT OCR | Dynamic (ROIs only) | ||
| 07. DAG Diffing | Hash-indexed tree diff | Rust vact-protocol
|
|||
| 08. IPC Framing | Length-prefixed binary stream | Win32 Named Pipe |
|
||
| Total Engine Latency | Full Perception Cycle | — | DirectX 11 + Rust |
Comparative benchmark evaluating full-screen operating system control (
| Architectural Approach | Perception Latency | Bandwidth / Frame | Token Overhead / Step | Action Precision | Frame Rate |
|---|---|---|---|---|---|
| Cloud VLM + Screenshots (GPT-4o / Claude 3.5 Sonnet) |
|
||||
| Accessibility APIs (OS Trees) (Win32 UIA / Apple AX) |
|
Blind to GPU/Canvas | |||
| Local Multimodal Model (YOLO-UI + Tesseract OCR) | |||||
| VACT Engine (fy2ne) (DirectX Bilateral + Vector DAG) |
|
Sub-pixel exact |
-
$250\times$ Latency Reduction: From$1,250\text{ ms}$ down to$4.8\text{ ms}$ . -
$99.8%$ Bandwidth Efficiency: Payload compressed from$\sim 1.5\text{ MB}$ raster images to structured$<2\text{ KB}$ vector updates. -
$92.5%$ Token Savings: Eliminates raw image tile embeddings, drastically reducing inference cost per mission step.
┌────────────────────────────────────────────────────────────────────────┐
│ Google Cloud Vertex AI & Google AI Studio │
│ Gemini 2.5 Flash / Gemini 2.5 Pro / Gemini 2.0 (High Precision) │
└───────────────────────────────────▲────────────────────────────────────┘
│ VACT Protocol (<2KB Vector AST)
┌───────────────────────────────────▼────────────────────────────────────┐
│ vactd Native Rust Daemon │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ 1. Zero-Copy DXGI Desktop Duplication API (Direct3D 11) │ │
│ │ 2. GPU Bilateral Saliency Compute Kernel (WGSL) │ │
│ │ 3. Sobel Gradient & Hysteresis Boundary Extractor │ │
│ │ 4. Morphological Filter Pipeline (Erosion / Dilation) │ │
│ │ 5. Connected-Component Labeling (CCL) & Spatial Matrix Hashing │ │
│ │ 6. Hardware WinRT OCR Engine (Text Token Extraction) │ │
│ │ 7. Differential Scene Graph DAG Engine (Delta Mutation Stream) │ │
│ │ 8. Hardware I/O Dispatcher (Win32 SendInput Sub-Pixel Synced) │ │
│ │ 9. Global F12 Emergency Kill-Switch & Arm Safety Gate │ │
│ └──────────────────────────────────────────────────────────────────┘ │
└───────────────────────────────────▲────────────────────────────────────┘
│
┌───────────────────────────────────▼────────────────────────────────────┐
│ Windows GPU Compositor (DWM) │
└────────────────────────────────────────────────────────────────────────┘
The repository is structured as a unified monorepo:
crates/vactd: The core Windows service. Hosts DXGI capture, D3D11/wgpu WGSL compute shaders, WinRT OCR, Win32 SendInput I/O bus, SQLite spatial memory (vact_memory.db), transparent F3 scientific HUD, and IPC named pipe server (\\.\pipe\vact-ipc).crates/vact-core: Core spatial math, normalized device coordinates, color quantization, and semantic role inference.crates/vact-protocol: Wire protocol specification, AST scene graph definitions with 16 semantic roles, and incremental DAG diffing engine.
sdks/typescript: Full-featured TypeScript/Node.js client withVactClient,SceneQuery,StateManager,AgentContext, and EventEmitter-driven delta subscription.sdks/python: Asynchronous Python client built with Pydantic models for LangChain, AutoGen, and native agent integration.
apps/agent-runner: Autonomous execution CLI supporting Google Cloud Vertex AI, Google AI Studio Gemini, and OpenCode, with ASCII wireframe terminal rendering and execution telemetry logging.
Launch vactd with --overlay to project an interactive hardware telemetry HUD directly over the operating system (WS_EX_LAYERED | WS_EX_TRANSPARENT | WDA_EXCLUDEFROMCAPTURE):
cargo run -p vactd --release -- start --overlay- Telemetry Dashboard: Live FPS counter, DXGI frame time, GPU compute shader latency, WinRT OCR processing duration, DAG assembly time, and active target window.
-
Coordinate Matrix: Real-time spatial quantization grid with
$160\text{px}$ boundary ticks. - Topological Hitboxes: Color-coded cybernetic brackets displaying element identification, aspect ratio, bounding area, and OCR text labels.
-
Dynamic Action Reticle: Visual target lock (
[ ✛ ] AI TARGET LOCK) rendered upon synthetic action dispatch.
Ensure you have Rust 1.80+ and the MSVC C++ toolchain installed on Windows:
# Build workspace
cargo build --workspace --release
# Run daemon with live scientific HUD overlay
cargo run -p vactd --release -- start --overlay
# Run single frame capture and dump JSON scene graph
cargo run -p vactd -- once
# Execute hardware compute & OCR benchmark suite
cargo run -p vactd -- benchConfigure apps/agent-runner/.env from .env.example:
cd apps/agent-runner
npm install
npm.cmd run build
# Start interactive CLI wizard
npm.cmd run dev
# Or dispatch a direct autonomous mission
npm.cmd start -- --mission "Open Task Manager and inspect CPU utilization"- Emergency Kill-Switch: Press F12 at any time to instantly freeze synthetic mouse and keyboard dispatch.
- Re-Arm: Press Ctrl + F12 to re-arm the I/O bus.
- Anti-Recursion Protection: The HUD overlay uses
WDA_EXCLUDEFROMCAPTUREto eliminate DXGI capture loop recursion.
This project is licensed under the Apache License 2.0 — see the LICENSE file for details.
VACT: Vector Agent Context Transport Protocol
Conceived, Architected & Engineered by fy2ne (hello@fy2ne.me) • fy2ne.me
Open Source Software under Apache-2.0 • Specifications VACT/1.0
