perf(noise): batch the three cave-warp channels through the SIMD evaluator -- exact, ~4% faster

The remove-one ablation, re-confirmed on the current build, puts the cave warp at 11.0% static /
11.8% moving of worker time: three independent Perlin3D calls per sample. VoxelNoise::Perlin3D_x3
evaluates the three warp channels together through the existing SIMD evaluator (Codex; reviewed
by me). It is wired into the generator, op-stack, classifier and room/player-fit unwarp paths.

Exact: the field is byte-identical. 0/841 tiles changed, 0 triangle delta, 0 voxels of maximum
surface displacement; canonical export 07C14005 / b3e5f4c3..9b377; capability 20,830 / 10,909;
strate-crossing and sealed-proof tests pass. The seam test (VoxelForgeMazeSeamTest, extended) has
48 neighbouring-tile and 24 cross-LOD comparisons, 0 mismatches. Before/after renders from a
camera aimed at the real arrival tunnel are byte-identical.

Cross-machine determinism: Perlin3D_x3 adds no new intrinsics, no AVX, no FMA and no runtime CPU
dispatch. It reuses the evaluator behind the compile-time gate
`#if PLATFORM_ENABLE_VECTORINTRINSICS && PLATFORM_CPU_X86_FAMILY`, so every x64 machine runs the same
instruction path; its output matches the scalar path bit for bit.

Final DEFAULT build vs the committed-tip DLL (two interleaved runs each):
  static  worker 30.83 -> 29.47 s (-4.4%)   LOD0 generation p50/p95 56.3/99.3 -> 53.3/95.3 ms
  moving  worker 67.28 -> 64.56 s (-4.0%)   LOD0 generation p50/p95 55.9/99.0 -> 53.4/96.4 ms
Ledger: every launch passed; two harness false negatives (the seam test on the game-only
validator, and a trace ended by intentional forced termination) were rerun. No crash folders.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TaFdXhTdYMkW1xrV6ApT6Y
This commit is contained in:
Fr0zkaandClaude Opus 5 committed 2026-09-15 08:41:59 +02:00
1 parent ce4d8783e9
commit 1d824aaab2
5 files changed
+235 -31

No files matched your search

@@ -3110,21 +3110,21 @@ namespace
const float Frequency = Params.CaveWarpFrequency;
const float Strength = Params.CaveWarpStrength;
Warped.X += VoxelNoise::Perlin3D(
float WarpX, WarpY, WarpZ;
VoxelNoise::Perlin3D_x3(
WorldPoint.X * Frequency + VoxelHash::SeedOffset(Seed, 0.37f),
WorldPoint.Y * Frequency + 1.3f,
EffectiveZ * Frequency + 5.7f)
* VOXEL_NOISE_SCALE * Strength;
Warped.Y += VoxelNoise::Perlin3D(
EffectiveZ * Frequency + 5.7f,
WorldPoint.X * Frequency + 7.1f,
WorldPoint.Y * Frequency + VoxelHash::SeedOffset(Seed, 0.59f),
EffectiveZ * Frequency + 2.3f)
* VOXEL_NOISE_SCALE * Strength;
Warped.Z += VoxelNoise::Perlin3D(
EffectiveZ * Frequency + 2.3f,
WorldPoint.X * Frequency + 11.3f,
WorldPoint.Y * Frequency + 9.7f,
EffectiveZ * Frequency + VoxelHash::SeedOffset(Seed, 0.41f))
* VOXEL_NOISE_SCALE * Strength;
EffectiveZ * Frequency + VoxelHash::SeedOffset(Seed, 0.41f),
WarpX, WarpY, WarpZ);
Warped.X += WarpX * VOXEL_NOISE_SCALE * Strength;
Warped.Y += WarpY * VOXEL_NOISE_SCALE * Strength;
Warped.Z += WarpZ * VOXEL_NOISE_SCALE * Strength;
return Warped;
}