Stopped by low memory (another app held 12.5 GB; processes failed with 0xC0000142). Editor-only, default off: a seeded connected room graph (varied chambers on a spanning network, optional loops, shafts, rock features, ledges, basin floors), eight parameter profiles, the step-2d brick driver and detail bands, a new test VoxelForge.ParameterizedGeneration.TraversalSeeds (PASS in step2e_functional_01, which also proves the tree compiles). Existing live tests untouched. Not yet run: the eight-profile ring benchmark, variety metrics, slices, detail/artefact/determinism checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MmSoF64BbRFmk9C3p1VsBJ
163 lines
6.1 KiB
C++
163 lines
6.1 KiB
C++
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
|
|
class UVoxelGenerator;
|
|
|
|
namespace VoxelForgeRegionEval
|
|
{
|
|
constexpr int32 WorkerCount = 6;
|
|
constexpr int32 RingDimension = 259;
|
|
// 1/16 voxel resolution covers the full prepared test field without clipping ordinary
|
|
// interior/exterior distances into indistinguishable int16 saturation values.
|
|
constexpr double QuantizationScale = 16.0;
|
|
|
|
struct FTiming
|
|
{
|
|
int32 Workers = WorkerCount;
|
|
int32 ObservedWorkerThreads = 0;
|
|
int64 SampleCount = 0;
|
|
int64 EvaluatedSamples = 0;
|
|
int64 RegionCount = 0;
|
|
int64 FallbackSamples = 0;
|
|
uint64 GeneralPathEntries = 0;
|
|
uint64 SupportedBlockSetupEntries = 0;
|
|
double FallbackShare = 0.0;
|
|
double GeneralPathEntriesPerSample = 0.0;
|
|
double WallSeconds = 0.0;
|
|
double WorkerCpuSeconds = 0.0;
|
|
double BrickClassificationSeconds = 0.0;
|
|
double DensityEvaluationSeconds = 0.0;
|
|
double UniformFillSeconds = 0.0;
|
|
double NanosecondsPerSample = 0.0;
|
|
bool bWorkerCpuFromOsThreadTimes = false;
|
|
bool bRegionProgram = false;
|
|
bool bHasWholeRunCounters = false;
|
|
uint64 QuantizedHash = 0;
|
|
uint64 RawFloatHash = 0;
|
|
uint64 SaturatedSamples = 0;
|
|
uint64 NonFiniteSamples = 0;
|
|
uint64 BrickCount = 0;
|
|
uint64 SkippedBricks = 0;
|
|
uint64 SkippedSamples = 0;
|
|
uint64 MacroBrickChecks = 0;
|
|
uint64 MacroCentreEvaluations = 0;
|
|
uint64 UnsupportedBrickProofs = 0;
|
|
uint64 ChunkBoundaryBrickProofs = 0;
|
|
uint64 PassageBoundBrickProofs = 0;
|
|
uint64 MixedMacroBrickProofs = 0;
|
|
double LongestWorkerWallSeconds = 0.0;
|
|
uint64 SdfCacheBuilds = 0;
|
|
uint64 ActiveOpListBuilds = 0;
|
|
uint64 BroadPhaseIndexBuilds = 0;
|
|
uint64 SdfSpatialIndexBuilds = 0;
|
|
uint64 SdfBrickIndexBuilds = 0;
|
|
uint64 RoomCandidateVisits = 0;
|
|
uint64 RoomEvaluations = 0;
|
|
uint64 TunnelCandidateVisits = 0;
|
|
uint64 TunnelEvaluations = 0;
|
|
uint64 TunnelCoreCandidateVisits = 0;
|
|
uint64 TunnelCoreEvaluations = 0;
|
|
uint64 PassageCandidateVisits = 0;
|
|
uint64 PassageEvaluations = 0;
|
|
uint64 TotalCandidateVisits = 0;
|
|
uint64 TotalCandidateEvaluations = 0;
|
|
double CandidateVisitsPerSample = 0.0;
|
|
double CandidateEvaluationsPerSample = 0.0;
|
|
double GetDensityAtNsPerSample = 0.0;
|
|
double OperatorBlockNsPerSample = 0.0;
|
|
double RoomGraphSourceNsPerSample = 0.0;
|
|
double RoomGraphBuildNsPerSample = 0.0;
|
|
double RoomGraphSdfNsPerSample = 0.0;
|
|
double FusedEvaluatorNsPerSample = 0.0;
|
|
double TunnelCoreSdfNsPerSample = 0.0;
|
|
double TunnelCoreWorldNsPerSample = 0.0;
|
|
double TunnelCorePostsNsPerSample = 0.0;
|
|
double PassageModifierNsPerSample = 0.0;
|
|
double PassageStructuralPostsNsPerSample = 0.0;
|
|
double PassageFloorNsPerSample = 0.0;
|
|
double StructuralPostsNsPerSample = 0.0;
|
|
double DensityPrologueNsPerSample = 0.0;
|
|
double DensityCoreNsPerSample = 0.0;
|
|
double DisturbancesNsPerSample = 0.0;
|
|
double DensityBoundarySealNsPerSample = 0.0;
|
|
double DiffLayerNsPerSample = 0.0;
|
|
double DensityTailNsPerSample = 0.0;
|
|
};
|
|
|
|
struct FCandidateVisits
|
|
{
|
|
int64 SampleCount = 0;
|
|
uint64 Room = 0;
|
|
uint64 RoomEvaluated = 0;
|
|
uint64 Tunnel = 0;
|
|
uint64 TunnelEvaluated = 0;
|
|
uint64 TunnelCore = 0;
|
|
uint64 TunnelCoreEvaluated = 0;
|
|
uint64 Passage = 0;
|
|
uint64 PassageEvaluated = 0;
|
|
uint64 TunnelCacheLookups = 0;
|
|
uint64 TunnelCacheHits = 0;
|
|
uint64 TunnelCacheMisses = 0;
|
|
uint64 SdfCacheBuilds = 0;
|
|
uint64 Total = 0;
|
|
uint64 TotalEvaluated = 0;
|
|
double PerSample = 0.0;
|
|
double EvaluatedPerSample = 0.0;
|
|
uint32 AttributionSampleInterval = 0;
|
|
double GetDensityAtAttributedNsPerSample = 0.0;
|
|
double DensityPrologueAttributedNsPerSample = 0.0;
|
|
double DensityCoreAttributedNsPerSample = 0.0;
|
|
double DensityDisturbancesAttributedNsPerSample = 0.0;
|
|
double DensityStructuralPostsAttributedNsPerSample = 0.0;
|
|
double DensityBoundarySealAttributedNsPerSample = 0.0;
|
|
double DensityDiffLayerAttributedNsPerSample = 0.0;
|
|
double DensityTailAttributedNsPerSample = 0.0;
|
|
};
|
|
|
|
/**
|
|
* Evaluate a deterministic lattice through the live final-field API. The prepared mode uses
|
|
* the commandlet-only 8^3 SDF candidate bins and chunk-sized operator blocks. FullRing assigns
|
|
* each chunk to one worker and writes every lattice density exactly once. SampleIndices are
|
|
* sorted lattice offsets for the statistical correctness / candidate-counter sweeps.
|
|
*/
|
|
bool Evaluate(
|
|
const UVoxelGenerator& Generator,
|
|
FIntVector OriginVoxels,
|
|
int32 Dimension,
|
|
const TArray<int64>* SampleIndices,
|
|
bool bFullRing,
|
|
bool bPrepared,
|
|
float ReachScale,
|
|
TArray<float>* OutDensities,
|
|
FTiming& OutTiming,
|
|
bool bRegionProgram = false,
|
|
int32 RequestedWorkerCount = WorkerCount,
|
|
bool bCollectWholeRunCounters = false);
|
|
|
|
/** Full-resolution step 2d field pass with sound world-aligned 8^3 brick proofs. */
|
|
bool EvaluateRedefined(
|
|
const UVoxelGenerator& Generator,
|
|
FIntVector OriginVoxels,
|
|
int32 Dimension,
|
|
int32 RequestedWorkerCount,
|
|
float DetailScale,
|
|
TArray<float>& OutDensities,
|
|
FTiming& OutTiming,
|
|
bool bEnableBrickSkips = true,
|
|
bool bParameterized = false);
|
|
|
|
/** Count exact room/tunnel/core/passage candidate visits with instrumentation enabled. */
|
|
FCandidateVisits CountCandidates(
|
|
const UVoxelGenerator& Generator,
|
|
FIntVector OriginVoxels,
|
|
int32 Dimension,
|
|
const TArray<int64>& SampleIndices,
|
|
bool bPrepared,
|
|
float ReachScale);
|
|
|
|
int16 QuantizeDensity(float Density, bool& bOutSaturated, bool& bOutFinite);
|
|
uint64 HashQuantized(const TArray<float>& Densities);
|
|
int64 LinearIndex(int32 X, int32 Y, int32 Z, int32 Dimension);
|
|
}
|