ML Infra · Open Source Open-Source Research Systems · NVIDIA Cosmos 2026

Visual & World-Model Latent Retrieval Harness for ReCAP-Cosmos-Policy

Engineering a cryptographically auditable, process-isolated visual & Wan2.1 VAE latent retrieval harness upstream of NVIDIA Cosmos-Predict2.5—without touching policy weights.

TL;DR

Upstream ReCAP (Cosmos-Predict2.5-2B) relies on privileged 10D simulator object state to retrieve 8-step demonstration chunks. Without altering policy checkpoints or residual statistics, I engineered an isolated retrieval and 50-seed ablation harness spanning 10+ strategies across Qwen3-VL (2B/8B) subprocess workers and Cosmos’s native frozen Wan2.1 VAE—backed by SHA-256 index provenance, 38/38 byte-exact K=1 parity, and 48 automated pytest checks.

10+ Retrieval Strategies
48 Tests · SHA-256
37,632-D Wan2.1 VAE
38/38 Byte-Exact Parity
Zero-touch modular retrieval architecture routing process-isolated Qwen3-VL workers and native Wan2.1 VAE latent search upstream of frozen Cosmos-Predict2.5.
CHAPTER 01 · ZERO-TOUCH CONTRACT & PARITY FIRST

Process Isolation, SHA-256 Provenance, and 38/38 Byte-Exact Parity

Replacing privileged 10D object state inside a world-model policy fails silently if dependency conflicts, silent NULL fallbacks, or stale embedding caches creep into rollouts. I kept Cosmos-Predict2.5 weights and residual stats strictly frozen, isolated Qwen3-VL 2B/8B encoders and rerankers into persistent JSON-lines PNG subprocess workers, bound every embedding index with SHA-256 provenance checksums, and verified 48 pytest unit tests plus 38/38 byte-exact K=1 parity against upstream ReCAP before running a single visual ablation.

CHAPTER 02 · CATCHING A 31.7 PP VISUAL REGRESSION

Why Naive VLM Retrieval Flipped 123/124 Picks—and How We Isolated It

Four-seed smoke diagnostics immediately caught a harsh reality: naive Qwen3-VL-2B K=32 image retrieval flipped 123 of 124 Top-1 selections (57.8 ms p50 latency vs. 1.5 ms state baseline; 4.0 GiB worker peak), dropping PushT coverage from 83.9% → 52.2%. Systematic root-causing isolated two non-obvious culprits: BF16 batch numerical drift (0.999529 cosine) and a subtle pusher visual appearance mismatch between demo renders and rollouts—fixed surgically via a query-only Pymunk blue_circle draw override that never touches policy input pixels or physics.

4-seed integration smoke diagnostics comparing State GT Baseline vs. Qwen3-VL K=32 coverage/latency and log-scale representation dimensions across retrieval backends.
CHAPTER 03 · DENSE VIDEO POOLS, FP32 RERANKING & NATIVE WAN2.1 VAE

Zero-Extra-Backbone Latent Search with 1+4k Temporal Adaptation

To recover motion direction and eliminate scoring artifacts, I built sharded stride-1 causal 8-frame video pools (24,397 endpoints), replaced pool-dependent min-max normalization with fixed scale-invariant RBF fusion exp(−d²), and cast Qwen3-VL-Reranker projections to FP32 pre-sigmoid logits to stop BF16 sigmoid saturation ties.

Finally, to drop external VLM VRAM completely, I tapped Cosmos’s own frozen WanVAE_.encode deterministic posterior mean (zero policy RNG perturbation), prepending one boundary frame to satisfy 1+4k = 9-frame temporal convolutions (37,632-D GPU index) and injecting object-GT-free 4D proprioception (px, py, vx, vy) guarded by a visual_cosine_gap = 0.02 threshold.

Implemented Retrieval Strategy Matrix (PushT Demo Pool)

Strategy FamilyPool ScaleFeature DimObject GT?Key Systems / Method Fix
State GT Baseline12,951 steps10-DYesWeighted L2 (~1.5 ms); 38/38 byte-exact K=1 parity
Qwen3-VL Top-K / Image12,951 steps2,048 / 4,096-DNoIsolated JSON-lines PNG subprocess; fail-fast guards
Qwen3-VL Stride-1 Video + RBF24,397 endpoints2,048 / 4,096-DOptionalScale-invariant exp(−d²) fusion; query-only blue_circle
Two-Stage Cross-Encoder (2B/8B)Top-30 → 1Cross-EncoderNoFP32 pre-sigmoid logits eliminating saturation ties
Native Wan2.1 VAE + 4D Proprio12.9K / 24.4K12,544 / 37,632-DNoZero extra VRAM; 1+4k=9 padding; gap=0.02 guard
Technical Stack
ML InfraEval HarnessQwen3-VLWan2.1 VAECosmos-Predict2.5Pytest