wip(assembler): round L29 -- strate transitions honoured at the bedrock/ceiling interface
EVoxelStrateTransition from the upper strate shapes the bedrock(N)/ceiling(N+1) interface in the shared composition layer: Hard flat; Gradient = smooth 2D hash surface (16 m owner width, about 4 m measured undulation); Interleaved = 3D domain-warped fingered overlap within the width. Each band keeps >= 2 Core voxels solid; faces return to the seam near passage mouths. Interface audit over 512 m: 0 hole columns for all modes; wider-than-declared and too-thin controls rejected. All passage, route, proof and validator audits pass; deterministic Clang = GCC. Evaluator 15. Cost +4% SW, +1.3% FI vs L28. Open: ring-like artifact on the FI floor capture; transition look unverified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CSFYgsdW8ejZSyiMf4qRSX
This commit is contained in:
1 parent
f23ab7b9fa
commit
63c7e563d0
16 files changed
+794
-42
No files matched your search
@@ -69,6 +69,9 @@ namespace
|
||||
bool AuditResolvedLayoutBoundaries=false;
|
||||
bool AuditResolvedLayoutPassages=false;
|
||||
bool AuditSurfaceClearance=false;
|
||||
bool AuditStrateTransitions=false;
|
||||
int TransitionModeOverride=-1;
|
||||
int TransitionWidthChunksOverride=-1;
|
||||
};
|
||||
|
||||
bool ParseInteger(std::string_view text,int& output)
|
||||
@@ -103,6 +106,38 @@ namespace
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OverrideTransitions(VFJson::Value& root,int mode,int widthChunks,std::string& error)
|
||||
{
|
||||
auto* object=std::get_if<VFJson::Value::Object>(&root.Data);
|
||||
if(!object){error="transition fixture override requires an owner JSON object";return false;}
|
||||
const auto stratesIt=object->find("strates");
|
||||
if(stratesIt==object->end())
|
||||
{error="transition fixture override cannot find the resolved strate array";return false;}
|
||||
auto* strates=std::get_if<VFJson::Value::Array>(&stratesIt->second.Data);
|
||||
if(!strates||strates->empty())
|
||||
{error="transition fixture override found an empty or invalid strate array";return false;}
|
||||
for(auto& strate:*strates)
|
||||
{
|
||||
auto* strateObject=std::get_if<VFJson::Value::Object>(&strate.Data);
|
||||
if(!strateObject){error="transition fixture contains a malformed strate";return false;}
|
||||
const auto assetIt=strateObject->find("asset");
|
||||
if(assetIt==strateObject->end())continue;
|
||||
auto* asset=std::get_if<VFJson::Value::Object>(&assetIt->second.Data);
|
||||
if(!asset)continue;
|
||||
if(mode>=0)
|
||||
{
|
||||
VFJson::Value value;value.Data=static_cast<double>(mode);
|
||||
(*asset)["TransitionType"]=std::move(value);
|
||||
}
|
||||
if(widthChunks>=0)
|
||||
{
|
||||
VFJson::Value value;value.Data=static_cast<double>(widthChunks);
|
||||
(*asset)["TransitionBlendChunks"]=std::move(value);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ParseOptions(int argc,char** argv,FOptions& options)
|
||||
{
|
||||
const std::filesystem::path executable=std::filesystem::absolute(argv[0]);
|
||||
@@ -126,6 +161,8 @@ namespace
|
||||
" --resolved-layout-output=FILE (canonical plan-time layout snapshot)\n"
|
||||
" --resolved-layout-only (exit after plan and snapshot validation)\n"
|
||||
" --audit-resolved-layout-boundaries (query Core at each recorded endpoint)\n"
|
||||
" --audit-strate-transitions (measure interface crossing, band thickness and holes)\n"
|
||||
" --transition-mode=hard|gradient|interleaved --transition-width-chunks=N (fixture override)\n"
|
||||
" --audit-resolved-layout-passages (capsule, support, route-binding and blocked-control audit)\n"
|
||||
" --audit-surface-clearance (sample biome terrain/caps against the resolved ceiling)\n"
|
||||
" --auto-surface-camera (place the 27-tile cube on this seed's surface)\n"
|
||||
@@ -149,6 +186,21 @@ namespace
|
||||
else if(arg=="--audit-resolved-layout-boundaries")options.AuditResolvedLayoutBoundaries=true;
|
||||
else if(arg=="--audit-resolved-layout-passages")options.AuditResolvedLayoutPassages=true;
|
||||
else if(arg=="--audit-surface-clearance")options.AuditSurfaceClearance=true;
|
||||
else if(arg=="--audit-strate-transitions")options.AuditStrateTransitions=true;
|
||||
else if(arg.starts_with("--transition-mode="))
|
||||
{
|
||||
const std::string_view mode=arg.substr(std::string_view("--transition-mode=").size());
|
||||
if(mode=="gradient")options.TransitionModeOverride=0;
|
||||
else if(mode=="hard")options.TransitionModeOverride=1;
|
||||
else if(mode=="interleaved")options.TransitionModeOverride=2;
|
||||
else {std::fprintf(stderr,"Invalid transition mode: %.*s\n",static_cast<int>(mode.size()),mode.data());return false;}
|
||||
}
|
||||
else if(arg.starts_with("--transition-width-chunks="))
|
||||
{
|
||||
if(!readInt("--transition-width-chunks=",options.TransitionWidthChunksOverride)
|
||||
||options.TransitionWidthChunksOverride<0||options.TransitionWidthChunksOverride>64)
|
||||
{std::fprintf(stderr,"transition width chunks must be in 0..64\n");return false;}
|
||||
}
|
||||
else if(arg=="--stream-benchmark")options.StreamBenchmark=true;
|
||||
else if(arg=="--stream-pipeline")options.StreamPipeline=true;
|
||||
else if(arg=="--stream-hash")options.StreamHash=true;
|
||||
@@ -303,6 +355,10 @@ int main(int argc,char** argv)
|
||||
if(options.FloatingIslandsRecipe
|
||||
&&!StandaloneWorldAssemblyPrototype::SelectTopStrateAsFloatingIslands(ownerJsonRoot,error))
|
||||
{std::fprintf(stderr,"Floating-island recipe selection failed: %s\n",error.c_str());return 2;}
|
||||
if((options.TransitionModeOverride>=0||options.TransitionWidthChunksOverride>=0)
|
||||
&&!OverrideTransitions(ownerJsonRoot,options.TransitionModeOverride,
|
||||
options.TransitionWidthChunksOverride,error))
|
||||
{std::fprintf(stderr,"Transition fixture override failed: %s\n",error.c_str());return 2;}
|
||||
if(!StandaloneOwnerLoader::Resolve(ownerJsonRoot,*ownerWorld,error))
|
||||
{std::fprintf(stderr,"Owner data load failed: %s\n",error.c_str());return 2;}
|
||||
std::printf("[ColdTimeline] stage=owner_data_load end_ms=%.3f\n",
|
||||
@@ -551,6 +607,6 @@ int main(int argc,char** argv)
|
||||
options.RegionCrossing,options.AuditTileShapeReadiness,
|
||||
options.DiagnosticSlowShapeCompileMs,options.AuditBasePageEquivalence,
|
||||
options.AuditRouteParity,options.AuditResolvedLayoutBoundaries,
|
||||
options.AuditResolvedLayoutPassages,
|
||||
options.AuditResolvedLayoutPassages,options.AuditStrateTransitions,
|
||||
&resolvedLayout);
|
||||
}
|
||||
@@ -240,6 +240,172 @@ namespace StandaloneStreamBenchmark
|
||||
return Hash;
|
||||
}
|
||||
|
||||
inline bool AuditResolvedStrateTransitions(const VoxelForgeCore::World& Field,
|
||||
const FStandaloneOwnerWorld& Owner,
|
||||
const VoxelForgeCore::ResolvedLayoutSnapshotV3& Layout)
|
||||
{
|
||||
constexpr std::int64_t XYExtentMicrometres=256000000;
|
||||
constexpr std::int64_t XYStepMicrometres=8000000;
|
||||
const std::int64_t coreMicrometres=std::max<std::uint32_t>(1,Owner.CoreVoxelSizeMicrons);
|
||||
const std::int64_t zStepMicrometres=std::max<std::int64_t>(1,coreMicrometres/2);
|
||||
const std::int64_t minimumBandMicrometres=2*coreMicrometres;
|
||||
std::uint64_t interfacesPassed=0,totalColumns=0,passageColumnsSkipped=0;
|
||||
std::uint64_t holeColumns=0,airSamples=0,solidSamples=0;
|
||||
bool negativeWidthRejected=false,negativeThinBandRejected=false;
|
||||
|
||||
for(std::size_t interfaceIndex=0;interfaceIndex+1<Layout.strates.size();++interfaceIndex)
|
||||
{
|
||||
const auto& upper=Layout.strates[interfaceIndex];
|
||||
const auto& lower=Layout.strates[interfaceIndex+1];
|
||||
std::int64_t minimumOffset=std::numeric_limits<std::int64_t>::max();
|
||||
std::int64_t maximumOffset=std::numeric_limits<std::int64_t>::min();
|
||||
std::int64_t maximumCrossingDepth=0;
|
||||
std::int64_t minimumUpperThickness=std::numeric_limits<std::int64_t>::max();
|
||||
std::int64_t minimumLowerThickness=std::numeric_limits<std::int64_t>::max();
|
||||
std::uint64_t columns=0,skipped=0,holes=0,air=0,solid=0;
|
||||
bool firstHoleReported=false;
|
||||
const std::int64_t seam=upper.bedrock.bottomMicrometres;
|
||||
const auto passageCoversColumn=[&](std::int64_t xUm,std::int64_t yUm,
|
||||
std::int64_t zMinimumUm,std::int64_t zMaximumUm)
|
||||
{
|
||||
constexpr double Q=VoxelForgeCore::WorldAssemblySubvoxelsPerVoxel;
|
||||
for(const auto& passage:Layout.passages)
|
||||
{
|
||||
if(passage.upperStrateIndex!=upper.strateIndex
|
||||
||passage.lowerStrateIndex!=lower.strateIndex)continue;
|
||||
for(std::size_t pointIndex=1;pointIndex<passage.controlPoints.size();++pointIndex)
|
||||
{
|
||||
const auto& a=passage.controlPoints[pointIndex-1];
|
||||
const auto& b=passage.controlPoints[pointIndex];
|
||||
const double ax=a.positionSubvoxels[0]*coreMicrometres/Q;
|
||||
const double ay=a.positionSubvoxels[1]*coreMicrometres/Q;
|
||||
const double az=a.positionSubvoxels[2]*coreMicrometres/Q;
|
||||
const double bx=b.positionSubvoxels[0]*coreMicrometres/Q;
|
||||
const double by=b.positionSubvoxels[1]*coreMicrometres/Q;
|
||||
const double bz=b.positionSubvoxels[2]*coreMicrometres/Q;
|
||||
const double radius=std::max(a.radiusSubvoxels,b.radiusSubvoxels)
|
||||
*coreMicrometres/Q+750000.0;
|
||||
if(std::max(az,bz)+radius<zMinimumUm
|
||||
||std::min(az,bz)-radius>zMaximumUm)continue;
|
||||
const double dx=bx-ax,dy=by-ay;
|
||||
const double lengthSquared=dx*dx+dy*dy;
|
||||
const double t=lengthSquared>0.0
|
||||
?std::clamp(((xUm-ax)*dx+(yUm-ay)*dy)/lengthSquared,0.0,1.0):0.0;
|
||||
const double ex=xUm-(ax+t*dx),ey=yUm-(ay+t*dy);
|
||||
if(ex*ex+ey*ey<=radius*radius)return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
for(std::int64_t iy=-XYExtentMicrometres/XYStepMicrometres;
|
||||
iy<=XYExtentMicrometres/XYStepMicrometres;++iy)
|
||||
for(std::int64_t ix=-XYExtentMicrometres/XYStepMicrometres;
|
||||
ix<=XYExtentMicrometres/XYStepMicrometres;++ix)
|
||||
{
|
||||
const std::int64_t xUm=ix*XYStepMicrometres;
|
||||
const std::int64_t yUm=iy*XYStepMicrometres;
|
||||
const auto bands=VoxelForgeCore::EvaluateResolvedLayoutTransitionBandsV1(
|
||||
upper,lower,Owner.Seed,Layout.strateLayoutChunkSizeMicrometres,xUm,yUm);
|
||||
const std::int64_t offset=bands.upperBedrockBottomMicrometres-seam;
|
||||
minimumOffset=std::min(minimumOffset,offset);
|
||||
maximumOffset=std::max(maximumOffset,offset);
|
||||
maximumCrossingDepth=std::max(maximumCrossingDepth,
|
||||
bands.crossingDepthMicrometres);
|
||||
minimumUpperThickness=std::min(minimumUpperThickness,
|
||||
bands.upperBedrockTopMicrometres-bands.upperBedrockBottomMicrometres);
|
||||
minimumLowerThickness=std::min(minimumLowerThickness,
|
||||
bands.lowerCeilingTopMicrometres-bands.lowerCeilingBottomMicrometres);
|
||||
const std::int64_t zMinimum=std::min(bands.upperBedrockBottomMicrometres,
|
||||
bands.lowerCeilingBottomMicrometres);
|
||||
const std::int64_t zMaximum=std::max(bands.upperBedrockTopMicrometres,
|
||||
bands.lowerCeilingTopMicrometres);
|
||||
if(passageCoversColumn(xUm,yUm,zMinimum,zMaximum)){++skipped;continue;}
|
||||
|
||||
++columns;
|
||||
bool hasHole=false;
|
||||
for(std::int64_t zUm=zMinimum+zStepMicrometres/2;
|
||||
zUm<zMaximum-zStepMicrometres/2;zUm+=zStepMicrometres)
|
||||
{
|
||||
const VoxelForgeCore::Vec3d point{
|
||||
static_cast<double>(xUm)/coreMicrometres,
|
||||
static_cast<double>(yUm)/coreMicrometres,
|
||||
static_cast<double>(zUm)/coreMicrometres};
|
||||
const float density=Field.densityAt(point);
|
||||
if(!std::isfinite(density)||density>=0.0f)
|
||||
{
|
||||
if(!firstHoleReported)
|
||||
{
|
||||
std::printf("[StrateTransitionFirstHole] x_um=%lld y_um=%lld z_um=%lld z_min_um=%lld z_max_um=%lld density=%.9g dispatch=%s\n",
|
||||
static_cast<long long>(xUm),static_cast<long long>(yUm),
|
||||
static_cast<long long>(zUm),static_cast<long long>(zMinimum),
|
||||
static_cast<long long>(zMaximum),density,
|
||||
Field.densityDispatchPathAt(point).c_str());
|
||||
firstHoleReported=true;
|
||||
}
|
||||
hasHole=true;++air;
|
||||
}
|
||||
else ++solid;
|
||||
}
|
||||
if(hasHole)++holes;
|
||||
}
|
||||
|
||||
const std::int64_t boundaryPeakToPeak=maximumOffset-minimumOffset;
|
||||
const std::int64_t allowedWidth=upper.transitionMode=="Hard"
|
||||
||upper.transitionFallsBackToHard?0:upper.transitionWidthMicrometres;
|
||||
if(interfaceIndex==0)
|
||||
{
|
||||
auto wide=Layout;
|
||||
wide.strates[0].transitionMode="Interleaved";
|
||||
wide.strates[0].transitionFallsBackToHard=false;
|
||||
wide.strates[0].transitionWidthMicrometres=8000000;
|
||||
wide.strates[0].transitionInterpenetrationMicrometres=8000001;
|
||||
std::vector<VoxelForgeCore::ResolvedLayoutIssueV2> issues;
|
||||
std::string error;
|
||||
negativeWidthRejected=!wide.validate(
|
||||
VoxelForgeCore::ResolvedLayoutValidationModeV3::strict,issues,error);
|
||||
|
||||
auto thin=Layout;
|
||||
auto& bedrock=thin.strates[0].bedrock;
|
||||
bedrock.topMicrometres=bedrock.bottomMicrometres+minimumBandMicrometres-1;
|
||||
thin.strates[0].content.bottomMicrometres=bedrock.topMicrometres;
|
||||
negativeThinBandRejected=!thin.validate(
|
||||
VoxelForgeCore::ResolvedLayoutValidationModeV3::strict,issues,error);
|
||||
}
|
||||
const bool passed=columns>0&&holes==0&&maximumCrossingDepth<=allowedWidth
|
||||
&&minimumUpperThickness>=minimumBandMicrometres
|
||||
&&minimumLowerThickness>=minimumBandMicrometres;
|
||||
interfacesPassed+=passed?1u:0u;
|
||||
totalColumns+=columns;passageColumnsSkipped+=skipped;
|
||||
holeColumns+=holes;airSamples+=air;solidSamples+=solid;
|
||||
std::printf("[StrateTransitionInterface] upper=%d lower=%d mode=%s width_um=%lld max_crossing_depth_um=%lld boundary_peak_to_peak_um=%lld allowed_um=%lld upper_min_band_um=%lld lower_min_band_um=%lld columns=%llu passage_columns=%llu hole_columns=%llu air_samples=%llu status=%s\n",
|
||||
upper.strateIndex,lower.strateIndex,upper.transitionMode.c_str(),
|
||||
static_cast<long long>(upper.transitionWidthMicrometres),
|
||||
static_cast<long long>(maximumCrossingDepth),
|
||||
static_cast<long long>(boundaryPeakToPeak),static_cast<long long>(allowedWidth),
|
||||
static_cast<long long>(minimumUpperThickness),static_cast<long long>(minimumLowerThickness),
|
||||
static_cast<unsigned long long>(columns),static_cast<unsigned long long>(skipped),
|
||||
static_cast<unsigned long long>(holes),static_cast<unsigned long long>(air),
|
||||
passed?"PASS":"FAIL");
|
||||
}
|
||||
const bool controlsPassed=negativeWidthRejected&&negativeThinBandRejected;
|
||||
std::printf("[StrateTransitionNegativeControls] wider_than_declared=%s thinner_than_minimum=%s minimum_band_um=%lld status=%s\n",
|
||||
negativeWidthRejected?"REJECTED":"ACCEPTED",
|
||||
negativeThinBandRejected?"REJECTED":"ACCEPTED",
|
||||
static_cast<long long>(minimumBandMicrometres),controlsPassed?"PASS":"FAIL");
|
||||
const bool passed=!Layout.strates.empty()&&interfacesPassed+1==Layout.strates.size()
|
||||
&&holeColumns==0&&airSamples==0&&controlsPassed;
|
||||
std::printf("[StrateTransitionAuditSummary] interfaces=%llu passed=%llu columns=%llu skipped_passage_columns=%llu hole_columns=%llu air_samples=%llu solid_samples=%llu status=%s\n",
|
||||
static_cast<unsigned long long>(Layout.strates.size()-1),
|
||||
static_cast<unsigned long long>(interfacesPassed),
|
||||
static_cast<unsigned long long>(totalColumns),
|
||||
static_cast<unsigned long long>(passageColumnsSkipped),
|
||||
static_cast<unsigned long long>(holeColumns),
|
||||
static_cast<unsigned long long>(airSamples),
|
||||
static_cast<unsigned long long>(solidSamples),passed?"PASS":"FAIL");
|
||||
return passed;
|
||||
}
|
||||
|
||||
inline int RunPipelinedStreamingBenchmark(std::shared_ptr<FStandaloneOwnerWorld> OwnerWorld,
|
||||
const VoxelForgeCore::ResolvedWorldSnapshot& CoreSnapshot,
|
||||
const FVector& CameraPositionVoxels,int32 WorkerCount,int32 MaxLevel,
|
||||
@@ -256,6 +422,7 @@ namespace StandaloneStreamBenchmark
|
||||
bool bAuditBasePageEquivalence=false,bool bAuditRouteParity=false,
|
||||
bool bAuditResolvedLayoutBoundaries=false,
|
||||
bool bAuditResolvedLayoutPassages=false,
|
||||
bool bAuditStrateTransitions=false,
|
||||
const VoxelForgeCore::ResolvedLayoutSnapshotV3* ResolvedLayout=nullptr)
|
||||
{
|
||||
using Clock=std::chrono::steady_clock;
|
||||
@@ -441,6 +608,14 @@ namespace StandaloneStreamBenchmark
|
||||
Streamer.Stop();
|
||||
std::fprintf(stderr,"[StreamPipeline] full shape build failed: %s\n",BuildError.c_str());return 2;
|
||||
}
|
||||
if(bAuditStrateTransitions)
|
||||
{
|
||||
if(ResolvedLayout==nullptr||!CoreSnapshot.resolvedLayout())
|
||||
{Streamer.Stop();std::fprintf(stderr,"[StrateTransitionAudit] missing resolved-layout snapshot\n");return 2;}
|
||||
const bool passed=AuditResolvedStrateTransitions(Shape,World,*ResolvedLayout);
|
||||
Streamer.Stop();
|
||||
return passed?0:11;
|
||||
}
|
||||
if(bAuditResolvedLayoutPassages)
|
||||
{
|
||||
if(ResolvedLayout==nullptr||!CoreSnapshot.resolvedLayout())
|
||||
|
||||
@@ -801,13 +801,21 @@ namespace StandaloneWorldAssemblyPrototype
|
||||
s.transitionBlendChunks=slot.Definition->TransitionBlendChunks;
|
||||
s.transitionWidthMicrometres=static_cast<std::int64_t>(s.transitionBlendChunks)*owner.StrateLayoutChunkSizeMicrometres;
|
||||
s.transitionWarpAmplitudeMicrometres=s.transitionMode=="Interleaved"
|
||||
?2*static_cast<std::int64_t>(owner.StrateLayoutChunkSizeMicrometres):0;
|
||||
s.transitionInterpenetrationMicrometres=0;
|
||||
s.transitionHonouredInCore=s.transitionMode=="Hard";
|
||||
s.transitionFallsBackToHard=s.transitionMode!="Hard";
|
||||
?std::min(s.transitionWidthMicrometres/2,
|
||||
static_cast<std::int64_t>(owner.StrateLayoutChunkSizeMicrometres)):0;
|
||||
s.transitionInterpenetrationMicrometres=s.transitionMode=="Interleaved"
|
||||
?s.transitionWidthMicrometres
|
||||
:s.transitionMode=="Gradient"?s.transitionWidthMicrometres/4:0;
|
||||
s.transitionFallsBackToHard=s.transitionMode!="Hard"
|
||||
&&s.transitionWidthMicrometres<=0;
|
||||
s.transitionHonouredInCore=s.transitionMode=="Hard"||!s.transitionFallsBackToHard;
|
||||
s.transitionDispatchPath=s.transitionFallsBackToHard
|
||||
?"declared Gradient/Interleaved recorded; Core uses explicit Hard fallback with zero interpenetration"
|
||||
:"declared Hard transition applied at the strate interface";
|
||||
?"declared zero-width transition uses explicit Hard fallback"
|
||||
:s.transitionMode=="Hard"
|
||||
?"declared Hard transition preserves the flat shared bedrock/ceiling interface"
|
||||
:s.transitionMode=="Interleaved"
|
||||
?"shared composition overlaps both facing bands with deterministic domain-warped fingers inside the declared width"
|
||||
:"shared composition moves both band faces together with the smooth declared-width transition field";
|
||||
s.managerLookup="UVoxelStrateManager selects the slot from the director-resolved layout chunk width";
|
||||
s.managerChunkWidthMicrometres=owner.StrateLayoutChunkSizeMicrometres;
|
||||
s.dispatchChunkWidthMicrometres=owner.StrateLayoutChunkSizeMicrometres;
|
||||
|
||||
Reference in new issue
Block a user