Skip to main content

Crate cvkg_render_native

Crate cvkg_render_native 

Source
Expand description

§CVKG Agentic Development Guidelines (v1.3)

All AI agents contributing to this crate MUST follow ALL eight rules:

── Karpathy Guidelines (1–4) ────────────────────────────────────────────

  1. THINK FIRST – State assumptions. Surface ambiguity. Push back on complexity.
  2. STAY SIMPLE – Minimum code. No speculative features. No unasked-for abstractions.
  3. BE SURGICAL – Touch only what’s required. Own your orphans. Don’t improve neighbors.
  4. VERIFY GOALS – Turn tasks into checkable criteria. Loop until they pass. Never commit broken.

── CVKG Extended Protocols (5–8) ──────────────────────────────────────── 5. TRIPLE-PASS – Read the target, its surrounding context, and its full call graph at least THREE TIMES before making any edit or revision. 6. COMMENT ALL – Every major pub fn, unsafe block, and non-trivial algorithm in every .rs/.ts/.h/.wgsl file MUST have a descriptive doc comment. Comments describe WHY and WHAT CONTRACT, not HOW mechanically. 7. MONITOR LOOPS – Check every tool call / command for progress every 30 seconds. After 3 consecutive identical failures, stop, write BLOCKED.md, and move to unblocked work. Never silently accept a broken state. 8. HARDWARE VERIFIED – NEVER declare success based on mock data/rendering for native crates. Any change to input, rendering, or lifecycle MUST be verified via physical loopback (e.g., cargo run -p berserker) and signal path tracing.

Sources: Karpathy: https://github.com/multica-ai/andrej-karpathy-skills CVKG Extended: Section 14 of the CVKG Design Specification (v1.3) Platform-native widget delegation using winit and AccessKit

This crate provides platform-specific rendering backends for native desktop targets

Structs§

MonitorConfig
P2-39: Multi-monitor support contract config for mixed DPI and refresh rates.
MultiMonitorManager
P2-39: Manages multi-monitor layouts, tracking scale factor updates and DPI changes during transitions.
NativeAssetManager
A concrete AssetManager for native desktop targets that loads from the local filesystem.
NativeRenderer
Native renderer backend implementing the Renderer trait. It wraps a shared SurtrRenderer for high-performance GPU drawing. During a render pass, GPU_FRAME_PTR is set so draw calls bypass the mutex.
ResizeHitTest
Hit-test helper for resize handles on windows with rounded corners.
RodioAudioEngine
Cross-platform audio engine using rodio for spatialized sound cues. Uses rodio 0.21 API: OutputStreamBuilder::open_default_stream() returns OutputStream directly. Playback via Sink::try_new(&stream.mixer()) + append.
SafeAreaInsets
Platform safe area insets (menu bar, notch, etc.).
SemanticRoleMapping
Explicit mapping from AccessKit/CVKG role to platform accessibility concepts: macOS (AXRole), Windows (UIA ControlType), and Linux (ATK Role).
SemanticRoleRegistry
Registry of semantic accessibility mappings.
StateSyncContract
State synchronization contract for a widget.
StateSyncRegistry
Registry of state synchronization contracts.
TranslationContract
mapping to platform APIs. Translation contract for a CVKG widget to its native representation.
TranslationContractRegistry
Registry of translation contracts for all widget types.
VisualHapticEngine
Visual haptic engine that translates haptic requests into visual micro-animations. Used as a cross-platform fallback where native haptics are unavailable.
VisualRegressionTracker
P2-40: Native Visual Regression Testing infrastructure. Captures and compares frames to detect platform-specific visual differences.
WidgetVirtualizationConfig
Widget virtualization configuration for large UIs.
WindowCapabilityMatrix
Window capability matrix per platform.
WindowData
WindowManager
Dynamic manager for all active native windows and their rendering contexts.
WindowStateDetector
Tracks the current WindowState based on incoming winit WindowEvents.

Enums§

AppEvent
Custom events for the native application event loop, handling accessibility callbacks and routing window lifecycle control events from background threads.
RenderingMode
Rendering mode for a widget.
SyncDirection
Bidirectional state synchronization between CVKG and native widgets.
WindowState
Represents the current state of a window.
WindowType
Window type.