wip(assembler): M3 round 2 -- islands get real mass: deep crust, separate tapered roots, arched spans

Pinch cause: SmoothStep taper drove the underside radius to zero at one point. Version 2: depth 0.75x
diameter (thin-pad control at 0.30 fails), 3-4 seeded roots, bounded contour warp + roughness, one
off-route side island, 3 m rock spans. Bounds/route/W1-W8-W16 pass. Open: legacy probe metadata says
25 cm but production legacy is 12.5 cm -- round 3 must fix the import scale contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MmSoF64BbRFmk9C3p1VsBJ
This commit is contained in:
Fr0zkaandClaude Opus 5.5 committed 2026-10-10 12:24:35 +02:00
1 parent 53a1e69af7
commit 4afea7c802
15 files changed
+1007 -99

No files matched your search

@@ -143,10 +143,11 @@ namespace
float LegacyDensity(const FStandaloneOwnerWorld& owner, const Point& q)
{
constexpr double CoreToLegacyVoxelScale = 2.0;
return owner.Generator->GetDensityAt(
static_cast<float>(q[0] / static_cast<double>(Q)),
static_cast<float>(q[1] / static_cast<double>(Q)),
static_cast<float>(q[2] / static_cast<double>(Q)));
static_cast<float>(CoreToLegacyVoxelScale * q[0] / static_cast<double>(Q)),
static_cast<float>(CoreToLegacyVoxelScale * q[1] / static_cast<double>(Q)),
static_cast<float>(CoreToLegacyVoxelScale * q[2] / static_cast<double>(Q)));
}
OracleAnchor FindLegacyAnchor(const FStandaloneOwnerWorld& owner)
@@ -425,9 +426,13 @@ namespace
void WriteJson(const std::filesystem::path& path, const FloatingIslandManifestV1& manifest,
const FloatingIslandBoundsAuditResult& bounds, const FloatingIslandRouteAuditResult& route,
const FloatingIslandRouteAuditResult& raised, const SampleStats& sample,
const FloatingIslandThicknessAuditResult& thickness,
const FloatingIslandThicknessAuditResult& thinThickness,
const OracleAnchor& anchor, const std::array<MeshResult, 4>& meshes,
const std::array<std::string, 3>& fieldHashes, const ExistingHashes& oldHashes)
{
const Point ownerAnchorQ = anchor.surfaceQ;
const Point coreAnchorQ{ownerAnchorQ[0] / 2, ownerAnchorQ[1] / 2, ownerAnchorQ[2] / 2};
std::ofstream out(path, std::ios::trunc);
if (!out) throw std::runtime_error("cannot create audit result JSON");
out << std::setprecision(12);
@@ -437,13 +442,20 @@ namespace
<< "\",\n \"unchanged_existing_hashes\":{\"m1_round1_manifest\":\""
<< oldHashes.round1Manifest << "\",\"surfaceworld_round4_manifest\":\""
<< oldHashes.surfaceWorldRound4Manifest << "\"}"
<< ",\n \"geometry_version\":" << manifest.recipe.geometryVersion
<< ",\n \"owner_voxel_size_cm\":12.5,\n \"core_voxel_size_cm\":25"
<< ",\n \"owner_to_core_length_scale\":0.5"
<< ",\n \"plan_islands\":" << manifest.plan.islands.size()
<< ",\n \"plan_connectors\":" << manifest.plan.clusterEdges.size()
<< ",\n \"route_points\":" << manifest.plan.route.size()
<< ",\n \"legacy_anchor_voxels\":[" << anchor.surfaceQ[0] / static_cast<double>(Q)
<< ',' << anchor.surfaceQ[1] / static_cast<double>(Q) << ','
<< anchor.surfaceQ[2] / static_cast<double>(Q) << "],\n \"legacy_anchor_plateau_samples\":"
<< ",\n \"legacy_anchor_owner_voxels\":[" << ownerAnchorQ[0] / static_cast<double>(Q)
<< ',' << ownerAnchorQ[1] / static_cast<double>(Q) << ','
<< ownerAnchorQ[2] / static_cast<double>(Q) << ']'
<< ",\n \"comparison_anchor_core_voxels\":[" << coreAnchorQ[0] / static_cast<double>(Q)
<< ',' << coreAnchorQ[1] / static_cast<double>(Q) << ','
<< coreAnchorQ[2] / static_cast<double>(Q) << "],\n \"legacy_anchor_plateau_samples\":"
<< anchor.supportScore << ",\n \"recipe_parameters\":{\"seed\":" << manifest.recipe.seed
<< ",\"primary_island_count\":" << manifest.recipe.primaryIslandCount
<< ",\"density_q16\":" << manifest.recipe.islandDensityQ16
<< ",\"spacing_voxels\":" << manifest.recipe.spacingSubvoxels / static_cast<double>(Q)
<< ",\"radius_voxels\":[" << manifest.recipe.minimumRadiusSubvoxels / static_cast<double>(Q)
@@ -452,20 +464,53 @@ namespace
<< ",\"vertical_jitter_q16\":" << manifest.recipe.verticalJitterQ16
<< ",\"top_flatten_q16\":" << manifest.recipe.topFlattenQ16
<< ",\"contour_warp_voxels\":" << manifest.recipe.contourWarpSubvoxels / static_cast<double>(Q)
<< ",\"crust_depth_bonus_q16\":" << manifest.recipe.crustDepthBonusQ16
<< ",\"root_depth_ratio_q16\":" << manifest.recipe.rootDepthRatioQ16
<< ",\"roughness_voxels\":" << manifest.recipe.roughnessSubvoxels / static_cast<double>(Q)
<< ",\"blend_voxels\":" << manifest.recipe.blendRadiusSubvoxels / static_cast<double>(Q) << "},\n \"stable_island_ids\":[";
<< ",\"blend_voxels\":" << manifest.recipe.blendRadiusSubvoxels / static_cast<double>(Q)
<< ",\"bridge_half_width_voxels\":" << manifest.recipe.bridgeHalfWidthSubvoxels / static_cast<double>(Q)
<< ",\"bridge_thickness_voxels\":" << manifest.recipe.bridgeThicknessSubvoxels / static_cast<double>(Q)
<< "},\n \"stable_island_ids\":[";
for (std::size_t i = 0; i < manifest.plan.islands.size(); ++i)
{ if (i) out << ','; out << '\"' << Hex64(manifest.plan.islands[i].stableId) << '\"'; }
out << "],\n \"stable_connector_ids\":[";
for (std::size_t i = 0; i < manifest.plan.clusterEdges.size(); ++i)
{ if (i) out << ','; out << '\"' << Hex64(manifest.plan.clusterEdges[i].stableId) << '\"'; }
out << "],\n \"island_profiles\":[";
for (std::size_t i = 0; i < manifest.plan.islands.size(); ++i)
{
if (i) out << ',';
const auto& island = manifest.plan.islands[i];
const double ratio = static_cast<double>(island.topZSubvoxels - island.bottomZSubvoxels)
/ (2.0 * static_cast<double>(island.radiusSubvoxels));
out << "{\"id\":\"" << Hex64(island.stableId) << "\",\"ordinal\":" << island.ordinal
<< ",\"center_voxels\":[" << island.centerSubvoxels[0] / static_cast<double>(Q)
<< ',' << island.centerSubvoxels[1] / static_cast<double>(Q)
<< ',' << island.centerSubvoxels[2] / static_cast<double>(Q)
<< "],\"radius_voxels\":" << island.radiusSubvoxels / static_cast<double>(Q)
<< ",\"top_voxels\":" << island.topZSubvoxels / static_cast<double>(Q)
<< ",\"bottom_voxels\":" << island.bottomZSubvoxels / static_cast<double>(Q)
<< ",\"depth_to_diameter\":" << ratio << '}';
}
out << "],\n \"bounds\":{\"passed\":" << (bounds.passed ? "true" : "false")
<< ",\"negative_control_detected\":" << (bounds.negativeControlDetected ? "true" : "false")
<< ",\"boxes\":" << bounds.boxesTested << ",\"samples\":" << bounds.pointSamples
<< ",\"unknown\":" << bounds.unknownBounds << ",\"missed\":" << bounds.missedBounds
<< ",\"island_boxes\":" << bounds.islandBoundsTested
<< ",\"connector_boxes\":" << bounds.connectorBoundsTested
<< ",\"void_boxes_proved_air\":" << bounds.voidBoxesProvedAir << "},\n \"route\":{\"passed\":"
<< ",\"void_boxes_proved_air\":" << bounds.voidBoxesProvedAir << "},\n \"thickness\":{\"passed\":"
<< (thickness.passed ? "true" : "false")
<< ",\"islands_tested\":" << thickness.islandsTested
<< ",\"islands_below_minimum\":" << thickness.islandsBelowMinimum
<< ",\"minimum_depth_to_diameter_ratio\":" << thickness.minimumDepthToDiameterRatio
<< ",\"required_depth_to_diameter_ratio\":" << thickness.requiredDepthToDiameterRatio
<< ",\"minimum_island_id\":\"" << Hex64(thickness.minimumIslandStableId) << "\"}"
<< ",\n \"thin_pad_negative_control\":{\"detected\":"
<< ((!thinThickness.passed && thinThickness.islandsBelowMinimum == thinThickness.islandsTested)
? "true" : "false")
<< ",\"failed_islands\":" << thinThickness.islandsBelowMinimum
<< ",\"minimum_depth_to_diameter_ratio\":" << thinThickness.minimumDepthToDiameterRatio << "}"
<< ",\n \"route\":{\"passed\":"
<< (route.passed ? "true" : "false") << ",\"segments\":" << route.segmentsTested
<< ",\"centers\":" << route.centerSamples << ",\"capsule_samples\":"
<< route.capsuleFieldSamples << ",\"blocked\":" << route.blockedCapsuleSamples
@@ -494,7 +539,7 @@ namespace
out << "{\"name\":\"" << names[i] << "\",\"grid_samples\":" << meshes[i].gridSamples
<< ",\"triangles\":" << meshes[i].triangles << ",\"bytes\":" << meshes[i].bytes << '}';
}
out << "],\n \"route_points_voxels\":[";
out << "],\n \"route_points_core_voxels\":[";
for (std::size_t i = 0; i < manifest.plan.route.size(); ++i)
{
if (i) out << ',';
@@ -531,30 +576,33 @@ int main(int argc, char** argv)
const OracleAnchor anchor = FindLegacyAnchor(owner);
if (anchor.supportScore < 9)
throw std::runtime_error("legacy scan found no broad FloatingIslands top in the frozen strate range");
const Point coreAnchorQ{anchor.surfaceQ[0] / 2,
anchor.surfaceQ[1] / 2, anchor.surfaceQ[2] / 2};
FloatingIslandRecipeV1 recipe;
recipe.seed = 0;
recipe.layoutOriginXSubvoxels = anchor.surfaceQ[0];
recipe.layoutOriginYSubvoxels = anchor.surfaceQ[1];
recipe.layoutCenterTopZSubvoxels = anchor.surfaceQ[2];
recipe.layoutMinimumZSubvoxels = anchor.surfaceQ[2] - 96 * Q;
recipe.layoutMaximumZSubvoxels = anchor.surfaceQ[2] + 96 * Q;
recipe.primaryIslandCount = 5;
recipe.layoutOriginXSubvoxels = coreAnchorQ[0];
recipe.layoutOriginYSubvoxels = coreAnchorQ[1];
recipe.layoutCenterTopZSubvoxels = coreAnchorQ[2];
recipe.geometryVersion = 2;
recipe.layoutMinimumZSubvoxels = coreAnchorQ[2] - 80 * Q;
recipe.layoutMaximumZSubvoxels = coreAnchorQ[2] + 48 * Q;
recipe.primaryIslandCount = 3;
recipe.islandDensityQ16 = 32768;
recipe.spacingSubvoxels = 112 * Q;
recipe.minimumRadiusSubvoxels = 24 * Q;
recipe.maximumRadiusSubvoxels = 48 * Q;
recipe.spacingSubvoxels = 56 * Q;
recipe.minimumRadiusSubvoxels = 12 * Q;
recipe.maximumRadiusSubvoxels = 24 * Q;
recipe.thicknessRatioQ16 = 39322;
recipe.verticalJitterQ16 = 39322;
recipe.topFlattenQ16 = 39322;
recipe.taperEndMinimumQ16 = 29491;
recipe.taperEndMaximumQ16 = 45875;
recipe.blendRadiusSubvoxels = 6 * Q;
recipe.contourWarpSubvoxels = VoxQ((24.0 + 48.0) * 0.35 * 0.5);
recipe.roughnessSubvoxels = 3 * Q;
recipe.boundarySealSubvoxels = 4 * Q;
recipe.bridgeHalfWidthSubvoxels = 4 * Q;
recipe.bridgeThicknessSubvoxels = 3 * Q;
recipe.blendRadiusSubvoxels = 3 * Q;
recipe.contourWarpSubvoxels = VoxQ(6.3);
recipe.roughnessSubvoxels = VoxQ(1.5);
recipe.boundarySealSubvoxels = 2 * Q;
recipe.bridgeHalfWidthSubvoxels = 6 * Q;
recipe.bridgeThicknessSubvoxels = 4 * Q;
const auto beginPlanning = Clock::now();
auto planned = PlanFloatingIslandCluster(recipe, error);
@@ -579,6 +627,12 @@ int main(int argc, char** argv)
const auto bounds = AuditFloatingIslandBounds(field, 512);
const auto route = AuditFloatingIslandRoute(field);
const auto raisedRoute = AuditFloatingIslandRoute(field, 8 * Q);
const auto thickness = AuditFloatingIslandThickness(planned->plan);
auto thinPlan = planned->plan;
for (auto& island : thinPlan.islands)
island.bottomZSubvoxels = island.topZSubvoxels
- island.radiusSubvoxels * planned->recipe.thicknessRatioQ16 / 65536;
const auto thinThickness = AuditFloatingIslandThickness(thinPlan);
const auto influence = field.influenceBounds();
const auto points = MakeSamples(influence, 32768, 0x4d33524f554e4431ull);
const auto w1 = HashWithWorkers(field, owner, points, 1, false);
@@ -588,6 +642,9 @@ int main(int argc, char** argv)
if (w1.hash != w8.hash || w1.hash != w16.hash)
throw std::runtime_error("native field sample hash differs between W1/W8/W16");
if (!bounds.passed) throw std::runtime_error("native island bounds audit or negative control failed");
if (!thickness.passed || thinThickness.passed
|| thinThickness.islandsBelowMinimum != thinThickness.islandsTested)
throw std::runtime_error("native island thickness audit or thin-pad negative control failed");
std::cout << "route_diagnostics pass=" << route.passed << " segments=" << route.segmentsTested
<< " centers=" << route.centerSamples << " capsule_samples=" << route.capsuleFieldSamples
<< " blocked=" << route.blockedCapsuleSamples << " support_samples=" << route.supportProbeSamples
@@ -602,6 +659,22 @@ int main(int argc, char** argv)
if (!route.passed)
{
const auto& routePoints = planned->plan.route;
if (route.firstBlockedSegment != ~std::uint64_t{0})
std::cout << "first_blocked_position_voxels="
<< route.firstBlockedPositionSubvoxels[0] / static_cast<double>(Q) << ','
<< route.firstBlockedPositionSubvoxels[1] / static_cast<double>(Q) << ','
<< route.firstBlockedPositionSubvoxels[2] / static_cast<double>(Q) << '\n';
const std::size_t debugBegin = route.firstUnsupportedSegment == ~std::uint64_t{0}
? 0 : static_cast<std::size_t>(route.firstUnsupportedSegment);
for (std::size_t i = debugBegin > 1 ? debugBegin - 1 : 0;
i < std::min(routePoints.size(), debugBegin + 3); ++i)
{
const auto& point = routePoints[i].positionSubvoxels;
std::cout << "route_point=" << i << ' '
<< point[0] / static_cast<double>(Q) << ','
<< point[1] / static_cast<double>(Q) << ','
<< point[2] / static_cast<double>(Q) << '\n';
}
const double maxGrade = static_cast<double>(planned->recipe.routeConstraints.maximumGradeQ16) / 65536.0;
for (std::size_t i = 0; i + 1 < routePoints.size(); ++i)
{
@@ -628,6 +701,9 @@ int main(int argc, char** argv)
const auto& unsupported = route.firstUnsupportedCenterSubvoxels;
const double foot = unsupported[2] / static_cast<double>(Q)
- constraints.capsuleHeightSubvoxels / (2.0 * Q);
std::cout << "unsupported_route_probe=" << unsupported[0] / static_cast<double>(Q)
<< ',' << unsupported[1] / static_cast<double>(Q) << ','
<< unsupported[2] / static_cast<double>(Q) << " foot=" << foot << '\n';
const double probeRadius = constraints.supportProbeRadiusSubvoxels / static_cast<double>(Q);
const std::array<std::array<double, 2>, 5> supportPoints{{
{0.0,0.0},{probeRadius,0.0},{-probeRadius,0.0},{0.0,probeRadius},{0.0,-probeRadius}}};
@@ -645,6 +721,16 @@ int main(int argc, char** argv)
if (density < 0) { firstSolidDepth = depth; break; }
}
std::cout << "support_probe=" << probeIndex << " first_solid_depth_vox=" << firstSolidDepth << '\n';
std::cout << "support_profile=" << probeIndex << ':';
for (double depth = 0.5; depth <= 5.0; depth += 0.5)
{
const auto density = field.densitySubvoxels(
std::llround(unsupported[0] + supportPoints[probeIndex][0] * Q),
std::llround(unsupported[1] + supportPoints[probeIndex][1] * Q),
std::llround((foot - depth) * Q));
std::cout << ' ' << depth << '=' << density;
}
std::cout << '\n';
}
for (std::size_t i = 0; i < planned->plan.clusterEdges.size(); ++i)
{
@@ -662,12 +748,15 @@ int main(int argc, char** argv)
&& raisedRoute.blockedCapsuleSamples == 0))
throw std::runtime_error("raised-route negative control did not detect unsupported traversal");
const std::int64_t ox = anchor.surfaceQ[0], oy = anchor.surfaceQ[1], oz = anchor.surfaceQ[2];
std::array<MeshResult, 4> meshes{};
const Point clusterMin{ox - 320 * Q, oy - 208 * Q, oz - 80 * Q};
const Point clusterMax{ox + 320 * Q, oy + 208 * Q, oz + 16 * Q};
const Point detailMin{ox - 64 * Q, oy - 64 * Q, oz - 48 * Q};
const Point detailMax{ox + 64 * Q, oy + 64 * Q, oz + 10 * Q};
const auto clusterBounds = field.influenceBounds();
if (!clusterBounds.finite) throw std::runtime_error("native cluster mesh bounds are not finite");
const Point clusterMin{clusterBounds.minimumSubvoxels[0] - 8 * Q,
clusterBounds.minimumSubvoxels[1] - 8 * Q, clusterBounds.minimumSubvoxels[2] - 8 * Q};
const Point clusterMax{clusterBounds.maximumSubvoxels[0] + 8 * Q,
clusterBounds.maximumSubvoxels[1] + 8 * Q, clusterBounds.maximumSubvoxels[2] + 8 * Q};
const Point detailMin{coreAnchorQ[0] - 64 * Q, coreAnchorQ[1] - 64 * Q, coreAnchorQ[2] - 80 * Q};
const Point detailMax{coreAnchorQ[0] + 64 * Q, coreAnchorQ[1] + 64 * Q, coreAnchorQ[2] + 16 * Q};
meshes[0] = ExtractMesh(outputDir / "cluster_legacy.vfmesh", clusterMin, clusterMax, 4 * Q,
[&](const Point& q) { return SampleLegacy(owner, q); });
meshes[1] = ExtractMesh(outputDir / "cluster_native.vfmesh", clusterMin, clusterMax, 4 * Q,
@@ -681,11 +770,14 @@ int main(int argc, char** argv)
throw std::runtime_error("matched legacy/native mesh extraction produced an empty field");
WriteJson(outputDir / "audit.json", *planned, bounds, route, raisedRoute,
w16, anchor, meshes, hashes, oldHashes);
w16, thickness, thinThickness, anchor, meshes, hashes, oldHashes);
std::cout << std::setprecision(4)
<< "legacy_anchor_voxels=" << anchor.surfaceQ[0] / static_cast<double>(Q) << ','
<< "legacy_anchor_owner_voxels=" << anchor.surfaceQ[0] / static_cast<double>(Q) << ','
<< anchor.surfaceQ[1] / static_cast<double>(Q) << ','
<< anchor.surfaceQ[2] / static_cast<double>(Q)
<< " comparison_anchor_core_voxels=" << coreAnchorQ[0] / static_cast<double>(Q) << ','
<< coreAnchorQ[1] / static_cast<double>(Q) << ','
<< coreAnchorQ[2] / static_cast<double>(Q)
<< " plateau_samples=" << anchor.supportScore << '\n'
<< "recipe_hash=" << Hex64(planned->recipe.contentHash)
<< " plan_hash=" << Hex64(planned->plan.contentHash)
@@ -708,6 +800,12 @@ int main(int argc, char** argv)
<< "raised_route_detected=" << (!raisedRoute.passed && raisedRoute.unsupportedCenterSamples > 0)
<< " unsupported=" << raisedRoute.unsupportedCenterSamples
<< " blocked=" << raisedRoute.blockedCapsuleSamples << '\n'
<< "thickness_pass=" << thickness.passed << " islands=" << thickness.islandsTested
<< " min_depth_diameter=" << thickness.minimumDepthToDiameterRatio
<< " threshold=" << thickness.requiredDepthToDiameterRatio
<< " thin_pad_detected=" << (!thinThickness.passed
&& thinThickness.islandsBelowMinimum == thinThickness.islandsTested)
<< " thin_ratio=" << thinThickness.minimumDepthToDiameterRatio << '\n'
<< "field_hashes W1=" << w1.hash << " W8=" << w8.hash << " W16=" << w16.hash
<< " legacy_ms=" << w16.legacyMilliseconds << " native_ms=" << w16.nativeMilliseconds
<< " mismatch_percent=" << (100.0 * w16.signMismatches / 32768.0)