Meta Vens
0f2c1f04ef
Add PCG integer hashes to CultMath and release 0.2.3
...
CultMath's hash is the shader-style frac(sin(x) * 43758.5453) and
returns float. Unity.Mathematics' hash returned a well-mixed uint, and
seeding from the float hash collapses: a 100x100 position grid gave 1625
distinct values in Aetheria's zone generator.
- math.pcg(uint), pcg3d(int3/float2/float3), and pcg4d(int4/float4)
follow Jarzynski and Olano, "Hash Functions for GPU Rendering"
(JCGT 9(3), 2020). pcg3d and pcg4d are the paper's code from page 32.
pcg is O'Neill's RXS-M-XS 32/32 output over one LCG step, with the
constants checked against pcg-c's pcg_variants.h.
- CultMath has no uint vectors, so pcg3d and pcg4d carry uint bit
patterns in int3/int4. The float overloads hash IEEE-754 bits via the
HLSL intrinsic asuint(float), which is new. pcg3d(float2) holds z at
0, the paper's route for 2 -> N inputs.
- The HLSL mirror gains the same functions, written over scalar uints
so the text compiles both in dxc 1.9.0.5402 (lib_6_3, HV 2021, clean)
and in C#. HlslSourceCompatibilityTests now compares int and uint
arguments and results by value; a wrong shift in the mirror's pcg4d
gives 208 mismatches.
- Known-answer vectors come from an independent Python transcription.
pcg3d separates a 100x100 half-unit grid (the full int3). One
component alone has one birthday collision there, as a 32-bit value
can. The same grid on the integer lattice has none.
- design.md states that the hashes are integer-exact in HLSL and on the
CPU: dxc wraps uint multiply and add modulo 2^32, as C# unchecked does.
- Bump to 0.2.3 and rebuild the tracked Unity DLL and pdb.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 18:19:53 +02:00
..
BatchMath.cs
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
BatchMath.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
bool2.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
bool2.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
bool3.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
bool3.cs.meta
Make CultMath HLSL-shaped: writable components, bool-vector comparisons
2026-09-14 13:29:59 +02:00
bool4.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
bool4.cs.meta
Make CultMath HLSL-shaped: writable components, bool-vector comparisons
2026-09-14 13:29:59 +02:00
Color32.cs
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
Color32.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
CultMath.asmdef
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
CultMath.asmdef.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
CultMath.csproj
Add PCG integer hashes to CultMath and release 0.2.3
2026-09-14 18:19:53 +02:00
CultMath.csproj.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
CultMathTone.cs
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
CultMathTone.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
double2.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
double2.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
double3.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
double3.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
float2.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
float2.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
float2x2.cs
Document where matrix row writes are silently lost
2026-09-14 14:18:00 +02:00
float2x2.cs.meta
Make CultMath HLSL-shaped: writable components, bool-vector comparisons
2026-09-14 13:29:59 +02:00
float3.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
float3.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
float3x3.cs
Document where matrix row writes are silently lost
2026-09-14 14:18:00 +02:00
float3x3.cs.meta
Make CultMath HLSL-shaped: writable components, bool-vector comparisons
2026-09-14 13:29:59 +02:00
float4.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
float4.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
int2.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
int2.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
int3.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
int3.cs.meta
Make CultMath HLSL-shaped: writable components, bool-vector comparisons
2026-09-14 13:29:59 +02:00
int4.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
int4.cs.meta
Make CultMath HLSL-shaped: writable components, bool-vector comparisons
2026-09-14 13:29:59 +02:00
IsExternalInit.cs
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
IsExternalInit.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
math.cs
Add PCG integer hashes to CultMath and release 0.2.3
2026-09-14 18:19:53 +02:00
math.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
quaternion.cs
Make CultMath HLSL-shaped: writable components, bool-vector comparisons
2026-09-14 13:29:59 +02:00
quaternion.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
Random.cs
Make CultMath HLSL-shaped: writable components, bool-vector comparisons
2026-09-14 13:29:59 +02:00
Random.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
rect.cs
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
rect.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
Swizzles.g.cs
Add HLSL vector conversions, int clamp, and double frac to CultMath
2026-09-14 16:16:32 +02:00
Swizzles.g.cs.meta
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
UnscopedRefAttribute.cs
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
UnscopedRefAttribute.cs.meta
Generate every HLSL swizzle and mixed constructor; fix intrinsic types
2026-09-14 13:57:02 +02:00
Voronoi.cs
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00
Voronoi.cs.meta
Move CultMath into the CultLib monorepo
2026-08-26 17:35:51 +02:00