fix(physics): S2 — static publication emits authored Spheres as Spheres (AP-155 narrowed)
Some checks are pending
Headless portability / portable-headless (ubuntu-latest) (push) Waiting to run
Headless portability / portable-headless (windows-latest) (push) Waiting to run
Headless portability / linux-graphical (push) Waiting to run
Headless portability / linux-vulkan (push) Waiting to run

Both static sites (LandblockPhysicsPublisher, the headless-only
LandblockPhysicsContentBuilder) emitted an authored Setup Sphere as a
base-anchored Cylinder of radius r and height 2r. The live path emits a
Sphere for the same data, so the same object collided differently by
arrival route, and the narrow phase met a flat cap where retail meets a
curved surface. Both sites now mirror ShadowShapeBuilder.FromSetup's
Sphere block exactly.

Combined Opus review: PASS. Its numeric verification of the dispatch
test's geometry (head-sphere clearance 0.201 m for the true sphere; the
cylinder counterfactual inside by 0.10 m XY with the Z band overlapping)
is what makes the discrimination claim more than a sabotage anecdote,
and its F8 finding is applied: the test now carries a POSITIVE control —
aiming straight through the boulder's centre must block — so a
membership/seed regression can no longer masquerade as a curve-hit
pass. F4 applied: CylHeight is asserted, not inferred (the C4 lesson).
F3 applied: the deleted Quaternion.Inverse base composition is recorded
as internally coherent for the old cylinder's world-Z axis — the defect
was the shape TYPE, not that rotation math.

The review also verified the deleted-cylinder blast radius: the F2
overlay's drawn span is IDENTICAL for both shapes (old [c-r, c+r], new
[c-r, c+r]); the flood sphere's centre rises by exactly r, which cannot
change outdoor membership (XY rectangle) and lands the indoor half on
Session B's dungeon gate alongside S1B; and the sphere-branch flood is
now pinned uncapped by a genuine eleventh-shape A/B test.
PublishStaticCollision — the headless static path — gains its first
test ever.

AP-155 is NARROWED, not deleted (review F13): the has-BSP source split
(entity.MeshRefs vs setup.Parts + AnimPartChanged) survives and keeps
the row active. The shared-primitive-emitter refactor that would make
route independence a compile-time property is the filed follow-up
(review F20).

Population: 3,506 of 5,935 installed Setups, structurally equal to
AP-157's third-branch count (byte-identical classifier — three
independent routes agree: 3,605 - 99 = 3,506).

Clean-room suite at implementation: 11,253 passed / 6 skipped / 0
failed on landed S1B. Post-review-hardening: Publisher tests 25/25,
Content tests 2/2, both green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-07 08:07:02 +02:00
parent b3e43d22c9
commit 9671af0273
7 changed files with 470 additions and 18 deletions

View file

@ -241,6 +241,14 @@ public class ShadowObjectRegistryMultiPartTests
radius: radius,
cylHeight: radius * 2f);
private static ShadowShape Sph(float radius, Vector3 localPosition = default)
=> ShadowShape.Sphere(
gfxObjId: 0u,
localPosition: localPosition,
localRotation: Quaternion.Identity,
scale: 1f,
radius: radius);
/// <summary>
/// A physics-BSP part shape. <paramref name="boundsCenter"/> defaults
/// OFF-CENTRE because that is the DAT-real configuration: a GfxObj's
@ -389,6 +397,40 @@ public class ShadowObjectRegistryMultiPartTests
Assert.DoesNotContain(farCell, cylCells);
}
/// <summary>
/// AP-155 (S2 contract, 2026-08-07). Retail's 10-sphere clamp
/// (<c>CObjCell::find_cell_list</c> @0x0052b9f0, <c>0x0052ba21 cmp
/// eax,0xa</c>) is a fixed-size destination-buffer limit on the CYLSPHERE
/// overload alone — it is not read by the Sphere-shape branch
/// <c>BuildFloodSpheres</c> takes as acdream's substitute for retail's
/// sorting-sphere overload (@0x0052b990, AP-157, still open): that branch
/// caps at <c>int.MaxValue</c>, i.e. not at all. Before this fix a static
/// Setup-Sphere entity registered as Cylinder shapes and so WAS subject to
/// this cap; after it, the same entity registers as Sphere shapes and
/// reaches this uncapped branch instead — verified here directly rather
/// than inferred from the source comment, matching
/// <see cref="BuildFloodSpheres_CapsCylSpheresAtTenButNeverTheBspParts"/>'s
/// eleventh-shape technique one branch over.
/// </summary>
[Fact]
public void BuildFloodSpheres_SphereBranchIsNeverCappedAtTen()
{
var far = new Vector3(0f, 72f, 0f);
uint ownCell = LbId | (uint)(1 * 8 + 1 + 1); // (x=1, y=1)
uint farCell = LbId | (uint)(1 * 8 + 4 + 1); // (x=1, y=4)
var spheres = new ShadowShape[11];
for (int i = 0; i < 10; i++)
spheres[i] = Sph(1f);
spheres[10] = Sph(1f, far);
List<uint> sphereCells = FloodCellsFor(spheres);
Assert.Contains(ownCell, sphereCells);
// The eleventh Sphere still floods — unlike the eleventh CylSphere in
// BuildFloodSpheres_CapsCylSpheresAtTenButNeverTheBspParts above.
Assert.Contains(farCell, sphereCells);
}
/// <summary>
/// The BoundsCentre is expressed in the SHAPE's own frame, so the part's
/// LocalRotation must carry it — exactly as retail transforms the sphere