Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 96 additions & 14 deletions .llm/skills/validation-troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Skill: Validation Troubleshooting

<!-- trigger: error, ci, failure, troubleshoot, fix | Common validation errors, CI failures, fixes | Core -->
<!-- trigger: error, ci, failure, troubleshoot, fix, dead link, lychee, broken link | Common validation errors, CI failures, fixes | Core -->

**Trigger**: When you encounter validation errors, CI failures, or linting issues.

Expand All @@ -13,7 +13,7 @@ Use this guide when you encounter:
- CI/CD pipeline failures
- Linter error messages you need to fix
- Spelling or formatting issues
- Link validation failures
- Link validation failures (internal or external/dead links)
- Test lifecycle violations

For the quick validation workflow, see [validate-before-commit](./validate-before-commit.md).
Expand All @@ -30,18 +30,18 @@ For detailed linter commands, see [linter-reference](./linter-reference.md).
**Fix Options**:

1. **Correct the spelling** if it's actually wrong
2. **Add to dictionary** if it's a valid technical term

```bash
# Add to cspell.json
{
"words": [
"PRNG",
"Sirenix",
"MonoBehaviour"
]
}
```
2. **Add to dictionary** if it's a valid technical term:

```bash
# Add to cspell.json
{
"words": [
"PRNG",
"Sirenix",
"MonoBehaviour"
]
}
```

3. **Inline ignore** for single occurrences:

Expand Down Expand Up @@ -172,6 +172,88 @@ private int _count;
npm run eol:fix
```

### 10. Dead Link Failures (External URLs)

**Symptom**: `Check dead links (lychee)` step fails in CI

**Cause**: External URL in a `.md` file is broken, redirects, or times out.

**Important**: Lychee only scans `.md` files. URLs in `.cs` source files are NOT checked.

#### Investigation Process

1. **Check the CI output** — Lychee reports which file and URL failed
2. **Verify the URL manually** — Open in browser, check for redirects
3. **Identify the failure type** and apply the appropriate fix:

| Failure Type | Example | Fix |
| ------------------------ | ------------------------------------------------------- | --------------------------------------------------------------- |
| HTTP to HTTPS redirect | `http://example.com` redirects to `https://example.com` | Update URL to use `https://` |
| Domain migration | `xoshiro.di.unimi.it` moved to `prng.di.unimi.it` | Update to new domain |
| Permanently defunct site | Academic site went offline | Add regex to `.lychee.toml` exclude list |
| GitHub repo deleted | Third-party repo removed | Add to `.lychee.toml` exclude list |
| Transient server error | 5xx errors | Already handled — `.lychee.toml` accepts 5xx |
| Bot protection | Site returns 403 for automated requests | Add to `.lychee.toml` exclude list |
| URL in source code only | URL in `.cs` file metadata but not in docs | No action needed for CI (but consider updating for consistency) |

#### Common Fix Patterns

**HTTP to HTTPS upgrade:**

```markdown
<!-- Before -->

<http://example.com/resource>

<!-- After -->

<https://example.com/resource>
```

**Domain migration:**

```markdown
<!-- Before (old domain) -->

<https://xoshiro.di.unimi.it>

<!-- After (new domain) -->

<https://prng.di.unimi.it>
```

**Add permanently defunct site to `.lychee.toml`:**

```toml
exclude = [
# ... existing exclusions ...
# Site permanently offline (reason)
"^https?://defunct-site\\.example\\.com"
]
```

#### Source Code and Documentation Consistency

When updating URLs, check for consistency between:

1. **Source code metadata** — Attribution comments, XML docs in `.cs` files
2. **Documentation** — References in `.md` files
3. **Auto-generated docs** — Files in `docs/features/` that are generated from source metadata

URLs in source code are not checked by lychee, but inconsistent URLs between source and docs create confusion.

#### Quick Reference: `.lychee.toml` Location

The lychee configuration is at the repository root: `.lychee.toml`

Current exclusion categories:

- Local/test URLs (localhost, 127.0.0.1)
- Sites with bot protection (npmjs.com, doi.org)
- Known flaky sites (bugs.python.org)
- Defunct sites (wiki.unity3d.com, grepcode.com)
- Offline GitHub repositories

---

## Debugging Failed CI Runs
Expand Down
8 changes: 7 additions & 1 deletion .lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ exclude = [
"^https?://www\\.npmjs\\.com",
"^https?://doi\\.org",
# Known flaky/unreliable sites that cause intermittent CI failures
"^https?://bugs\\.python\\.org"
"^https?://bugs\\.python\\.org",
# Defunct or permanently unavailable sites
"^https?://wiki\\.unity3d\\.com",
"^https?://grepcode\\.com",
# Will Stafford Parsons repositories (offline)
"^https?://github\\.com/wileylooper",
"^https?://github\\.com/wstaffordp"
]

