wip(assembler): round S14 -- 4-way column cache + memoized MC gradients (output unchanged)
Worker-local XY column cache uses deterministic 4-way sets at LOD3-8: LOD4 misses 8,224 -> 1,437, conflicts 7,407 -> 0 (direct-map control: 6.62 s / 43.5 worker-s vs 4.24 s / 21.7). Exact LOD0 lattice gradients memoized per tile: MC-exclusive 242 -> 201 ns/sample, two-pass loop unchanged. Hashes identical, no recipe bump. Primary cold trace 4.24 s full set, ring 0.45 s, 75/75 at 40 m/s; a repeat ran uniformly ~40% slower on every LOD (machine contention suspected); tick p95 to re-check on an idle machine. CVars voxel.CoreColumnCacheDirectMapped / voxel.CoreMCGradientMemoization. Report: Standalone/Research/WorldAssemblerM3/Round18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MmSoF64BbRFmk9C3p1VsBJ
This commit is contained in:
1 parent
bd5e38594f
commit
ec2afe9c93
11 files changed
+769
-50
No files matched your search
@@ -235,6 +235,18 @@ namespace
|
||||
GVoxelForgeStreamingBackgroundWorkerCap,
|
||||
TEXT("Size tile admission slots to the TaskGraph background workers used by tile tasks; 0 restores the logical-core cap."));
|
||||
|
||||
int32 GVoxelForgeCoreColumnCacheDirectMapped = 0;
|
||||
FAutoConsoleVariableRef CVarVoxelForgeCoreColumnCacheDirectMapped(
|
||||
TEXT("voxel.CoreColumnCacheDirectMapped"),
|
||||
GVoxelForgeCoreColumnCacheDirectMapped,
|
||||
TEXT("Negative control: 0 uses the four-way deterministic XY column cache; 1 restores S13 direct-map indexing."));
|
||||
|
||||
int32 GVoxelForgeCoreMCGradientMemoization = 1;
|
||||
FAutoConsoleVariableRef CVarVoxelForgeCoreMCGradientMemoization(
|
||||
TEXT("voxel.CoreMCGradientMemoization"),
|
||||
GVoxelForgeCoreMCGradientMemoization,
|
||||
TEXT("Negative control: 1 reuses exact LOD0 lattice gradients across adjacent MC cells; 0 restores per-cell gradient probes."));
|
||||
|
||||
int32 GVoxelForgeProfileTileGeneration = 0;
|
||||
FAutoConsoleVariableRef CVarVoxelForgeProfileTileGeneration(
|
||||
TEXT("voxel.ProfileTileGeneration"),
|
||||
@@ -2080,6 +2092,8 @@ void AVoxelWorld::BeginPlay()
|
||||
int32 CommandLineStreamingResultBacklogCap = GVoxelForgeStreamingResultBacklogCap;
|
||||
int32 CommandLineStreamingReadyQueueDepth = GVoxelForgeStreamingReadyQueueDepth;
|
||||
int32 CommandLineStreamingBackgroundWorkerCap = GVoxelForgeStreamingBackgroundWorkerCap;
|
||||
int32 CommandLineCoreColumnCacheDirectMapped = GVoxelForgeCoreColumnCacheDirectMapped;
|
||||
int32 CommandLineCoreMCGradientMemoization = GVoxelForgeCoreMCGradientMemoization;
|
||||
int32 CommandLineStep1GenerationCap = GVoxelForgeStep1GenerationCap;
|
||||
int32 CommandLineStep1ExitAfterFrames = GVoxelForgeStep1ExitAfterFrames;
|
||||
int32 CommandLineStep1CsvCaptureOnBeginPlay = GVoxelForgeStep1CsvCaptureOnBeginPlay;
|
||||
@@ -2186,6 +2200,18 @@ void AVoxelWorld::BeginPlay()
|
||||
GVoxelForgeStreamingBackgroundWorkerCap =
|
||||
CommandLineStreamingBackgroundWorkerCap != 0 ? 1 : 0;
|
||||
}
|
||||
if (FParse::Value(FCommandLine::Get(), TEXT("voxel.CoreColumnCacheDirectMapped="),
|
||||
CommandLineCoreColumnCacheDirectMapped))
|
||||
{
|
||||
GVoxelForgeCoreColumnCacheDirectMapped=
|
||||
CommandLineCoreColumnCacheDirectMapped!=0?1:0;
|
||||
}
|
||||
if (FParse::Value(FCommandLine::Get(), TEXT("voxel.CoreMCGradientMemoization="),
|
||||
CommandLineCoreMCGradientMemoization))
|
||||
{
|
||||
GVoxelForgeCoreMCGradientMemoization=
|
||||
CommandLineCoreMCGradientMemoization!=0?1:0;
|
||||
}
|
||||
if (FParse::Value(FCommandLine::Get(), TEXT("voxel.Step1PrequeueVisibleLOD0="),
|
||||
CommandLineStep1PrequeueVisibleLOD0))
|
||||
{
|
||||
@@ -2609,7 +2635,9 @@ void AVoxelWorld::BeginPlay()
|
||||
"\"streaming_legacy_pending_result_cap\":%d,"
|
||||
"\"streaming_collision_lookahead\":%d,\"core_region_concurrent_admission\":%d,"
|
||||
"\"collision_gate\":%d,"
|
||||
"\"streaming_result_backlog_cap\":%d,\"streaming_startup_apply_boost\":%d"),
|
||||
"\"streaming_result_backlog_cap\":%d,\"streaming_startup_apply_boost\":%d,"
|
||||
"\"core_column_cache_direct_mapped\":%d,"
|
||||
"\"core_mc_gradient_memoization\":%d"),
|
||||
FPlatformMisc::NumberOfCoresIncludingHyperthreads(), GetMaxConcurrentStreamingTasks(),
|
||||
TaskScheduler.GetNumWorkers(), TaskScheduler.GetMaxNumWorkers(),
|
||||
static_cast<int32>(TaskScheduler.GetWorkerPriority()),
|
||||
@@ -2622,7 +2650,9 @@ void AVoxelWorld::BeginPlay()
|
||||
GVoxelForgeStreamingLegacyPendingResultCap,
|
||||
GVoxelForgeStreamingCollisionLookahead, GVoxelForgeCoreRegionConcurrentAdmission,
|
||||
GVoxelForgeCollisionGate,
|
||||
GVoxelForgeStreamingResultBacklogCap, GVoxelForgeStreamingStartupApplyBoost));
|
||||
GVoxelForgeStreamingResultBacklogCap, GVoxelForgeStreamingStartupApplyBoost,
|
||||
GVoxelForgeCoreColumnCacheDirectMapped,
|
||||
GVoxelForgeCoreMCGradientMemoization));
|
||||
VoxelForgeStartupTrace::RecordEvent(TEXT("streaming_worker_cap_readback"), FString::Printf(
|
||||
TEXT("\"streaming_background_worker_cap\":%d,\"background_worker_threads\":%d,"
|
||||
"\"effective_tile_slots\":%d"),
|
||||
@@ -13043,13 +13073,15 @@ void AVoxelWorld::LoadCoreTile(const FVoxelTileKey& Tile, EVoxelTileWorkPriority
|
||||
VoxelForgeStartupTrace::RecordRequest(RequestSample, TaskEpoch);
|
||||
}
|
||||
const bool bCaptureHashes = bCaptureVoxelForgeCoreHashesForValidation;
|
||||
const bool bLegacyDirectMappedColumnCache=GVoxelForgeCoreColumnCacheDirectMapped!=0;
|
||||
const bool bMemoizeCoreMCGradients=GVoxelForgeCoreMCGradientMemoization!=0;
|
||||
const UE::Tasks::ETaskPriority TaskPriority = bNearPriority
|
||||
? UE::Tasks::ETaskPriority::BackgroundHigh
|
||||
: UE::Tasks::ETaskPriority::BackgroundNormal;
|
||||
UE::Tasks::Launch(TEXT("VoxelForgeCoreTile"),
|
||||
[this, State, Cancellation, Tile, WorkPriority, TaskEpoch, TaskDesiredEpoch,
|
||||
TaskModificationEpoch, RequestStartCycles, RequestOrdinal, bResidentAtRequest,
|
||||
bCaptureHashes]()
|
||||
bCaptureHashes,bLegacyDirectMappedColumnCache,bMemoizeCoreMCGradients]()
|
||||
{
|
||||
struct FTaskGuard
|
||||
{
|
||||
@@ -13153,6 +13185,8 @@ void AVoxelWorld::LoadCoreTile(const FVoxelTileKey& Tile, EVoxelTileWorkPriority
|
||||
break;
|
||||
}
|
||||
Options.hashDensity = bCaptureHashes;
|
||||
Options.legacyDirectMappedColumnCache=bLegacyDirectMappedColumnCache;
|
||||
Options.memoizeMcGradients=bMemoizeCoreMCGradients;
|
||||
std::string CoreError;
|
||||
std::optional<VoxelForgeCore::TileMesh> CoreMesh;
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user