From 2d30db03e7d1832296ff4fe3f89a683a7e9e8be3 Mon Sep 17 00:00:00 2001 From: Nibu Date: Wed, 11 Nov 2026 12:08:24 +0000 Subject: [PATCH] gpu-parity: pin check requires a clean packages/cultmath and non-empty SHAs; README matches the run Co-Authored-By: Claude Sonnet 5.5 --- tools/gpu-parity/Program.cs | 4 +++- tools/gpu-parity/README.md | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/gpu-parity/Program.cs b/tools/gpu-parity/Program.cs index e3fdda6..6a28344 100644 --- a/tools/gpu-parity/Program.cs +++ b/tools/gpu-parity/Program.cs @@ -32,7 +32,9 @@ internal static class Program string head = Git(cultlib, "rev-parse HEAD"); string pin = Git(cultlib, $"rev-parse {PinTag}^{{commit}}"); Console.WriteLine($"CultLib {cultlib}\n HEAD {head}\n {PinTag} {pin}"); - if (head != pin) { Console.Error.WriteLine("PIN FAILED: CultLib HEAD is not the pinned tag."); return 3; } + string dirty = Git(cultlib, "status --porcelain -- packages/cultmath"); + if (head.Length == 0 || head != pin || dirty.Length != 0) + { Console.Error.WriteLine("PIN FAILED: CultLib HEAD is not the pinned tag, or packages/cultmath is modified."); return 3; } var pts = BuildPoints(out int tieCount); Console.WriteLine($"points: {pts.Length / 4} ({tieCount} tie-constructed, {pts.Length / 4 - tieCount} seeded random)"); diff --git a/tools/gpu-parity/README.md b/tools/gpu-parity/README.md index 1b81c3d..3dd8c00 100644 --- a/tools/gpu-parity/README.md +++ b/tools/gpu-parity/README.md @@ -18,9 +18,9 @@ dotnet run -c Release --project tools/gpu-parity/GpuParity.csproj ``` It compiles the kernel twice (default flags, where FMA contraction is allowed, and `/Gis` IEEE strict), -dispatches once per flag (about 130k threads), and prints max abs / max relative error per function, +dispatches once per flag (about 164k threads), and prints max abs / max relative error per function, split into tie-constructed points and a seeded random sweep. Exit code 0 means within `Tolerance` -(in `Program.cs`) and no branch mismatches. +(in `Program.cs`). Branch mismatches are reported, not failed. Points: dyadic coordinates on the simplex tie planes (`x0.x == x0.y`, `y == z`, `x == z`, offsets k in -2..2) with 0, 1 and 2 ulp neighbours, plus 3 x 40000 seeded uniform points at scales 4, 64, 1024. @@ -55,7 +55,7 @@ the first steps differently), not with the noise: 16x more input magnitude gave the first two tiers. Single GPU and driver; a different driver may need the bounds re-measured. Tie handling: under both flag sets the GPU took a different simplex ordering branch than C# at -190 of 35814 tie points (float3) and 39 (float2) with |p| <= 8, 2 and 4 in the middle tier, 0 above +190 of 35814 tie points (float3) and 39 (float2) with |p| <= 8, 2 and 4 in the middle tier, 0 above among tie points (the random sweep above 128 had 1 float3 mismatch) (the same counts under `/Gis`, so it is not FMA contraction; the probe is a separate expression tree, so it is evidence of a GPU/CPU rounding difference in x0, not of the noise body's own path). Every one of those points is inside the value and gradient tolerance: the noise is continuous across the tie, so a