Source: docs/superpowers/plans/2026-08-14-v5-context-subset-geometry-consistency.md · Plain text

V5 Context-Subset Geometry Consistency Implementation Plan

For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (- [ ]) syntax for tracking.

Goal: Add a detachable training-only V5 context-subset geometry consistency loss with strict configuration, reproducible view deletion, auditable telemetry, and no model or inference changes.

Architecture: The normal four-view V5 forward remains the supervised path. A second shared V5 encoder call removes one context view, then inserts only its density residual into the detached four-view evidence base. The unchanged fixed renderer compares counterfactual depth and visibility against the detached four-view prediction on an evidence-defined overlap.

Tech Stack: Python 3.11, PyTorch 2.7+, pytest, Ruff, YAML, existing MCSS typed states and fixed measurement renderer.

Global Constraints


Task 1: Strict opt-in configuration and deterministic subset selection

Files: - Modify: src/mcss/config.py - Create: src/mcss/context_subset_consistency.py - Modify: tests/test_config.py - Create: tests/test_context_subset_consistency.py

Interfaces: - Produces: TrainingConfig.context_subset_geometry_weight: float = 0.0. - Produces: drop_context_view(context_rgb, cameras, dropped_index) -> ContextSubset. - Produces: ramped_context_subset_geometry_weight(max_weight, optimizer_step, warmup_steps).

Task 2: Counterfactual geometry and detached consistency loss

Files: - Modify: src/mcss/context_subset_consistency.py - Modify: tests/test_context_subset_consistency.py

Interfaces: - Produces: compute_context_subset_geometry(full_state, subset_state, full_predictions, target_cameras, renderer, residual_saturation_threshold, collect_audit_diagnostics=True) -> ContextSubsetGeometryResult. - ContextSubsetGeometryResult exposes loss, tensor terms, lightweight scalar diagnostics, log-step-only audit_diagnostics, and per-sample diagnostics for scene-aware logging.

Task 3: Training integration, reproducibility, and telemetry

Files: - Modify: src/mcss/engine.py - Modify: tests/test_context_subset_consistency.py - Modify: tests/test_cli_smoke.py

Interfaces: - Consumes: the Task 1 subset and ramp helpers and Task 2 geometry result. - Produces: an independent CPU torch.Generator, conditional subset encoder/render path, weighted loss, JSONL context metadata, and checkpointed subset-generator state for enabled runs only.

Task 4: Frozen runnable configurations and operator boundary

Files: - Create: configs/synthetic_er_v5_context_subset_geometry_smoke.yaml - Create: configs/hypersim_er_v5_context_subset_geometry_train_v1.yaml - Modify: README.md

Interfaces: - Produces: a two-step CPU verification config and a V5-matched, unexecuted Hypersim proposal with weight 0.1, warmup 3000, four context views, and a new output directory.

Task 5: Verification and scope audit

Files: - Verify all files named above.

Interfaces: - Consumes: all previous task outputs. - Produces: fresh test, lint, compilation, smoke, and compatibility evidence.