MP: authentic update-record deadbands streamed from the model record (task #3)

Binary ctor @0x4a26a7-0x4a26ef: mech+0x768/76c/770 <- raw record words
0x26/0x27/0x28 (UpdatePositionDiffrence / UpdateTurnVelocityDiffrence /
UpdateTurnDegreeDiffrence x pi/180 [const @0x4a2d44]).  Read at RAW record
offsets -- the Mech__ModelResource struct is layout-skewed (field98 gave
-1.5 where the record holds 0.3; audit filed as task #4, also explains the
old forwardCycleRate "floor 25" hack).  Sender triggers now use the
authored constants: pos-deadband type 0, quat-Y delta + yaw-rate delta +
stopped-turn edge type 4 (binary @0x4aad35/@0x4aac2b/@0x4aac6c).
Verified 2-node: madcat streams 0.3/0.045/3deg, type-4 spam gone, walking
replicant clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
arcattack
2026-07-11 11:55:25 -05:00
co-authored by Claude Fable 5
parent e8b9f71025
commit a652ddcdbc
4 changed files with 105 additions and 17 deletions
+45 -14
View File
@@ -2540,23 +2540,54 @@ void
angular_deviation.Subtract(
projectedOrigin.angularPosition,
localOrigin.angularPosition);
if (
error.LengthSquared() > 0.04f
|| lastPerformance - lastUpdate > 2.0f
)
// Position deadband (binary @0x4aad35: |pos - lastSent|^2 vs the
// model's UpdatePositionDiffrence @0x768) + the 2s heartbeat.
// Guard against an unstreamed/zero deadband with the old stand-in.
{
ForceUpdate(); // type 0: position deadband + heartbeat
Scalar posDb = (updatePositionDeadband > 0.0f)
? updatePositionDeadband : 0.04f;
if (
error.LengthSquared() > posDb
|| lastPerformance - lastUpdate > 2.0f
)
{
ForceUpdate(); // type 0: pose record
}
}
// ORIENTATION rides ONLY the type-4 resync record now (the
// authentic case-0 writer/reader save-restore strips it from the
// pose record) -- request it on angular deviation or the turn
// never reaches the replicant. Binary deadbands @0x4aac2b/
// @0x4aac6c diff the live vs last-replicated angular channels
// against model constants (+0x76c/+0x770, not yet streamed);
// the quat-deviation test stands in. [T3 threshold only]
if (Abs(angular_deviation.w) < 0.997f)
// ORIENTATION rides ONLY the type-4 resync record (the authentic
// case-0 writer/reader save-restore strips it from the pose
// record). Binary triggers (@0x4aac2b / @0x4aac6c):
// |localOrigin.angular.y - projectedOrigin.angular.y| > @0x770
// |localVelocity.angular.y - projectedVelocity.angular.y| > @0x76c
// or (live yaw-rate == 0 && replicated yaw-rate != 0)
// -- the quaternion Y component and the yaw rate, against the
// model's UpdateTurnDegreeDiffrence (deg->rad) and
// UpdateTurnVelocityDiffrence. [T1 expressions; zero-deadband
// guard falls back to the old quat-w stand-in]
{
ForceUpdate(1 << MechResyncUpdateModelBit); // type 4
Scalar angDb = (updateTurnAngleDeadband > 0.0f) ? updateTurnAngleDeadband : -1.0f;
Scalar velDb = (updateTurnVelocityDeadband > 0.0f) ? updateTurnVelocityDeadband : -1.0f;
Logical resync = False;
if (angDb > 0.0f)
{
if (Abs(localOrigin.angularPosition.y
- projectedOrigin.angularPosition.y) > angDb)
resync = True;
if (Abs((Scalar)localVelocity.angularMotion.y
- (Scalar)projectedVelocity.angularMotion.y) > velDb)
resync = True;
if ((Scalar)localVelocity.angularMotion.y == 0.0f
&& (Scalar)updateVelocity.angularMotion.y != 0.0f)
resync = True;
}
else if (Abs(angular_deviation.w) < 0.997f)
{
resync = True; // stand-in when unstreamed
}
if (resync)
{
ForceUpdate(1 << MechResyncUpdateModelBit); // type 4
}
}
// Commanded-speed deadband (binary @0x4aac88): the mapper's live
// speedDemand vs the last-replicated bodyTargetSpeed -> the tiny