From 39f6177595a53d6b8e7050f60020a00a05575f02 Mon Sep 17 00:00:00 2001 From: notevil Date: Wed, 22 Apr 2026 22:27:01 +0200 Subject: [PATCH] Phase 2.4 review fixes : P0-BUG-001 joint order + P0-BUG-002 singleton + tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P0-BUG-001 — Ordre IDs joints Elbow/Hand/Tool ≠ EF TiedUpArmatures.buildBiped() assignait Arm_R=11, Elbow_R=12, Hand_R=13, Tool_R=14 (idem gauche 16/17/18/19) alors que VanillaModelTransformer.RIGHT_ARM encode upperJoint=11, lowerJoint=12, middleJoint=14 — donc Arm_R=11, Hand_R=12, Elbow_R=14. Résultat : lowerJoint=17 (SimpleTransformer qui attache les vertices à Hand) pointait en fait vers Elbow_L → bras tordus au rendu. Fix : réassigner les IDs dans buildBiped() pour matcher le layout EF (Arm_R=11, Hand_R=12, Tool_R=13, Elbow_R=14 ; symétrique 16-19). VanillaModelTransformer non touché (source de vérité EF). P0-BUG-002 — Singleton BIPED non thread-safe if (BIPED_INSTANCE == null) BIPED_INSTANCE = buildBiped() est un double-init race. En SP intégré (client + server threads sur la même JVM), deux threads peuvent entrer simultanément dans le if null et créer deux HumanoidArmature distincts — pose matrices incohérentes selon les call sites. Fix : Holder idiome (static inner class). Le class-init lock JVM garantit (JLS §12.4.1) qu'une seule init, visible à tous les threads, sans synchronized ni volatile. Zero overhead après init. P1 — Nouveau TiedUpArmaturesTest (4 tests) - bipedHas20Joints : BIPED.get().getJointNumber() == 20 - searchBipedJointByNameReturnsNonNull : vérifie les 20 noms EF - jointIdsMatchEfLayout : verrou P0-BUG-001 (id=12→Hand_R, id=14→Elbow_R, etc.) — aurait attrapé le bug en review initiale - bipedSingleton : BIPED.get() == BIPED.get() (verrou P0-BUG-002) P2 backlog tracé dans docs/plans/rig/PHASE0_DEGRADATIONS.md : biped collapsed visuellement jusqu'à Phase 2.7, PlayerPatch.yBodyRot sans lerp, ridingEntity non géré, isFirstPersonHidden nommage ambigu, ServerPlayerPatch hérite méthodes client-only sans @OnlyIn. Tests : 15 GREEN (11 bridge pré-existants + 4 nouveaux biped). Compile clean. --- .../tiedup/remake/rig/TiedUpArmatures.java | 94 +++++++++------ .../remake/rig/TiedUpArmaturesTest.java | 114 ++++++++++++++++++ 2 files changed, 173 insertions(+), 35 deletions(-) create mode 100644 src/test/java/com/tiedup/remake/rig/TiedUpArmaturesTest.java diff --git a/src/main/java/com/tiedup/remake/rig/TiedUpArmatures.java b/src/main/java/com/tiedup/remake/rig/TiedUpArmatures.java index c0f7d34..e004a66 100644 --- a/src/main/java/com/tiedup/remake/rig/TiedUpArmatures.java +++ b/src/main/java/com/tiedup/remake/rig/TiedUpArmatures.java @@ -41,16 +41,20 @@ import com.tiedup.remake.rig.math.OpenMatrix4f; *

Hiérarchie biped EF (20 joints)

* *
- *   Root
- *   ├─ Thigh_R ── Leg_R ── Knee_R
- *   ├─ Thigh_L ── Leg_L ── Knee_L
- *   └─ Torso
- *      └─ Chest
- *         ├─ Head
- *         ├─ Shoulder_R ── Arm_R ── Elbow_R ── Hand_R ── Tool_R
- *         └─ Shoulder_L ── Arm_L ── Elbow_L ── Hand_L ── Tool_L
+ *   Root                                                    id=0
+ *   ├─ Thigh_R ── Leg_R ── Knee_R                           id=1,2,3
+ *   ├─ Thigh_L ── Leg_L ── Knee_L                           id=4,5,6
+ *   └─ Torso                                                id=7
+ *      └─ Chest                                             id=8
+ *         ├─ Head                                           id=9
+ *         ├─ Shoulder_R ── Arm_R ── Elbow_R ── Hand_R ── Tool_R   ids=10,11,14,12,13
+ *         └─ Shoulder_L ── Arm_L ── Elbow_L ── Hand_L ── Tool_L   ids=15,16,19,17,18
  * 
* + *

Les IDs des bras ne suivent pas l'ordre hiérarchique parent→enfant : c'est + * voulu pour rester aligné avec le layout attendu par {@code VanillaModelTransformer} + * (upperJoint=Arm, lowerJoint=Hand, middleJoint=Elbow). Voir {@link #buildBiped()}.

+ * *

Noms conservés verbatim EF (pas renommés en TiedUp style) car :

*