profile: per-term legacy FI/TN sample profiler (L76); passage/support is ~75% of field time

Opt-in at build time (VOXELFORGE_PROFILE_LEGACY_TERMS=1; compiled out by default, ~2% when on).
Per legacy sample: passage/support composer ~1.05 us vs primitive scan ~0.19 us, boundary
band ~0.06 us, noise ~0.01 us. Resolved-passage constants are cached at field binding
(arithmetic order unchanged); whole-view effect within noise. Per-tile hashes identical to L75
in all 24 compiler x worker x view comparisons; fast tier PASS; Linux UE host builds.
R40 researcher notes attached.

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-27 16:25:19 +01:00
1 parent 9d5455ec68
commit 90378a585f
13 files changed
+1070 -86

No files matched your search

@@ -5058,6 +5058,15 @@ namespace StandaloneStreamBenchmark
std::array<std::uint64_t,9> MeshingSkippedTilesByLOD{},DensityGridTilesByLOD{};
std::array<std::uint64_t,9> DensityPointCallsByLOD{},DensityFieldEvalNanosecondsByLOD{};
std::array<std::uint64_t,9> DensityFieldEvalSamplePointsByLOD{};
std::array<std::uint64_t,9> LegacyFieldEvalCallsByLOD{};
std::array<std::array<std::uint64_t,9>,9> LegacyFieldTermCallsByLOD{};
std::array<std::array<std::uint64_t,9>,9> LegacyFieldTermNanosecondsByLOD{};
std::array<std::array<std::uint64_t,9>,9> LegacyFieldTermTimedCallsByLOD{};
std::array<std::uint64_t,9> LegacyPrimitiveCandidateVisitsByLOD{};
std::array<std::uint64_t,9> LegacyPrimitiveDistanceEvaluationsByLOD{};
std::array<std::uint64_t,9> LegacySmoothMinCallsByLOD{};
std::array<std::uint64_t,9> LegacySmoothMinNanosecondsByLOD{};
std::array<std::uint64_t,9> LegacySmoothMinTimedCallsByLOD{};
std::array<std::uint64_t,9> ProofAirCellsByLOD{},ProofSolidCellsByLOD{};
std::array<double,9> PayloadBuildMsByLOD{};
std::array<std::uint64_t,9> BaseRouteTilesByLOD{},PageRouteTilesByLOD{};
@@ -5128,6 +5137,25 @@ namespace StandaloneStreamBenchmark
TileDiagnostics.densityFieldEvalNanoseconds;
DensityFieldEvalSamplePointsByLOD[LOD]+=
TileDiagnostics.densityFieldEvalSamplePoints;
LegacyFieldEvalCallsByLOD[LOD]+=TileDiagnostics.legacyFieldEvalCalls;
for(std::size_t Term=0;Term<TileDiagnostics.legacyFieldTermCalls.size();++Term)
{
LegacyFieldTermCallsByLOD[LOD][Term]+=
TileDiagnostics.legacyFieldTermCalls[Term];
LegacyFieldTermNanosecondsByLOD[LOD][Term]+=
TileDiagnostics.legacyFieldTermNanoseconds[Term];
LegacyFieldTermTimedCallsByLOD[LOD][Term]+=
TileDiagnostics.legacyFieldTermTimedCalls[Term];
}
LegacyPrimitiveCandidateVisitsByLOD[LOD]+=
TileDiagnostics.legacyPrimitiveCandidateVisits;
LegacyPrimitiveDistanceEvaluationsByLOD[LOD]+=
TileDiagnostics.legacyPrimitiveDistanceEvaluations;
LegacySmoothMinCallsByLOD[LOD]+=TileDiagnostics.legacySmoothMinCalls;
LegacySmoothMinNanosecondsByLOD[LOD]+=
TileDiagnostics.legacySmoothMinNanoseconds;
LegacySmoothMinTimedCallsByLOD[LOD]+=
TileDiagnostics.legacySmoothMinTimedCalls;
ProofAirCellsByLOD[LOD]+=TileDiagnostics.marchingCubesProofSkippedAirCells;
ProofSolidCellsByLOD[LOD]+=TileDiagnostics.marchingCubesProofSkippedSolidCells;
PayloadBuildMsByLOD[LOD]+=Tile.PayloadBuildMilliseconds;
@@ -5603,6 +5631,45 @@ namespace StandaloneStreamBenchmark
static_cast<unsigned long long>(ProofAirCellsByLOD[LOD]),
static_cast<unsigned long long>(ProofSolidCellsByLOD[LOD]),
PayloadBuildMsByLOD[LOD]);
static constexpr std::array<const char*,9> LegacyTermNames={
"primitive_scan","detail","surface_relief_noise","owner_noise_warp",
"composer_cavern","composer_boundary","composer_passage_support",
"composer_stamps","edit_brushes"};
std::uint64_t TermCalls=0;
for(const auto Calls:LegacyFieldTermCallsByLOD[LOD])TermCalls+=Calls;
if(TermCalls>0)
{
std::printf("[WorldAssemblerLODLegacyField] lod=%zu samples=%llu term_calls=%llu primitive_candidates=%llu primitive_distances=%llu smooth_min_calls=%llu smooth_min_samples=%llu smooth_min_ns=%llu smooth_min_ms_est=%.3f\n",
LOD,static_cast<unsigned long long>(LegacyFieldEvalCallsByLOD[LOD]),
static_cast<unsigned long long>(TermCalls),
static_cast<unsigned long long>(LegacyPrimitiveCandidateVisitsByLOD[LOD]),
static_cast<unsigned long long>(LegacyPrimitiveDistanceEvaluationsByLOD[LOD]),
static_cast<unsigned long long>(LegacySmoothMinCallsByLOD[LOD]),
static_cast<unsigned long long>(LegacySmoothMinTimedCallsByLOD[LOD]),
static_cast<unsigned long long>(LegacySmoothMinNanosecondsByLOD[LOD]),
LegacySmoothMinTimedCallsByLOD[LOD]
?static_cast<double>(LegacySmoothMinNanosecondsByLOD[LOD])
*static_cast<double>(LegacySmoothMinCallsByLOD[LOD])
/static_cast<double>(LegacySmoothMinTimedCallsByLOD[LOD])/1.0e6
:0.0);
for(std::size_t Term=0;Term<LegacyTermNames.size();++Term)
{
const std::uint64_t Calls=LegacyFieldTermCallsByLOD[LOD][Term];
const std::uint64_t TimedCalls=LegacyFieldTermTimedCallsByLOD[LOD][Term];
if(Calls==0)continue;
const double EstimatedMilliseconds=TimedCalls
?static_cast<double>(LegacyFieldTermNanosecondsByLOD[LOD][Term])
*static_cast<double>(Calls)
/static_cast<double>(TimedCalls)/1.0e6
:0.0;
std::printf("[WorldAssemblerLODLegacyTerm] lod=%zu term=%s calls=%llu timed_calls=%llu timed_ns=%llu worker_ms_est=%.3f\n",
LOD,LegacyTermNames[Term],
static_cast<unsigned long long>(Calls),
static_cast<unsigned long long>(TimedCalls),
static_cast<unsigned long long>(LegacyFieldTermNanosecondsByLOD[LOD][Term]),
EstimatedMilliseconds);
}
}
}
if(bReportLodWorkProfile)
{