acdream/src/AcDream.Core/Physics
Erik 88348f6791 fix(physics): #299 — port retail's mover-side IsImpenetrable exemption branch
CollisionExemption checked only the TARGET's IsImpenetrable, and the class doc
asserted "retail's pseudo-C only checks the target's IsImpenetrable(); acdream
follows retail" while blaming ACE for checking both. That was backwards: ACE was
retail-faithful and acdream was missing half the check.

Retail short-circuits on EITHER the mover's own state & IS_IMPENETRABLE (0x80)
OR the target's IsImpenetrable(); either alone exempts. Verified at the byte
level rather than from the decompiler's rendering — Binary Ninja shows the mover
test as `int16_t state_1 ... if (state_1 < 0)`, which reads like a 0x8000 test,
but decoding the PDB-paired binary at the mapped offset gives:

    8b 43 04   mov  eax,[ebx+4]     ; mover object_info.state
    f6 c4 01   test ah,1            ; 0x100  IsPlayer
    84 c0      test al,al           ; sign bit of AL = state & 0x80
    78 3d      js   ...             ; -> collide

`test al, al; js` is a byte-level sign test on AL, i.e. 0x80, not 0x8000.
Corroborated downstream in the same block (`test ah,8` = 0x800 IsPK,
`test ah,0x10` = 0x1000 IsPKLite) and by OBJECTINFO::init @0x0050cf30 setting
state |= 0x80 from the object's own IsImpenetrable().

Also corrected: ACCWeenieObject::IsImpenetrable @0x0058c8c0 returns
(_bitfield >> 0x15) & 1 — retail genuinely conflates BF_FREE_PKSTATUS with
"impenetrable", so acdream's FromPwdBitfield decode was already right.

Both retail arms set collide, so ordering between them is semantically free and
a misreading here could only ever produce spurious collisions, never a
walk-through.

Found while investigating #297; not symptom-causing on its own. No divergence
row: this retires a missing port rather than introducing a deviation, and
nothing in the register or the collision digest's DO-NOT-RETRY tables covers it.

