From 30448bb45e703170615dd7bdd11012a990fa5e18 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 4 Oct 2026 03:16:31 +0200 Subject: [PATCH] Re-pin SNOISE_LIPSCHITZ to 7.9640074 on the tie-fixed kernel MeasureLipschitz on e89fd687 (Yggdrasil): sampled 7.1933103, refined 7.2400064, x 1.10 = 7.9640074, witness (229.92526, 73.37927, -66.14595). The old 9.181147 sat on the diagonal tie. C#, both Interval.hlsl copies, the pin test's witness and design.md's provenance numbers move together; CultMath.glsl follows with the regenerated fixture. Co-Authored-By: Claude Sonnet 5.5 --- packages/cultmath/docs/design.md | 2 +- packages/cultmath/shaders/CultMath.Interval.hlsl | 2 +- packages/cultmath/src/CultMath/math.Interval.cs | 2 +- packages/cultmath/tests/CultMath.Tests/NoiseBoundTests.cs | 2 +- .../unity/org.gamecult.cultmath/Shaders/CultMath.Interval.hlsl | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/cultmath/docs/design.md b/packages/cultmath/docs/design.md index ec6ee86c..d29ade17 100644 --- a/packages/cultmath/docs/design.md +++ b/packages/cultmath/docs/design.md @@ -571,7 +571,7 @@ with no tolerance. `L` has provenance, not a proof. `NoiseBoundTests.MeasureLipschitz` (slow, explicit) takes the largest `|snoise_grad|` over 1e6 seeded points in [-256, 256]^3 (7.1933103), refines the 1e4 largest by gradient ascent -(9.181147), and multiplies by 1.10: `L = 10.099261`. It also reaches +(7.2400064), and multiplies by 1.10: `L = 7.9640074`. It also reaches `|snoise| = 0.9718335` by the same ascent on the value, which is what lets the bound intersect with `[-1, 1]`. `LipschitzConstantPinsSampledGradients` checks 1e5 more seeded points against `L` and climbs again from the start diff --git a/packages/cultmath/shaders/CultMath.Interval.hlsl b/packages/cultmath/shaders/CultMath.Interval.hlsl index b6b16665..22c19221 100644 --- a/packages/cultmath/shaders/CultMath.Interval.hlsl +++ b/packages/cultmath/shaders/CultMath.Interval.hlsl @@ -7,7 +7,7 @@ // Included by CultMath.hlsl after its own definitions of cultmath_smoothstep and cultmath_snoise. // Lipschitz constant of cultmath_snoise(float3); provenance in math.Interval.cs (SNOISE_LIPSCHITZ). -static const float CULTMATH_SNOISE_LIPSCHITZ = 10.099261; +static const float CULTMATH_SNOISE_LIPSCHITZ = 7.9640074; float2 cultmath_iv_point(float value) { return float2(value, value); } float2 cultmath_iv_add(float2 a, float2 b) { return float2(a.x + b.x, a.y + b.y); } diff --git a/packages/cultmath/src/CultMath/math.Interval.cs b/packages/cultmath/src/CultMath/math.Interval.cs index 91e99f87..ec6c1ea6 100644 --- a/packages/cultmath/src/CultMath/math.Interval.cs +++ b/packages/cultmath/src/CultMath/math.Interval.cs @@ -18,7 +18,7 @@ public static partial class math // against a fast re-measure and the ascent from MeasureLipschitz's witness. // Empirical with a margin, not a proof; the enclosure tests are the defence. A change to the // snoise kernel must re-run MeasureLipschitz and re-pin this constant. - public const float SNOISE_LIPSCHITZ = 10.099261f; + public const float SNOISE_LIPSCHITZ = 7.9640074f; /// The point interval [x, x]. public static float2 iv_point(float value) => new(value, value); diff --git a/packages/cultmath/tests/CultMath.Tests/NoiseBoundTests.cs b/packages/cultmath/tests/CultMath.Tests/NoiseBoundTests.cs index 2b00ca88..b79eda0a 100644 --- a/packages/cultmath/tests/CultMath.Tests/NoiseBoundTests.cs +++ b/packages/cultmath/tests/CultMath.Tests/NoiseBoundTests.cs @@ -456,7 +456,7 @@ public sealed class NoiseBoundTests } // The start MeasureLipschitz printed as its witness. - private static readonly float3 LipschitzWitness = new(-241.98447f, -249.98927f, -60.058212f); + private static readonly float3 LipschitzWitness = new(229.92526f, 73.37927f, -66.14595f); /// /// Pins SNOISE_LIPSCHITZ: no |snoise_grad| over 1e5 seeded points exceeds it, and the ascent from diff --git a/packages/cultmath/unity/org.gamecult.cultmath/Shaders/CultMath.Interval.hlsl b/packages/cultmath/unity/org.gamecult.cultmath/Shaders/CultMath.Interval.hlsl index b6b16665..22c19221 100644 --- a/packages/cultmath/unity/org.gamecult.cultmath/Shaders/CultMath.Interval.hlsl +++ b/packages/cultmath/unity/org.gamecult.cultmath/Shaders/CultMath.Interval.hlsl @@ -7,7 +7,7 @@ // Included by CultMath.hlsl after its own definitions of cultmath_smoothstep and cultmath_snoise. // Lipschitz constant of cultmath_snoise(float3); provenance in math.Interval.cs (SNOISE_LIPSCHITZ). -static const float CULTMATH_SNOISE_LIPSCHITZ = 10.099261; +static const float CULTMATH_SNOISE_LIPSCHITZ = 7.9640074; float2 cultmath_iv_point(float value) { return float2(value, value); } float2 cultmath_iv_add(float2 a, float2 b) { return float2(a.x + b.x, a.y + b.y); }