Repository navigation
feat(net): generalize snapshot interpolation/reconciliation to a per-component policy registry (#462) - #483
Conversation
…component policy registry (#462)
|
Warning Review limit reached
Next review available in: 14 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughReplaces hardcoded ChangesGeneralized Component Interpolation Registry
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…mp animation-state enum, guard snapshot field widths
|



@
What & why
Closes #462.
SnapshotInterpolatorpreviously interpolated onlyTransformComponent, and client reconciliation blended only transforms — so animated / rotating / physics-driven networked entities jittered or popped on remote clients. This generalizes interpolation and reconciliation to a data-driven registry of interpolatable components, each with a per-component blend policy (lerp / slerp / step), built on the existingComponentReplicatorpath.All changes live in
Networking/Replication/(+Networking/Prediction/ClientPrediction.cpp).How
ComponentInterpolationRegistry(EInterpolationPolicy { Lerp, Slerp, Step }+ a type-erasedInterpolationEntrywith statelessHas/Capture/Interpolate/Snap/Smoothfn-pointers). Adding a networked-and-interpolated component is now oneRegister()call, not a new code path. Lazily self-registers its defaults so the snapshot paths work headless (noNetworkManager::Initializeneeded).EntitySnapshotnow uses a self-describing multi-component wire format — per entity[uuid][count]then[componentId:u32][len][bytes], wherecomponentIdis the FNV-1a-32 of the component name. Unknown ids skip by length, so the format tolerates registry drift. A singleParse()owns decoding (reused byApply,CaptureDeltabaseline, and the interpolator cache).Capture/Applystay byte-consistent, soLagCompensator/RollbackManagerround-trips are unaffected.SnapshotInterpolatoriterates the registry per entity instead of hardcoding transform.ClientPrediction::Reconcilesmoothing routes through the registrySmoothfns (transform hard-snaps past threshold; step components dont smooth), dedupd per predicted entity — identical behaviour for transforms, now extended to the registered set.ComponentReplicatorgains anAnimationStateComponentnet-subset serializer (discrete state + clip + cursor; every wire floatstd::isfinite-guarded per fix(net,task): isfinite-guard untrusted float ingestion (network snap… #400).Tests
ComponentInterpolationRegistryTest(unit) — policy table, FNV-1a wire-id hashing/uniqueness, custom-registration, multi-component snapshot round-trip, and lerp/slerp/step semantics at a fixed alpha.InterpolatedComponentsSmoothOnRemoteClientTest(Functional, the issues acceptance criterion) — a real physics body that moves and spins, snapshotted through the realEntitySnapshotpath, interpolated on a separate client scene (mirror entity, no physics). Sweeps alpha 0.25 → 0.5 → 0.75 and asserts the pose blends smoothly between the two server states — strictly interior, monotonic, never snapping to an endpoint (no per-snapshot popping).Verification
ProceduralSkyBakeTest.GeneratesNonBlackEnvironmentMapWithIBL) is an unrelated GPU env-map bake test that fails headless — no networking references.ComponentTupleCoverage,…HandlerCoverage,…SerializerCoverage,SaveGameComponentSerializerCoverage).Note for reviewers
The two helper structs are deliberately not named
*Component(InterpolationEntry,SnapshotComponentData) — OloHeaderToolsstruct …Componentscan would otherwise sweep them into the generatedAllComponents/ SaveGame / SceneSerializer.inland break the build. Documented as a CLAUDE.md pitfall.🤖 Generated with Claude Code
@
Summary by CodeRabbit
New Features
Bug Fixes
Tests