Recurrent replay sequence, n-step target and PER feedback A sampled anchor is eligible only when its full episode-local history and n-step horizon are available; burn-in is context, not a loss region. Replay eligibility Sequence unroll Value target Prioritized replayfeedback sample history hidden state next sampledbatch Replay transitions interleaved actor IDs Episode-local chain same episode + stepno boundary crossing Eligible anchor L unique history IDs +complete n-step horizon Sampled anchor weight normalized IS weight Sequence window t0 … tL−1; priority anchor = tL−1 Burn-in [0, B) state update onlydetached gradient Learningpositions B … L−n−1 plusfinal anchor Validity mask valid losspositions only Target history next window keepscontext Per-position loss value regressionper valid position Double-Q bootstrap online selectstarget evaluates n-step target Gₜ = Σ γⁱ rₜ₊ᵢ + γᵏQtarget(sₜ₊ₖ) Bootstrap contract terminated: zerotruncated: bootstrap Absolute value error one |TD| per trainedposition Sequence priority p = 0.9 · max(|TD|) +0.1 · mean(|TD|) Sampling probability p^alpha + optionaluniform/elite mix Importancecorrection w = (N · P)^−betanormalized by max Validated before training: n_step < sequence_length, burn_in < sequence_length, and sequence replay cannot be combined with a feature pipeline thatalready stacks history. Scope: R2D2-style recurrent replay. The package reconstructs episode-local histories and burn-in, but does not claim the complete distributed R2D2system.