# Exclude file paths (regex patterns) - avoid scanning third-party code
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

See [the roadmap](./docs/overview/roadmap.md) for details

## [3.1.6]

### Fixed

- **Banner SVG Issues**: Various issues relating to Unity Helpers banner SVG rendering
- **Documentation nested list rendering**: Fixed GitHub Pages rendering where nested bullet lists appeared flat without proper indentation ([#175](https://github.com/wallstop/unity-helpers/issues/175))
- **Documentation too self-congratulatory**: Toned down the documentation to be more realistic and less LLM-speak

## [3.1.5]

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Core/Helper/LineHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Vector2 lineEnd
}

// c# implementation of the Ramer-Douglas-Peucker-Algorithm by Craig Selbert slightly adapted for Unity Vector Types
//http://www.codeproject.com/Articles/18936/A-Csharp-Implementation-of-Douglas-Peucker-Line-Ap
//https://www.codeproject.com/Articles/18936/A-Csharp-Implementation-of-Douglas-Peucker-Line-Ap
/// <summary>
/// Douglas–Peucker simplification that preserves extreme points with high precision (double tolerance).
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Core/Helper/Partials/MathHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static partial class Helpers
/// </remarks>
public static bool IsLeft(Vector2 a, Vector2 b, Vector2 point)
{
// http://alienryderflex.com/point_left_of_ray/
// https://alienryderflex.com/point_left_of_ray/

//check which side of line AB the point P is on
float cross = (b.x - a.x) * (point.y - a.y) - (point.x - a.x) * (b.y - a.y);
Expand Down
6 changes: 3 additions & 3 deletions Runtime/Core/Random/FlurryBurstRandom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ namespace WallstopStudios.UnityHelpers.Core.Random
/// </example>
[RandomGeneratorMetadata(
RandomQuality.Excellent,
"Hybrid Xoshiro/PCG variant tuned for all-around use; passes TestU01 BigCrush per upstream reference implementation.",
"Blackman & Vigna 2019",
"http://xoshiro.di.unimi.it"
"Six-word ARX-style generator tuned for all-around use; passes TestU01 BigCrush per upstream reference implementation.",
"Will Stafford Parsons (wileylooper)",
"https://github.com/wileylooper/flurryburst"
)]
[Serializable]
[DataContract]
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Core/Random/NativePcgRandom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public uint NextUint(uint max)
/*
https://github.com/libevent/libevent/blob/3807a30b03ab42f2f503f2db62b1ef5876e2be80/arc4random.c#L531

http://cs.stackexchange.com/questions/570/generating-uniformly-distributed-random-numbers-using-a-coin
https://cs.stackexchange.com/questions/570/generating-uniformly-distributed-random-numbers-using-a-coin
Generates a uniform random number within the bound, avoiding modulo bias
*/
uint threshold = unchecked((uint)((0x100000000UL - max) % max));
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Core/Random/SplitMix64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace WallstopStudios.UnityHelpers.Core.Random
RandomQuality.VeryGood,
"Well-known SplitMix64 mixer; passes TestU01 BigCrush and PractRand up to large data sizes in literature.",
"Vigna 2014",
"http://xoshiro.di.unimi.it/splitmix64.c"
"https://prng.di.unimi.it/splitmix64.c"
)]
[Serializable]
[DataContract]
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Core/Random/XoroShiroRandom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace WallstopStudios.UnityHelpers.Core.Random
RandomQuality.VeryGood,
"xoshiro128** variant; authors recommend for general-purpose use and report clean BigCrush performance with jump functions.",
"Blackman & Vigna 2019",
"http://xoshiro.di.unimi.it/xoshiro128starstar.c"
"https://prng.di.unimi.it/xoshiro128starstar.c"
)]
[Serializable]
[DataContract]
Expand Down
5 changes: 4 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,10 @@
"fallbacks",
"lacunarity",
"reentrancy",
"unsubscription"
"unsubscription",
"unimi",
"npmjs",
"doi"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion docs/images/unity-helpers-banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/performance/random-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<tr><td>LinearCongruentialGenerator</td><td align="right">1,333,700,000</td><td>Fastest</td><td>Poor</td><td>Minimal standard LCG; fails spectral tests and exhibits lattice artifacts beyond small dimensions.</td></tr>
<tr><td>WaveSplatRandom</td><td align="right">1,323,500,000</td><td>Fastest</td><td>Experimental</td><td>Single-word chaotic generator; author notes period 2^64 but provides no formal test results—treat as experimental.</td></tr>
<tr><td>BlastCircuitRandom</td><td align="right">1,068,900,000</td><td>Very Fast</td><td>Good</td><td>Empirical PractRand testing to 32GB shows strong diffusion; designed as a chaotic ARX mixer rather than a proven statistically optimal generator.</td></tr>
<tr><td>SplitMix64</td><td align="right">1,042,200,000</td><td>Very Fast</td><td>Very Good</td><td>Well-known SplitMix64 mixer; passes TestU01 BigCrush and PractRand up to large data sizes in literature. <a href="http://xoshiro.di.unimi.it/splitmix64.c">Vigna 2014</a></td></tr>
<tr><td>FlurryBurstRandom</td><td align="right">947,500,000</td><td>Fast</td><td>Excellent</td><td>Hybrid Xoshiro/PCG variant tuned for all-around use; passes TestU01 BigCrush per upstream reference implementation. <a href="http://xoshiro.di.unimi.it">Blackman &amp; Vigna 2019</a></td></tr>
<tr><td>SplitMix64</td><td align="right">1,042,200,000</td><td>Very Fast</td><td>Very Good</td><td>Well-known SplitMix64 mixer; passes TestU01 BigCrush and PractRand up to large data sizes in literature. <a href="https://prng.di.unimi.it/splitmix64.c">Vigna 2014</a></td></tr>
<tr><td>FlurryBurstRandom</td><td align="right">947,500,000</td><td>Fast</td><td>Excellent</td><td>Six-word ARX-style generator tuned for all-around use; passes TestU01 BigCrush per upstream reference implementation. <a href="https://github.com/wileylooper/flurryburst">Will Stafford Parsons (wileylooper)</a></td></tr>
<tr><td>PcgRandom</td><td align="right">916,300,000</td><td>Fast</td><td>Excellent</td><td>PCG XSH RR 64/32 variant; passes TestU01 BigCrush and PractRand in published results. <a href="https://www.pcg-random.org/paper.html">O&#39;Neill 2014</a></td></tr>
<tr><td>IllusionFlow</td><td align="right">891,400,000</td><td>Fast</td><td>Excellent</td><td>Hybridized PCG + xorshift design; upstream PractRand 64GB passes with no anomalies per author.</td></tr>
<tr><td>XoroShiroRandom</td><td align="right">762,900,000</td><td>Fast</td><td>Very Good</td><td>xoshiro128** variant; authors recommend for general-purpose use and report clean BigCrush performance with jump functions. <a href="http://xoshiro.di.unimi.it/xoshiro128starstar.c">Blackman &amp; Vigna 2019</a></td></tr>
<tr><td>XoroShiroRandom</td><td align="right">762,900,000</td><td>Fast</td><td>Very Good</td><td>xoshiro128** variant; authors recommend for general-purpose use and report clean BigCrush performance with jump functions. <a href="https://prng.di.unimi.it/xoshiro128starstar.c">Blackman &amp; Vigna 2019</a></td></tr>
<tr><td>RomuDuo</td><td align="right">757,900,000</td><td>Fast</td><td>Very Good</td><td>ROMU family member (RomuDuo); authors report strong BigCrush results with minor low-bit weaknesses in some rotations.</td></tr>
<tr><td>StormDropRandom</td><td align="right">713,500,000</td><td>Moderate</td><td>Excellent</td><td>20-word ARX generator derived from SHISHUA; author reports excellent PractRand performance and long periods.</td></tr>
<tr><td>XorShiftRandom</td><td align="right">599,800,000</td><td>Moderate</td><td>Fair</td><td>Classic 32-bit xorshift; known to fail portions of TestU01 and PractRand, acceptable for lightweight effects only. <a href="https://www.jstatsoft.org/article/view/v008i14">Marsaglia 2003</a></td></tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/project/third-party-notices.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ The following PRNG implementations in `Runtime/Core/Random/` are adapted from or

- Description: Fast, high-quality PRNGs with small state.
- Authors: David Blackman, Sebastiano Vigna
- Upstream: [xoshiro/xoroshiro website](http://xoshiro.di.unimi.it/)
- Upstream: [xoshiro/xoroshiro website](https://prng.di.unimi.it/)
- License: CC0 1.0 Universal (Public Domain)
- Notes: Implements xoroshiro128\*\* and SplitMix64 variants.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.wallstop-studios.unity-helpers",
"version": "3.1.5",
"version": "3.1.6",
"displayName": "Unity Helpers",
"description": "Treasure chest of Unity developer tools ",
"unity": "2021.3",
Expand Down
Loading