Targets the three design_v3 claims that were most load-bearing AND least exercised (sessions/realtime, training-plane boundary, the WorkUnit-generality falsifier). All fit with no new runtime primitive (127 tests pass). 1. Interactive world-model session (runtime/session.py, §9.8) — the Session plane had ZERO coverage. WorldModelSession drives the causal chunk_rollout loop as a long-lived session: persistent cross-request world state on the Session.kv_handle, frame streaming, transactional step-boundary cancellation (a cancelled act leaves the world resumable), no cross-session smearing. Added only a continuation seam to the chunk loop (init seeds context from a world_context slot; default empty = unchanged one-shot path). 5 tests. 2. End-to-end RL over a cross-model workflow (training/methods/workflow_rl.py, §9.9) — trains BOTH flux-t2i and wan-i2v from ONE final-video reward. Rolls out the whole workflow with SDE capture in both instances; the same final advantage drives FlowGRPO PPO on each stage's transformer; two WeightSyncPlans on two instances. The earlier model (T2I) is trained by a reward on the final video — end-to-end credit across a model boundary — proven causal by a control (constant reward => zero advantage => nothing moves). 4 tests. 3. Heterogeneous WorkUnit co-scheduling (models/tiled/, §9.10) — the §17 falsifier. VAETileLoop makes VAE decode a loop of VAE_TILE units; tiling is exact (== one-shot, C0), and VAE_TILE + DIFFUSION_STEP pipelines interleave bit-identically and co-run in one batch. Validates the mechanism; the economic half (does it pay) stays a port-time measurement. 4 tests. designv4 §9.8–§9.10 + falsifier/layout/closing updates (127 tests, 20 files).
38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
"""Training plane — rollout records behavior on the same loops it serves (design_v3 §10).
|
|
|
|
Dependency rule (enforced): ``training`` imports ``card``/``loop``/``runtime``/``models``; the
|
|
engine never imports ``training``. The rollout forward IS the serve forward plus capture.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from .behavior import BehaviorRecord, TrajectoryStatus
|
|
from .methods import (
|
|
DiffusionNFTMethod,
|
|
DMD2Method,
|
|
FineTuneMethod,
|
|
JointMultiExpertRL,
|
|
SelfForcingMethod,
|
|
TrainingMethod,
|
|
UnifiedRLMethod,
|
|
WorkflowRLMethod,
|
|
build_diffusion_nft,
|
|
build_dmd2,
|
|
build_finetune,
|
|
build_joint_multi_rl,
|
|
build_self_forcing,
|
|
build_unified_rl,
|
|
build_workflow_rl,
|
|
)
|
|
from .rewards import MultiRewardScorer, build_multi_reward_scorer
|
|
from .rollout import RolloutContext, Trajectory, TrajectoryBuffer, rollout_loop
|
|
from .weight_sync import WeightRole, WeightSyncPlan
|
|
|
|
__all__ = [
|
|
"TrainingMethod", "FineTuneMethod", "DMD2Method", "DiffusionNFTMethod", "SelfForcingMethod",
|
|
"UnifiedRLMethod", "JointMultiExpertRL", "WorkflowRLMethod",
|
|
"build_finetune", "build_dmd2", "build_diffusion_nft", "build_self_forcing", "build_unified_rl",
|
|
"build_joint_multi_rl", "build_workflow_rl",
|
|
"BehaviorRecord", "TrajectoryStatus", "Trajectory", "TrajectoryBuffer", "RolloutContext",
|
|
"rollout_loop", "WeightSyncPlan", "WeightRole", "MultiRewardScorer", "build_multi_reward_scorer",
|
|
]
|