Gates: complete Release solution 10,887 passed / 4 skipped / 0 failed
(baseline 10,867/4/0). Adversarial + retail-conformance review PASS on this
change specifically. Both new tests discrimination-verified by reverting the
branch and confirming failure.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-03 20:13:05 +02:00
..
Motion fix(physics): P5 commit 3 - retire TS-35, close #167 (ConstraintManager leash) 2026-07-30 12:12:29 +02:00
AceModernCommandCatalog.cs feat(L.1b): dual MotionCommand catalog — AceModern runtime + Retail2013 conformance 2026-06-30 22:13:36 +02:00
AnimationCommandRouter.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
AnimationHookRouter.cs feat(anim): Phase E.1 hook router + GameWindow wiring 2026-04-18 16:30:23 +02:00
AnimationSequencer.cs fix(animation): harden presentation phase handoffs 2026-07-21 10:01:25 +02:00
BSPQuery.cs fix(physics): restore retail path-6 collision response 2026-07-31 13:44:55 +02:00
BuildingPhysics.cs T6 (BR-7) C3: per-cell shadow architecture - flood registration, building channel, per-cell query; b3ce505 stopgap DELETED (closes #99) 2026-06-11 14:37:50 +02:00
CellArray.cs feat(runtime): seal dormant SetPosition evaluations 2026-08-01 11:31:58 +02:00
CellDump.cs feat(phys): A6.P3 #98 Step 2 — cell-dump probe + roundtrip test 2026-05-23 15:16:56 +02:00
CellSurface.cs refactor(physics): remove parsed collision graphs 2026-07-25 18:21:19 +02:00
CellTransit.cs feat(runtime): seal dormant SetPosition evaluations 2026-08-01 11:31:58 +02:00
CollisionExemption.cs fix(physics): #299 — port retail's mover-side IsImpenetrable exemption branch 2026-08-03 20:13:05 +02:00
CollisionPrimitives.cs feat(physics): Task 2 — true sphere collision primitive (CSphere::intersects_sphere) 2026-06-24 19:08:53 +02:00
CollisionShadowVerifier.cs perf(physics): cut production traversal to flat assets 2026-07-25 17:00:04 +02:00
CollisionTraversal.cs fix(physics): validate retail cell containment roots 2026-07-31 14:48:26 +02:00
CollisionWorldState.cs wip(physics): collision O(changed) delta-commit (O1-O3) - ON HOLD, feel-test failed 2026-08-02 20:06:59 +02:00
EncumbranceSystem.cs feat(physics): Campaign P P1 - stat-coupled movement (burden/stamina/vitae) 2026-07-30 08:18:06 +02:00
EntityCollisionFlags.cs fix(physics): AP-71 - port check_entry_restrictions at the head of indoor FindEnvCollisions 2026-07-30 10:30:45 +02:00
FlatBspQuery.cs fix(physics): restore retail path-6 collision response 2026-07-31 13:44:55 +02:00
FlatCollisionAssetBuilder.cs feat(content): bake and read flat collision assets 2026-07-25 15:22:08 +02:00
FlatCollisionAssets.cs perf(physics): cut production traversal to flat assets 2026-07-25 17:00:04 +02:00
GfxObjDump.cs feat(phys): A6.P3 #98 — GfxObj dump infrastructure (ACDREAM_DUMP_GFXOBJS) 2026-05-23 20:24:26 +02:00
IAnimationHookSink.cs feat(#188): fading-wall + sliding-door translucency; hold open past animation settle 2026-07-09 09:17:50 +02:00
IMotionCommandCatalog.cs feat(L.1b): dual MotionCommand catalog — AceModern runtime + Retail2013 conformance 2026-06-30 22:13:36 +02:00
InterpolationManager.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
InterpretedMotionFunnel.cs fix(R4-V5): moveto wedge - StopCompletely's missing animation dispatch orphaned pending_motions; + the P1 autonomous store family 2026-07-03 14:15:36 +02:00
LandDefs.cs feat(physics #145): Slice 1 — Position/Frame types + LandDefs.GetBlockOffset (0x0043e630) 2026-06-21 10:30:20 +02:00
MotionCommandResolver.cs feat(L.1b): dual MotionCommand catalog — AceModern runtime + Retail2013 conformance 2026-06-30 22:13:36 +02:00
MotionInterpreter.cs fix #270 closeout: strip investigation probes; close the issue 2026-07-31 07:26:57 +02:00
MovementSystem.cs fix #266: retail run-rate 800 branch is exact-equality sentinel, not a cap 2026-07-30 19:22:41 +02:00
ObjectRangeMath.cs fix(items): use retail cylinder range for loot windows 2026-07-17 20:32:34 +02:00
PhysicsBody.cs feat(runtime): commit dormant SetPosition activation 2026-08-01 14:25:02 +02:00
PhysicsDataCache.cs wip(physics): collision O(changed) delta-commit (O1-O3) - ON HOLD, feel-test failed 2026-08-02 20:06:59 +02:00
PhysicsDiagnostics.cs fix(physics): guard the world-frame agreement proven unreachable by measurement 2026-08-03 14:33:46 +02:00
PhysicsEngine.cs wip(physics): collision O(changed) delta-commit (O1-O3) - ON HOLD, feel-test failed 2026-08-02 20:06:59 +02:00
PhysicsObjUpdate.cs feat(runtime): commit dormant SetPosition activation 2026-08-01 14:25:02 +02:00
PhysicsResolveCapture.cs test: fix PhysicsResolveCapture/PhysicsDiagnostics static-leak isolation 2026-06-02 15:20:24 +02:00
PhysicsSetPosition.cs feat(runtime): seal dormant SetPosition evaluations 2026-08-01 11:31:58 +02:00
PhysicsTimestampGate.cs feat(runtime): own initial create residence transaction 2026-08-01 19:35:08 +02:00
PlayerWeenie.cs fix #266: retail run-rate 800 branch is exact-equality sentinel, not a cap 2026-07-30 19:22:41 +02:00
PortalInfo.cs feat(physics): Phase 2 — wire CellBSP + Portals into CellPhysics 2026-05-19 16:52:20 +02:00
PortalPlane.cs fix(core): Phase B.3 — add centroid + radius bounds to PortalPlane crossing test 2026-04-12 19:08:46 +02:00
Position.cs refactor(physics #145): Slice 1 — rename Frame->CellFrame to avoid DatReaderWriter.Types.Frame collision 2026-06-21 10:34:36 +02:00
PositionFrameValidation.cs feat(net): port retail physics spawn and event timestamps 2026-07-14 00:22:17 +02:00
ProjectilePhysicsStepper.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RawMotionState.cs feat(R3-W1): retail state completion — action FIFOs, MovementParameters, MotionNode, WeenieError renumber (closes J2, J16-codes) 2026-07-02 22:12:33 +02:00
RemoteMotionCombiner.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RemoteWeenie.cs fix(R4-V5): #160 remote run movetos in slow motion - remote interps had no weenie, so retail's run-rate chain never reached my_run_rate 2026-07-03 16:18:40 +02:00
ResolveResult.cs refactor(runtime): own local movement and outbound cadence 2026-07-26 12:33:53 +02:00
Retail2013CommandCatalog.cs feat(L.1b): dual MotionCommand catalog — AceModern runtime + Retail2013 conformance 2026-06-30 22:13:36 +02:00
RetailFrameMath.cs feat(physics): port retail projectile integration 2026-07-14 11:43:11 +02:00
RetailObjectActivityGate.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RetailObjectManagerTail.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RetailObjectQuantumClock.cs feat(physics): port retail complete object frame pipeline 2026-07-20 09:10:31 +02:00
RetailPhysicsStateTransition.cs feat(vfx): port retail hidden and teleport presentation 2026-07-14 14:59:48 +02:00
ServerControlledLocomotion.cs fix(combat): persist death and retarget on kill 2026-07-12 09:19:38 +02:00
ShadowEntrySnapshot.cs perf(physics): pool collision cell snapshots 2026-07-23 06:12:34 +02:00
ShadowObjectRegistry.cs wip(physics): collision O(changed) delta-commit (O1-O3) - ON HOLD, feel-test failed 2026-08-02 20:06:59 +02:00
ShadowShape.cs feat(phys): add ShadowShape record (no callers yet) 2026-05-24 15:07:40 +02:00
ShadowShapeBuilder.cs perf(physics): cut production traversal to flat assets 2026-07-25 17:00:04 +02:00
SpawnPlacementSettler.cs feat(runtime): C3c - production placement cutover: both hosts on the residence conductors (routes 1+8) 2026-08-02 18:10:33 +02:00
TerrainSurface.cs fix(physics): AP-10 - restore retail's 0.1m dry-corner water sink-in; wire WATER_CONTACT_TS 2026-07-30 10:52:39 +02:00
TransitionScratchArena.cs perf(physics): reuse reset-complete transition scratch 2026-07-25 14:37:02 +02:00
TransitionTypes.cs feat(runtime): seal dormant SetPosition evaluations 2026-08-01 11:31:58 +02:00
WalkMissDiagnostic.cs feat(physics): WalkMissDiagnostic aggregator for ISSUES #83 probe spike 2026-05-20 10:31:39 +02:00
WeenieError.cs feat(core): adopt retail's full WeenieError code table 2026-07-29 07:33:27 +02:00