From 3f61995c8b7b75beb875b292aadbc5c72c2a8406 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Wed, 14 Oct 2026 17:15:45 +0200 Subject: [PATCH] test(entity_model): compare per-vertex normals with vanilla The entity model parity harness now draws each posed model on both sides under LivingEntityRenderer's root transform (body yaw, scale(-1, -1, 1), the renderer's own scale) and compares every vertex's normal as the signed bytes written to the vertex buffer: vanilla's ModelPart.render / Cube.compile / PoseStack.Pose.transformNormal into a capturing VertexConsumer, packed with BufferBuilder's own normalIntValue, against Horizon's mobs::render::draw RGBA8_SNORM normals. A part-scale override covers negative and non-uniform part scales (trusted sign flips and untrusted 1/scale normalisation). A one-step difference is accepted only where vanilla's float sits at a truncation step; a posed position checksum per drawn part is compared too. Co-Authored-By: Claude Opus 5.5 --- .../examples/entity_anim_fixture.rs | 89 ++++++++++++- .../parity/VanillaEntityAnimOracle.java | 117 +++++++++++++++++- tools/test_entity_model_parity.py | 111 ++++++++++++++++- 3 files changed, 308 insertions(+), 9 deletions(-) diff --git a/crates/horizon-client/examples/entity_anim_fixture.rs b/crates/horizon-client/examples/entity_anim_fixture.rs index 6bec66a68..663bc288a 100644 --- a/crates/horizon-client/examples/entity_anim_fixture.rs +++ b/crates/horizon-client/examples/entity_anim_fixture.rs @@ -1,14 +1,17 @@ //! Replays the render states of the vanilla entity-animation oracle through -//! Horizon's `mobs::anim::setup` and writes every part's pose. +//! Horizon's `mobs::anim::setup` and writes every part's pose, then draws the +//! posed model with `mobs::render::draw` under the case's living-entity root +//! transform and writes each drawn part's packed vertex normals. //! //! cargo run --profile fast -p horizon-client --example entity_anim_fixture -- \ //! RESOURCES VANILLA.jsonl OUT.jsonl +use horizon_client::mesher::Vertex; use horizon_client::mobs::{ Mob, MobData, MobTypes, Part, Species, allay, anim::{self, Poses, State}, aquatic, body_anim as b_anim, equine, guardian, keyframes::AnimationState, - shulker, sniffer, species, tame, + render, shulker, sniffer, species, tame, }; use horizon_core::geometry::Vec3; use serde_json::{Value, json}; @@ -44,6 +47,61 @@ fn walk(part: &Part, path: &str, poses: &Poses, out: &mut BTreeMap