tools(verify): fast/medium/full verification tiers with a compiled-in source stamp (L39); research R6

BuildLinux.sh hashes a sorted manifest of compiled inputs into VOXELFORGE_SOURCE_STAMP, printed first by
every executable; Standalone/Tools/verify/verify.py checks it before and after each tier and records
binary/input hashes and the resolved recipe, style map and layout. Fast (163 s) runs on the canonical owner
world only and asserts FI Style 2 / SW Style 1; medium (8 min) and full (26 min) add the style matrix,
GCC, determinism and cost. Controls: stale source, mislabelled style-0 owner, all-black capture, L30/L31,
L35/L36 and the L38 step are all rejected. No geometry change; owner hashes identical to L37.
Research R6: leak table, generator contract and a 10-step metre-native migration plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016dhxM43dnWvUu2B5Ph1iG1
This commit is contained in:
Fr0zkaandClaude Opus 5.5 committed 2026-10-23 15:27:52 +02:00
1 parent 88c54eab44
commit 753cc9c259
22 files changed
+1831 -163

No files matched your search

+35 -1
View File
@@ -1,3 +1,4 @@
#include "SourceStamp.h"
#include "OwnerWorldLoader.h"
#include "StandaloneCoreScheduler.h"
#include "StreamBenchmarkPipeline.h"
@@ -316,6 +317,8 @@ namespace
int main(int argc,char** argv)
{
VoxelForgePrintSourceStamp();
if(argc==2&&std::string_view(argv[1])=="--print-source-stamp")return 0;
using Clock=std::chrono::steady_clock;
const auto coldStart=Clock::now();
FOptions options;
@@ -402,13 +405,33 @@ int main(int argc,char** argv)
if(!roundTrip||roundTrip->ToJson()!=layoutJson||roundTrip->stableIdentity!=resolvedLayout.stableIdentity)
{if(error.empty())error="resolved-layout canonical serialization did not round-trip";
std::fprintf(stderr,"Resolved-layout round trip failed: %s\n",error.c_str());return 2;}
std::string resolvedStrateStyles="{";
bool firstResolvedStrateStyle=true;
for(const FStrateSlot& slot:ownerWorld->Manager->GetLayout())
{
if(!slot.Definition)continue;
const auto resolvedStrate=std::find_if(resolvedLayout.strates.begin(),
resolvedLayout.strates.end(),[&](const auto& value)
{return value.strateIndex==slot.StrateIndex;});
if(resolvedStrate==resolvedLayout.strates.end())continue;
const auto style=static_cast<std::uint32_t>(slot.Definition->PassageConfig.Style);
if(!firstResolvedStrateStyle)resolvedStrateStyles+=',';
firstResolvedStrateStyle=false;
resolvedStrateStyles.push_back('"');
resolvedStrateStyles+=std::to_string(slot.StrateIndex);
resolvedStrateStyles+="\":";
resolvedStrateStyles+=std::to_string(style);
}
resolvedStrateStyles+='}';
const std::string layoutOutputJson=layoutJson.substr(0,layoutJson.size()-1)
+",\"resolved_strate_passage_styles\":"+resolvedStrateStyles+"}";
if(!options.ResolvedLayoutOutputPath.empty())
{
if(!options.ResolvedLayoutOutputPath.parent_path().empty())
std::filesystem::create_directories(options.ResolvedLayoutOutputPath.parent_path());
std::ofstream output(options.ResolvedLayoutOutputPath,std::ios::binary);
if(!output){std::fprintf(stderr,"Could not write resolved-layout snapshot: %s\n",options.ResolvedLayoutOutputPath.c_str());return 2;}
output.write(layoutJson.data(),static_cast<std::streamsize>(layoutJson.size()));
output.write(layoutOutputJson.data(),static_cast<std::streamsize>(layoutOutputJson.size()));
if(!output){std::fprintf(stderr,"Resolved-layout snapshot write failed: %s\n",options.ResolvedLayoutOutputPath.c_str());return 2;}
}
const auto controls=VoxelForgeCore::AuditResolvedLayoutValidatorV3();
@@ -423,6 +446,17 @@ int main(int argc,char** argv)
VoxelForgeCore::ResolvedLayoutValidationModeV3::strict,strictIssues,strictError);
std::printf("[ResolvedLayoutSnapshot] schema=%u stable_identity=%s strata=%zu bytes=%zu round_trip=PASS\n",
resolvedLayout.schemaVersion,resolvedLayout.stableIdentity.c_str(),resolvedLayout.strates.size(),layoutJson.size());
for(const FStrateSlot& slot:ownerWorld->Manager->GetLayout())
{
if(!slot.Definition)continue;
const auto resolvedStrate=std::find_if(resolvedLayout.strates.begin(),
resolvedLayout.strates.end(),[&](const auto& value)
{return value.strateIndex==slot.StrateIndex;});
if(resolvedStrate!=resolvedLayout.strates.end())
std::printf("[ResolvedStratePassageStyle] strate_index=%d generator_kind=%s style=%u\n",
slot.StrateIndex,resolvedStrate->generatorKind.c_str(),
static_cast<std::uint32_t>(slot.Definition->PassageConfig.Style));
}
const auto requestedRecipe=options.FloatingIslandsRecipe
?std::string_view("floating-islands"):std::string_view("surface-world");
const auto topStratum=std::max_element(resolvedLayout.strates.begin(),resolvedLayout.strates.end(),